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