17 | module Compiler.DType
19 | import Compiler.MLIR.IR.MLIRContext
20 | import Compiler.MLIR.IR.Types
21 | import Compiler.MLIR.IR.BuiltinTypes
25 | numBits : DType -> Bits16
34 | isSigned : DType -> Bool
35 | isSigned PRED = True
38 | isSigned U32 = False
39 | isSigned U64 = False
43 | mlirType : HasIO io => MLIRContext -> DType -> io Type_
44 | mlirType ctx PRED = cast <$> IntegerType.get ctx 1 Signless
45 | mlirType ctx S32 = cast <$> IntegerType.get ctx 32 Signless
46 | mlirType ctx S64 = cast <$> IntegerType.get ctx 64 Signless
47 | mlirType ctx U32 = cast <$> IntegerType.get ctx 32 Unsigned
48 | mlirType ctx U64 = cast <$> IntegerType.get ctx 64 Unsigned
49 | mlirType ctx F64 = cast <$> Float64Type.get ctx