[clang] [llvm] [RFC][AMDGPU] Use `bf16` instead of `i16` for bfloat (PR #80908)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 12 10:51:08 PST 2024


================
@@ -2660,15 +2660,34 @@ bool isInlinableLiteral16(int16_t Literal, bool HasInv2Pi) {
     return true;
 
   uint16_t Val = static_cast<uint16_t>(Literal);
-  return Val == 0x3C00 || // 1.0
-         Val == 0xBC00 || // -1.0
-         Val == 0x3800 || // 0.5
-         Val == 0xB800 || // -0.5
-         Val == 0x4000 || // 2.0
-         Val == 0xC000 || // -2.0
-         Val == 0x4400 || // 4.0
-         Val == 0xC400 || // -4.0
-         Val == 0x3118;   // 1/2pi
+
+  // FP16
+  if (Val == 0x3C00 || // 1.0
----------------
shiltian wrote:

This function might be removed eventually in https://github.com/llvm/llvm-project/pull/81345.

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


More information about the llvm-commits mailing list