diff --git a/mlir/include/mlir-c/BuiltinTypes.h b/mlir/include/mlir-c/BuiltinTypes.h --- a/mlir/include/mlir-c/BuiltinTypes.h +++ b/mlir/include/mlir-c/BuiltinTypes.h @@ -173,6 +173,17 @@ /// context. MLIR_CAPI_EXPORTED MlirType mlirTF32TypeGet(MlirContext ctx); +/// Returns the typeID of a TF128 type. +MLIR_CAPI_EXPORTED MlirTypeID mlirFloat128TypeGetTypeID(void); + +/// Checks whether the given type is an TF128 type. +MLIR_CAPI_EXPORTED bool mlirTypeIsATF128(MlirType type); + +/// Creates a TF128 type in the given context. The type is owned by the +/// context. +MLIR_CAPI_EXPORTED MlirType mlirF128TypeGet(MlirContext ctx); + + //===----------------------------------------------------------------------===// // None type. //===----------------------------------------------------------------------===// diff --git a/mlir/lib/CAPI/IR/BuiltinTypes.cpp b/mlir/lib/CAPI/IR/BuiltinTypes.cpp --- a/mlir/lib/CAPI/IR/BuiltinTypes.cpp +++ b/mlir/lib/CAPI/IR/BuiltinTypes.cpp @@ -178,6 +178,15 @@ return wrap(FloatType::getF64(unwrap(ctx))); } +MlirTypeID mlirFloat128TypeGetTypeID() { return wrap(Float128Type::getTypeID()); } + +bool mlirTypeIsAF128(MlirType type) { return unwrap(type).isF128(); } + +MlirType mlirF128TypeGet(MlirContext ctx) { + return wrap(FloatType::getF128(unwrap(ctx))); +} + + //===----------------------------------------------------------------------===// // None type. //===----------------------------------------------------------------------===//