[clang] [compiler-rt] [llvm] [SPARC] Properly handle CC for long double on sparc32 (PR #162226)

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 24 00:36:52 PST 2025


================
@@ -268,44 +268,50 @@ define void @test_fptrunc_double(double %d, ptr %p) nounwind {
 define void @test_fptrunc_fp128(ptr %dp, ptr %p) nounwind {
 ; V8-OPT-LABEL: test_fptrunc_fp128:
 ; V8-OPT:       ! %bb.0:
-; V8-OPT-NEXT:    save %sp, -104, %sp
+; V8-OPT-NEXT:    save %sp, -120, %sp
 ; V8-OPT-NEXT:    ldd [%i0], %f0
 ; V8-OPT-NEXT:    ldd [%i0+8], %f4
-; V8-OPT-NEXT:    std %f4, [%sp+100]
+; V8-OPT-NEXT:    add %fp, -16, %i0
----------------
koachan wrote:

Ah, I think it should be correct. The original code is wrong because the caller passes the float directly in the extended argument space (%sp+92 upwards).
The psABI docs, instead, specifies that the caller should copy the float into a temporary space (starting from %fp-1 downwards) in its own frame, then pass the pointer to it to the callee.

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


More information about the llvm-commits mailing list