@@ -80,12 +80,10 @@ def CIR_IntType : CIR_Type<"Int", "int",
8080// FloatType
8181//===----------------------------------------------------------------------===//
8282
83- class CIR_FloatType<string name, string mnemonic>
84- : CIR_Type<name, mnemonic,
85- [
86- DeclareTypeInterfaceMethods<DataLayoutTypeInterface>,
87- DeclareTypeInterfaceMethods<CIRFPTypeInterface>,
88- ]> {}
83+ class CIR_FloatType<string name, string mnemonic> : CIR_Type<name, mnemonic, [
84+ DeclareTypeInterfaceMethods<DataLayoutTypeInterface>,
85+ DeclareTypeInterfaceMethods<CIRFPTypeInterface>
86+ ]>;
8987
9088def CIR_Single : CIR_FloatType<"Single", "float"> {
9189 let summary = "CIR single-precision float type";
@@ -99,7 +97,7 @@ def CIR_Double : CIR_FloatType<"Double", "double"> {
9997 let summary = "CIR double-precision float type";
10098 let description = [{
10199 Floating-point type that represents the `double` type in C/C++. Its
102- underlying floating-point format is the IEEE-754 binar64 format.
100+ underlying floating-point format is the IEEE-754 binary64 format.
103101 }];
104102}
105103
@@ -138,25 +136,17 @@ def CIR_LongDouble : CIR_FloatType<"LongDouble", "long_double"> {
138136
139137 The underlying floating-point format of a long double value depends on the
140138 implementation. The `underlying` parameter specifies the CIR floating-point
141- type that corresponds to this format. For now, it can only be either
142- `!cir.double` or `!cir.fp80`.
139+ type that corresponds to this format.
143140 }];
144141
145- let parameters = (ins "mlir::Type":$underlying);
142+ let parameters = (ins AnyTypeOf<[CIR_Double, CIR_FP80, CIR_FP128],
143+ "expects !cir.double, !cir.fp80 or !cir.fp128">:$underlying);
146144
147145 let assemblyFormat = [{
148146 `<` $underlying `>`
149147 }];
150-
151- let genVerifyDecl = 1;
152148}
153149
154- // Constraints
155-
156- def CIR_AnyFloat: AnyTypeOf<[CIR_Single, CIR_Double, CIR_FP80, CIR_FP128, CIR_LongDouble,
157- CIR_FP16, CIR_BFloat16]>;
158- def CIR_AnyIntOrFloat: AnyTypeOf<[CIR_AnyFloat, CIR_IntType]>;
159-
160150//===----------------------------------------------------------------------===//
161151// ComplexType
162152//===----------------------------------------------------------------------===//
@@ -566,11 +556,12 @@ def FPVector : Type<
566556
567557// Constraints
568558def CIR_AnyIntOrVecOfInt: AnyTypeOf<[CIR_IntType, IntegerVector]>;
559+
569560def CIR_AnySignedIntOrVecOfSignedInt: AnyTypeOf<[
570561 CIR_AnyFundamentalSIntType, SignedIntegerVector
571562]>;
572563
573- def CIR_AnyFloatOrVecOfFloat: AnyTypeOf<[CIR_AnyFloat , FPVector]>;
564+ def CIR_AnyFloatOrVecOfFloat: AnyTypeOf<[CIR_AnyFloatType , FPVector]>;
574565
575566// Pointer to Arrays
576567def ArrayPtr : Type<
@@ -667,7 +658,7 @@ def CIR_RecordType : CIR_Type<"Record", "record",
667658 CArg<"ASTRecordDeclInterface", "{}">:$ast
668659 ), [{
669660 return $_get($_ctxt, members, name, /*complete=*/true, packed, padded,
670- kind, ast);
661+ kind, ast);
671662 }]>,
672663
673664 // Create an identified and incomplete record type.
@@ -678,7 +669,7 @@ def CIR_RecordType : CIR_Type<"Record", "record",
678669 return $_get($_ctxt, /*members=*/llvm::ArrayRef<Type>{}, name,
679670 /*complete=*/false, /*packed=*/false,
680671 /*padded=*/false, kind,
681- /*ast=*/ASTRecordDeclInterface{});
672+ /*ast=*/ASTRecordDeclInterface{});
682673 }]>,
683674
684675 // Create an anonymous record type (always complete).
@@ -755,8 +746,7 @@ def CIRRecordType : Type<
755746def CIR_AnyType : AnyTypeOf<[
756747 CIR_IntType, CIR_PointerType, CIR_DataMemberType, CIR_MethodType,
757748 CIR_BoolType, CIR_ArrayType, CIR_VectorType, CIR_FuncType, CIR_VoidType,
758- CIR_RecordType, CIR_ExceptionType, CIR_AnyFloat, CIR_FP16, CIR_BFloat16,
759- CIR_ComplexType
749+ CIR_RecordType, CIR_ExceptionType, CIR_AnyFloatType, CIR_ComplexType
760750]>;
761751
762752#endif // MLIR_CIR_DIALECT_CIR_TYPES
0 commit comments