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

Trevor Gross via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 8 13:01:30 PDT 2025


================
@@ -7,10 +7,10 @@
 define void @store(half %x, ptr %p) nounwind {
 ; CHECK-LABEL: store:
 ; CHECK:       ; %bb.0:
-; CHECK-NEXT:    mov r30, r20
-; CHECK-NEXT:    mov r31, r21
-; CHECK-NEXT:    std Z+1, r23
-; CHECK-NEXT:    st Z, r22
+; CHECK-NEXT:    mov r30, r22
+; CHECK-NEXT:    mov r31, r23
+; CHECK-NEXT:    std Z+1, r25
+; CHECK-NEXT:    st Z, r24
 ; CHECK-NEXT:    ret
   store half %x, ptr %p
   ret void
----------------
tgross35 wrote:

I was unclear about where the existing CC came from but I think it assumed that the `f16` was stored in the lower half of an `f32`, which would be passed in r22..=r25. Now it is just using the `i16` ABI, which makes more sense.

https://llvm.godbolt.org/z/f6Gfn9TPb

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


More information about the llvm-commits mailing list