[PATCH] D130832: [X86][BF16] Make backend type bf16 to follow the psABI

LuoYuanke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 8 22:59:58 PDT 2022


LuoYuanke added inline comments.


================
Comment at: llvm/test/CodeGen/X86/bfloat.ll:28
 
-define void @add_double(ptr %pa, ptr %pb, ptr %pc) {
+define bfloat @add2(bfloat %a, bfloat %b, bfloat %c) nounwind {
+; CHECK-LABEL: add2:
----------------
Parameter `%c` is not used, so we can delete it.


================
Comment at: llvm/test/CodeGen/X86/bfloat.ll:97
+; CHECK-NEXT:    addss {{[-0-9]+}}(%r{{[sb]}}p), %xmm0 # 4-byte Folded Reload
+; CHECK-NEXT:    cvtss2sd %xmm0, %xmm0
+; CHECK-NEXT:    addq $24, %rsp
----------------
The `%add` is not converted to `bfloat` from float and it is converted to `double` directly. Is this the expected behaviour?


================
Comment at: llvm/test/CodeGen/X86/bfloat.ll:134
+; CHECK-NEXT:    movd %eax, %xmm0
+; CHECK-NEXT:    addss {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
+; CHECK-NEXT:    callq __truncsfbf2 at PLT
----------------
`1.0` is in float format. Is it the expected behaviour?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130832/new/

https://reviews.llvm.org/D130832



More information about the llvm-commits mailing list