[llvm] Add support for DFP IR type. (PR #69718)

Andy Kaylor via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 20 11:28:09 PDT 2023


================
@@ -56,10 +56,13 @@ class Type {
     HalfTyID = 0,  ///< 16-bit floating point type
     BFloatTyID,    ///< 16-bit floating point type (7-bit significand)
     FloatTyID,     ///< 32-bit floating point type
+    Decimal32TyID, ///< 32-bit decimal floating point type
----------------
andykaylor wrote:

I _think_ this should be above FloatTyID so that decimal32->float would be an fpext operation rather than the other way around. I'm saying this based on the number of bits in their respective significands, but the bits mean something different so I don't know if this is strictly correct either way. Also, by my reasoning, BFloatTyID should be above HalfTyID, but clang currently generates an fptrunc instruction (when it doesn't crash) when converting from half to bfloat. That seems wrong to me, but I suppose it's more or less arbitrary.

https://github.com/llvm/llvm-project/pull/69718


More information about the llvm-commits mailing list