aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Corallo2020-05-21 17:51:31 +0100
committerAndrea Corallo2020-05-22 21:54:02 +0100
commit0a2ac47909c497d299e5d5cc111cf77206dcda9b (patch)
tree90c84039cf05dd016feb43094ec7d9397d36d33f
parentf036ec97cecc8d7ec2cd36741bbe2619cda1207b (diff)
downloademacs-0a2ac47909c497d299e5d5cc111cf77206dcda9b.tar.gz
emacs-0a2ac47909c497d299e5d5cc111cf77206dcda9b.zip
* src/comp.c: Fix 32bit wide-int.
* src/comp.c (emit_XFIXNUM): Make right shift for MSB_TAG arithmetic too to preserve sign bit.
-rw-r--r--src/comp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/comp.c b/src/comp.c
index 6371757487c..994bd7db934 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -1066,6 +1066,8 @@ emit_XFIXNUM (gcc_jit_rvalue *obj)
1066 emit_comment ("XFIXNUM"); 1066 emit_comment ("XFIXNUM");
1067 gcc_jit_rvalue *i = emit_coerce (comp.emacs_uint_type, emit_XLI (obj)); 1067 gcc_jit_rvalue *i = emit_coerce (comp.emacs_uint_type, emit_XLI (obj));
1068 1068
1069 /* FIXME: Implementation dependent (both RSHIFT are arithmetics). */
1070
1069 if (!USE_LSB_TAG) 1071 if (!USE_LSB_TAG)
1070 { 1072 {
1071 i = emit_binary_op (GCC_JIT_BINARY_OP_LSHIFT, 1073 i = emit_binary_op (GCC_JIT_BINARY_OP_LSHIFT,
@@ -1073,14 +1075,12 @@ emit_XFIXNUM (gcc_jit_rvalue *obj)
1073 i, 1075 i,
1074 comp.inttypebits); 1076 comp.inttypebits);
1075 1077
1076 return emit_coerce (comp.emacs_int_type, 1078 return emit_binary_op (GCC_JIT_BINARY_OP_RSHIFT,
1077 emit_binary_op (GCC_JIT_BINARY_OP_RSHIFT, 1079 comp.emacs_int_type,
1078 comp.emacs_uint_type, 1080 i,
1079 i, 1081 comp.inttypebits);
1080 comp.inttypebits));
1081 } 1082 }
1082 else 1083 else
1083 /* FIXME: Implementation dependent (wants arithmetic shift). */
1084 return emit_coerce (comp.emacs_int_type, 1084 return emit_coerce (comp.emacs_int_type,
1085 emit_binary_op (GCC_JIT_BINARY_OP_RSHIFT, 1085 emit_binary_op (GCC_JIT_BINARY_OP_RSHIFT,
1086 comp.emacs_int_type, 1086 comp.emacs_int_type,