[llvm] [AVR] Change `half` to use `softPromoteHalfType` (PR #152783)

Trevor Gross via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 9 20:03:06 PDT 2025


tgross35 wrote:

Thank you for reviewing!

> I saw pairs of
> 
> ```
> ; CHECK-NEXT:    rcall __truncsfhf2
> ; CHECK-NEXT:    rcall __extendhfsf2
> ```
> 
> generated after this PR, though this is less efficient, it is better than broken.

Indeed: this changes from "unusably broken+slow" to "slower". Really this just makes it possible to do future work.

`half` does need to round back to f16 after every op to get the right IEEE semantics if it does the work as `f32`  (the `bfloat` type doesn't have to). This could be better: promoting to a `f32` for all operations doesn't really make sense on targets that don't have hardware f32. Eventually I'm planning to add the option of just using `__addhf3` and similar instead, but for now I'm just trying to get all targets to work.

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


More information about the llvm-commits mailing list