lightning
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] ppc: Fix 'calli' when floating-point arguments are passed


From: Paul Cercueil
Subject: [PATCH] ppc: Fix 'calli' when floating-point arguments are passed
Date: Tue, 23 Aug 2022 17:15:43 +0200

When varargs are used, the condition register bit 6 must be set to 1 to
specify that one or more arguments are passed in the floating-point
registers.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 lib/jit_ppc-cpu.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/jit_ppc-cpu.c b/lib/jit_ppc-cpu.c
index 8f89fa5..ff871e3 100644
--- a/lib/jit_ppc-cpu.c
+++ b/lib/jit_ppc-cpu.c
@@ -3258,9 +3258,12 @@ _calli(jit_state_t *_jit, jit_word_t i0
 #  if _CALL_SYSV
     jit_word_t         d;
     d = (i0 - _jit->pc.w) & ~3;
-    if (can_sign_extend_jump_p(d))
-       BL(d);
-    else
+    if (can_sign_extend_jump_p(d)) {
+        /* Tell double arguments were passed in registers. */
+        if (varargs)
+            CREQV(6, 6, 6);
+        BL(d);
+    } else
 #  endif
     {
        movi(_R12_REGNO, i0);
-- 
2.35.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]