]> git.eshelyaron.com Git - emacs.git/commitdiff
add XUNTAG
authorAndrea Corallo <andrea_corallo@yahoo.it>
Mon, 24 Jun 2019 09:33:44 +0000 (11:33 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:33:45 +0000 (11:33 +0100)
src/comp.c

index 2bffba0833435dacd9699172de529a2f3a1782cb..f754778468b976c1cdc62da2b78c37ffa4bbfc26 100644 (file)
@@ -496,6 +496,24 @@ emit_lval_XLP (gcc_jit_lvalue *obj)
                                      comp.lisp_obj_as_ptr);
 }
 
+static gcc_jit_rvalue *
+emit_rval_XUNTAG (gcc_jit_rvalue *a, gcc_jit_type *type, unsigned lisp_word_tag)
+{
+  /* #define XUNTAG(a, type, ctype) ((ctype *)
+     ((char *) XLP (a) - LISP_WORD_TAG (type))) */
+
+  return emit_cast (type,
+          gcc_jit_context_new_binary_op (
+            comp.ctxt,
+            NULL,
+            GCC_JIT_BINARY_OP_MINUS,
+            comp.emacs_int_type,
+            emit_rval_XLI (a),
+            gcc_jit_context_new_rvalue_from_int (comp.ctxt,
+                                          comp.int_type,
+                                          lisp_word_tag)));
+}
+
 static gcc_jit_rvalue *
 emit_TAGGEDP (gcc_jit_rvalue *obj, unsigned tag)
 {