[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp 346d509 7/9: * src/comp.c (emit_const_lisp_obj, emit
From: |
Andrea Corallo |
Subject: |
feature/native-comp 346d509 7/9: * src/comp.c (emit_const_lisp_obj, emit_mvar_val): Fix. |
Date: |
Sun, 5 Apr 2020 17:25:08 -0400 (EDT) |
branch: feature/native-comp
commit 346d50989a446285d38d411f8f77350ba4af5222
Author: Andrea Corallo <address@hidden>
Commit: Andrea Corallo <address@hidden>
* src/comp.c (emit_const_lisp_obj, emit_mvar_val): Fix.
---
src/comp.c | 32 ++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)
diff --git a/src/comp.c b/src/comp.c
index 904869d..44de1f5 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -1098,10 +1098,19 @@ emit_const_lisp_obj (Lisp_Object obj)
SSDATA (Fprin1_to_string (obj, Qnil))));
if (NIL_IS_ZERO && EQ (obj, Qnil))
- return emit_coerce (comp.lisp_obj_type,
- gcc_jit_context_new_rvalue_from_ptr (comp.ctxt,
- comp.void_ptr_type,
- NULL));
+ {
+ gcc_jit_rvalue *n;
+#ifdef WIDE_EMACS_INT
+ eassert (NIL_IS_ZERO);
+ n = emit_rvalue_from_long_long (0);
+#else
+ n = gcc_jit_context_new_rvalue_from_ptr (comp.ctxt,
+ comp.void_ptr_type,
+ NULL);
+#endif
+ return emit_coerce (comp.lisp_obj_type, n);
+ }
+
imm_reloc_t reloc = obj_to_reloc (obj);
return
gcc_jit_lvalue_as_rvalue (
@@ -1319,12 +1328,15 @@ emit_mvar_val (Lisp_Object mvar)
/* We can still emit directly objects that are self-contained in a
word (read fixnums). */
emit_comment (SSDATA (Fprin1_to_string (constant, Qnil)));
- gcc_jit_rvalue *word =
- (sizeof (MOST_POSITIVE_FIXNUM) > sizeof (void *))
- ? emit_rvalue_from_long_long (constant)
- : gcc_jit_context_new_rvalue_from_long (comp.ctxt,
- comp.void_ptr_type,
- constant);
+ gcc_jit_rvalue *word;
+#ifdef WIDE_EMACS_INT
+ word = emit_rvalue_from_long_long (constant);
+#else
+ word =
+ gcc_jit_context_new_rvalue_from_ptr (comp.ctxt,
+ comp.void_ptr_type,
+ constant);
+#endif
return emit_coerce (comp.lisp_obj_type, word);
}
/* Other const objects are fetched from the reloc array. */
- feature/native-comp updated (fcce8dd -> 3608623), Andrea Corallo, 2020/04/05
- feature/native-comp 346d509 7/9: * src/comp.c (emit_const_lisp_obj, emit_mvar_val): Fix.,
Andrea Corallo <=
- feature/native-comp 4263f2f 8/9: * src/comp.c (emit_XFIXNUM): Fix for LSB_TAG plus annotate a FIXME., Andrea Corallo, 2020/04/05
- feature/native-comp 70cb964 2/9: * src/comp.c: Clean-up unnecessary field declaration., Andrea Corallo, 2020/04/05
- feature/native-comp 5983804 6/9: * src/comp.c (hash_native_abi): Fix assertion., Andrea Corallo, 2020/04/05
- feature/native-comp 49a3790 3/9: * src/comp.c: Add MSB TAG and wide int support., Andrea Corallo, 2020/04/05
- feature/native-comp e3dff70 4/9: * src/comp.c: Emit cast only when necessary., Andrea Corallo, 2020/04/05
- feature/native-comp 37a9d1e 1/9: * lisp/emacs-lisp/comp.el (native-compile): Better documentation., Andrea Corallo, 2020/04/05
- feature/native-comp 7009e8a 5/9: * src/comp.c (emit_binary_op): New function., Andrea Corallo, 2020/04/05
- feature/native-comp 3608623 9/9: Merge remote-tracking branch 'savannah/master' into HEAD, Andrea Corallo, 2020/04/05