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

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 9 02:13:53 PDT 2022


pengfei added inline comments.


================
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
----------------
LuoYuanke wrote:
> The `%add` is not converted to `bfloat` from float and it is converted to `double` directly. Is this the expected behaviour?
Good catch! I believe it is a bug, but it's not related to this patch. I'll do a follow up.


================
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
----------------
LuoYuanke wrote:
> `1.0` is in float format. Is it the expected behaviour?
We don't use extra label to represent the FP constant in LLVM IR, the type `bfloat` has already indicated it. https://llvm.org/docs/LangRef.html#simple-constants


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