[clang] [clang] fix half && bfloat16 convert node expr codegen (PR #89051)

via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 17 19:59:34 PDT 2024


JinjinLi868 wrote:

> > This appears to just assert today, but interpreting this as bitcast doesn't make sense. I would expect this to emit a pair of casts, fpext to float, and fptrunc down to half
> 
> If we don't just reject it as an invalid cast

i understand your means, it like a Hardware behavior to do fp16 convert to bf16(firstly, fp16 fpext to float32, second , float32 fptrunc to bfloat16).  But In some target, it supply a HW instruction to complete the process  (fp16->float32->bf16) . so it just supply a intrinsic (fp16 -> bf16)

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


More information about the cfe-commits mailing list