clangir
clangir copied to clipboard
[CIR] Add support for float16 and bfloat
This PR adds two new CIR floating-point types, namely !cir.f16
and !cir.bf16
, to represent the float16 format and bfloat format, respectively. CIRGen, LLVMIR lowering, and MLIR lowering for the two new types are also included in this PR.
This PR converts the clang extension type _Float16
to !cir.f16
, and converts the clang extension type __bf16
type to !cir.bf16
. The type conversion for clang extension type __fp16
is not included in this PR since it requires additional work during CIRGen.
Nathan just did a rebase, can you please update? Sorry for the churn
Rebased onto the latest main
.
Rebased onto the latest main
and updated this PR according to the latest reviews:
- This PR now only deals with the CIRGen of the two new floating point types as this is already complex enough to be stuffed into a single PR.
-
CIRGenExprScalar
is updated according to the original clang CodeGen. Specifically, scalar promotion of the new half-precision types is added to the CIRGen.