[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/6] ppc: Add endianness check to _truncr_d_i
From: |
Kim Kuparinen |
Subject: |
[PATCH 4/6] ppc: Add endianness check to _truncr_d_i |
Date: |
Sat, 20 Nov 2021 13:13:25 +0200 |
When running on ppc64el, _trunc_d_i loads the upper four bytes of the truncated
value instead of the lower bytes, causing make check to fail.
Signed-off-by: Kim Kuparinen <kimi.h.kuparinen@gmail.com>
---
lib/jit_ppc-fpu.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/jit_ppc-fpu.c b/lib/jit_ppc-fpu.c
index 1e84f8e..e954f48 100644
--- a/lib/jit_ppc-fpu.c
+++ b/lib/jit_ppc-fpu.c
@@ -511,7 +511,11 @@ _truncr_d_i(jit_state_t *_jit, jit_int32_t r0, jit_int32_t
r1)
FCTIWZ(rn(reg), r1);
/* use reserved 8 bytes area */
stxi_d(alloca_offset - 8, _FP_REGNO, rn(reg));
+# if defined(__ORDER_BIG_ENDIAN)
ldxi_i(r0, _FP_REGNO, alloca_offset - 4);
+# else
+ ldxi_i(r0, _FP_REGNO, alloca_offset - 8);
+# endif
jit_unget_reg(reg);
}
--
2.33.0
- [PATCH 0/6] Misc patches to pass the testsuite and remove warnings, Kim Kuparinen, 2021/11/20
- [PATCH 1/6] riscv: Fix movi/relatives loading incorrect value, Kim Kuparinen, 2021/11/20
- [PATCH 2/6] arm: Force RES0 bits in TST/A1 to be 0, Kim Kuparinen, 2021/11/20
- [PATCH 3/6] mips: Use DEXT when in 64-bit mode instead of EXT, Kim Kuparinen, 2021/11/20
- [PATCH 6/6] Include math.h in check/lightning.c, Kim Kuparinen, 2021/11/20
- [PATCH 5/6] misc: Add bfd_arch to arm/aarch64/mips, Kim Kuparinen, 2021/11/20
- [PATCH 4/6] ppc: Add endianness check to _truncr_d_i,
Kim Kuparinen <=
- Re: [PATCH 0/6] Misc patches to pass the testsuite and remove warnings, Kim Kuparinen, 2021/11/20