[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp 0a2ac47 4/4: * src/comp.c: Fix 32bit wide-int.
From: |
Andrea Corallo |
Subject: |
feature/native-comp 0a2ac47 4/4: * src/comp.c: Fix 32bit wide-int. |
Date: |
Fri, 22 May 2020 17:15:44 -0400 (EDT) |
branch: feature/native-comp
commit 0a2ac47909c497d299e5d5cc111cf77206dcda9b
Author: Andrea Corallo <address@hidden>
Commit: Andrea Corallo <address@hidden>
* src/comp.c: Fix 32bit wide-int.
* src/comp.c (emit_XFIXNUM): Make right shift for MSB_TAG
arithmetic too to preserve sign bit.
---
src/comp.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/comp.c b/src/comp.c
index 6371757..994bd7d 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -1066,6 +1066,8 @@ emit_XFIXNUM (gcc_jit_rvalue *obj)
emit_comment ("XFIXNUM");
gcc_jit_rvalue *i = emit_coerce (comp.emacs_uint_type, emit_XLI (obj));
+ /* FIXME: Implementation dependent (both RSHIFT are arithmetics). */
+
if (!USE_LSB_TAG)
{
i = emit_binary_op (GCC_JIT_BINARY_OP_LSHIFT,
@@ -1073,14 +1075,12 @@ emit_XFIXNUM (gcc_jit_rvalue *obj)
i,
comp.inttypebits);
- return emit_coerce (comp.emacs_int_type,
- emit_binary_op (GCC_JIT_BINARY_OP_RSHIFT,
- comp.emacs_uint_type,
- i,
- comp.inttypebits));
+ return emit_binary_op (GCC_JIT_BINARY_OP_RSHIFT,
+ comp.emacs_int_type,
+ i,
+ comp.inttypebits);
}
else
- /* FIXME: Implementation dependent (wants arithmetic shift). */
return emit_coerce (comp.emacs_int_type,
emit_binary_op (GCC_JIT_BINARY_OP_RSHIFT,
comp.emacs_int_type,