[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/6] mips: Use DEXT when in 64-bit mode instead of EXT
From: |
Kim Kuparinen |
Subject: |
[PATCH 3/6] mips: Use DEXT when in 64-bit mode instead of EXT |
Date: |
Sat, 20 Nov 2021 13:13:24 +0200 |
EXT sign-extends the value, which caused make check to fail on
qemu-system-mips64el. On 64-bit systems,
DEXT should probably be used, as it zero-extends the value.
https://s3-eu-west-1.amazonaws.com/downloads-mips/documents/MD00087-2B-MIPS64BIS-AFP-6.06.pdf
EXT on page 254, and DEXT on 195.
Signed-off-by: Kim Kuparinen <kimi.h.kuparinen@gmail.com>
---
lib/jit_mips-cpu.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/jit_mips-cpu.c b/lib/jit_mips-cpu.c
index b73f4b1..d844c26 100644
--- a/lib/jit_mips-cpu.c
+++ b/lib/jit_mips-cpu.c
@@ -1170,7 +1170,11 @@ _andi(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1,
jit_word_t i0)
else if (is_low_mask(i0)) {
#if defined(_MIPS_ARCH_MIPS32R2) || defined(_MIPS_ARCH_MIPS64R2)
if (masked_bits_count(i0) <= 32)
- EXT(r0, r1, 0, masked_bits_count(i0));
+#if defined(_MIPS_ARCH_MIPS32R2)
+ EXT(r0, r1, 0, masked_bits_count(i0));
+#else
+ DEXT(r0, r1, 0, masked_bits_count(i0));
+#endif
else
#endif
{
--
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 <=
- [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, 2021/11/20
- Re: [PATCH 0/6] Misc patches to pass the testsuite and remove warnings, Kim Kuparinen, 2021/11/20