aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrea Corallo2020-04-03 15:35:28 +0100
committerAndrea Corallo2020-04-03 19:05:15 +0100
commit9bf9550836b526d1e72378b2a64385df8d47ac07 (patch)
tree0a7fd2cd03aafbca96273b6eb16011d433a5419b /src
parent3cc0438629843e7dbd3bda8bbcf6578b2e7f6200 (diff)
downloademacs-9bf9550836b526d1e72378b2a64385df8d47ac07.tar.gz
emacs-9bf9550836b526d1e72378b2a64385df8d47ac07.zip
src/comp.c: Fix i386
In i386 ABI parameter passing of structs (and unions) is done as pointer + size. Surprisingly this is done *always* even if the structure is known to be word size.
Diffstat (limited to 'src')
-rw-r--r--src/comp.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/src/comp.c b/src/comp.c
index 2aa0c472217..935b7aafda1 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -107,7 +107,6 @@ typedef struct {
107 gcc_jit_type *uintptr_type; 107 gcc_jit_type *uintptr_type;
108 gcc_jit_type *lisp_obj_type; 108 gcc_jit_type *lisp_obj_type;
109 gcc_jit_type *lisp_obj_ptr_type; 109 gcc_jit_type *lisp_obj_ptr_type;
110 gcc_jit_field *lisp_obj_as_ptr;
111 gcc_jit_field *lisp_obj_as_num; 110 gcc_jit_field *lisp_obj_as_num;
112 /* struct Lisp_Cons */ 111 /* struct Lisp_Cons */
113 gcc_jit_struct *lisp_cons_s; 112 gcc_jit_struct *lisp_cons_s;
@@ -671,20 +670,14 @@ static gcc_jit_rvalue *
671emit_XLI (gcc_jit_rvalue *obj) 670emit_XLI (gcc_jit_rvalue *obj)
672{ 671{
673 emit_comment ("XLI"); 672 emit_comment ("XLI");
674 673 return obj;
675 return gcc_jit_rvalue_access_field (obj,
676 NULL,
677 comp.lisp_obj_as_num);
678} 674}
679 675
680static gcc_jit_lvalue * 676static gcc_jit_lvalue *
681emit_lval_XLI (gcc_jit_lvalue *obj) 677emit_lval_XLI (gcc_jit_lvalue *obj)
682{ 678{
683 emit_comment ("lval_XLI"); 679 emit_comment ("lval_XLI");
684 680 return obj;
685 return gcc_jit_lvalue_access_field (obj,
686 NULL,
687 comp.lisp_obj_as_num);
688} 681}
689 682
690/* 683/*
@@ -3132,19 +3125,6 @@ DEFUN ("comp--init-ctxt", Fcomp__init_ctxt, Scomp__init_ctxt,
3132 comp.unsigned_long_long_type = 3125 comp.unsigned_long_long_type =
3133 gcc_jit_context_get_type (comp.ctxt, GCC_JIT_TYPE_UNSIGNED_LONG_LONG); 3126 gcc_jit_context_get_type (comp.ctxt, GCC_JIT_TYPE_UNSIGNED_LONG_LONG);
3134 comp.char_ptr_type = gcc_jit_type_get_pointer (comp.char_type); 3127 comp.char_ptr_type = gcc_jit_type_get_pointer (comp.char_type);
3135#if EMACS_INT_MAX <= LONG_MAX
3136 /* 32-bit builds without wide ints, 64-bit builds on Posix hosts. */
3137 comp.lisp_obj_as_ptr = gcc_jit_context_new_field (comp.ctxt,
3138 NULL,
3139 comp.void_ptr_type,
3140 "obj");
3141#else
3142 /* 64-bit builds on MS-Windows, 32-bit builds with wide ints. */
3143 comp.lisp_obj_as_ptr = gcc_jit_context_new_field (comp.ctxt,
3144 NULL,
3145 comp.long_long_type,
3146 "obj");
3147#endif
3148 comp.emacs_int_type = gcc_jit_context_get_int_type (comp.ctxt, 3128 comp.emacs_int_type = gcc_jit_context_get_int_type (comp.ctxt,
3149 sizeof (EMACS_INT), 3129 sizeof (EMACS_INT),
3150 true); 3130 true);
@@ -3152,14 +3132,9 @@ DEFUN ("comp--init-ctxt", Fcomp__init_ctxt, Scomp__init_ctxt,
3152 NULL, 3132 NULL,
3153 comp.emacs_int_type, 3133 comp.emacs_int_type,
3154 "num"); 3134 "num");
3155 gcc_jit_field *lisp_obj_fields[] = { comp.lisp_obj_as_ptr, 3135 /* No XLP is emitted for now so lets define this always as integer
3156 comp.lisp_obj_as_num }; 3136 disregarding LISP_WORDS_ARE_POINTERS value. */
3157 comp.lisp_obj_type = 3137 comp.lisp_obj_type = comp.emacs_int_type;
3158 gcc_jit_context_new_union_type (comp.ctxt,
3159 NULL,
3160 "comp_Lisp_Object",
3161 ARRAYELTS (lisp_obj_fields),
3162 lisp_obj_fields);
3163 comp.lisp_obj_ptr_type = gcc_jit_type_get_pointer (comp.lisp_obj_type); 3138 comp.lisp_obj_ptr_type = gcc_jit_type_get_pointer (comp.lisp_obj_type);
3164 comp.most_positive_fixnum = 3139 comp.most_positive_fixnum =
3165 gcc_jit_context_new_rvalue_from_long (comp.ctxt, 3140 gcc_jit_context_new_rvalue_from_long (comp.ctxt,