]> git.eshelyaron.com Git - emacs.git/commitdiff
* src/comp.c: Fix 32bit wide-int.
authorAndrea Corallo <akrl@sdf.org>
Thu, 21 May 2020 16:51:31 +0000 (17:51 +0100)
committerAndrea Corallo <akrl@sdf.org>
Fri, 22 May 2020 20:54:02 +0000 (21:54 +0100)
* src/comp.c (emit_XFIXNUM): Make right shift for MSB_TAG
arithmetic too to preserve sign bit.

src/comp.c

index 6371757487c99689f20e37056cfb1abaef097a86..994bd7db9346e80fda50186ea1ea7d3b37017fdd 100644 (file)
@@ -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,