[PATCH] D127982: [X86][FP16] Enable vector support for FP16 emulation

Bing Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 18 00:37:42 PDT 2022


yubing added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:1873
     }
+    setF16Action(MVT::v32f16, Expand);
+    setOperationAction(ISD::FP_ROUND, MVT::v16f16, Custom);
----------------
it seems you forgot v32f16's fadd. now you make v32f16 type legal, then v32f16's fadd become legal, but there is no v32f16's fadd's instruction for avx512 without fp16. it will lead to crash.
i would like to suggest that we can promote  v32f16's fadd to v32f32's fadd, which can be split into two v16f32's fadd by legalizeType(after vector legalization). what do you think?

```
    for (unsigned Opc : { ISD::FADD, ISD::FSUB, ISD::FMUL, ISD::FDIV })
      setOperationPromotedToType(Opc, MVT::v32f16, MVT::v32f32);
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127982



More information about the llvm-commits mailing list