]> git.eshelyaron.com Git - emacs.git/commitdiff
inline consp
authorAndrea Corallo <andrea_corallo@yahoo.it>
Thu, 15 Aug 2019 16:40:42 +0000 (18:40 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:34:00 +0000 (11:34 +0100)
src/comp.c

index fa242a85e3b2bf0003c85909d995dc631410aee5..fed777e9e0b713cb15207b4541d849d6e0319e8e 100644 (file)
@@ -1397,6 +1397,18 @@ emit_sub1 (Lisp_Object insn)
   return gcc_jit_context_new_call (comp.ctxt, NULL, comp.sub1, 1, &n);
 }
 
+static gcc_jit_rvalue *
+emit_consp (Lisp_Object insn)
+{
+  gcc_jit_rvalue *x = emit_mvar_val (SECOND (insn));
+  gcc_jit_rvalue *res = emit_cast (comp.bool_type,
+                                  emit_CONSP (x));
+  return gcc_jit_context_new_call (comp.ctxt,
+                                  NULL,
+                                  comp.bool_to_lisp_obj,
+                                  1, &res);
+}
+
 \f
 /****************************************************************/
 /* Inline function definition and lisp data structure follows.  */
@@ -2206,6 +2218,7 @@ DEFUN ("comp-init-ctxt", Fcomp_init_ctxt, Scomp_init_ctxt,
                        emit_simple_limple_call_void_ret);
       register_emitter (QFadd1, emit_add1);
       register_emitter (QFsub1, emit_sub1);
+      register_emitter (QFconsp, emit_consp);
     }
 
   comp.ctxt = gcc_jit_context_acquire();
@@ -2608,6 +2621,7 @@ syms_of_comp (void)
   DEFSYM (Qhelper_save_restriction, "helper_save_restriction");
   DEFSYM (QFadd1, "Fadd1");
   DEFSYM (QFsub1, "Fsub1");
+  DEFSYM (QFconsp, "Fconsp");
 
   defsubr (&Scomp_init_ctxt);
   defsubr (&Scomp_release_ctxt);