================
@@ -157,6 +157,27 @@ static uint32_t getLit16Encoding(uint16_t Val, const 
MCSubtargetInfo &STI) {
   return 255;
 }
 
+static uint32_t getLitBF16Encoding(uint16_t Val) {
+  uint16_t IntImm = getIntInlineImmEncoding(static_cast<int16_t>(Val));
+  if (IntImm != 0)
+    return IntImm;
+
+  // clang-format off
+  switch (Val) {
----------------
shiltian wrote:

In theory, yes, but for now we can't because `getInlineEncodingV2BF16` can't 
handle some cases (that I didn't dig yet). It looks like in the conversion 
between `uint16_t` and `uint32_t` that makes some test cases fail. IMO we need 
to unify them (not only for 16-bit) in one place instead of having almost the 
same logic at least in three places.

https://github.com/llvm/llvm-project/pull/80908
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to