lightning
[Top][All Lists]
Advanced

[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




reply via email to

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