emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/native-comp 4deeb2f 1/9: Invert basic block argument order in LI


From: Andrea Corallo
Subject: feature/native-comp 4deeb2f 1/9: Invert basic block argument order in LIMPLE cond-jump
Date: Thu, 24 Dec 2020 09:49:29 -0500 (EST)

branch: feature/native-comp
commit 4deeb2f2eec340f8f2ef6f0d474503ea9b30ed43
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    Invert basic block argument order in LIMPLE cond-jump
    
        * lisp/emacs-lisp/comp.el (comp-emit-cond-jump)
        (comp-emit-switch, comp-emit-narg-prologue, comp-add-cond-cstrs):
        Invert basic block argument order in LIMPLE cond-jump.
        * src/comp.c (emit_limple_insn): Likewise.
---
 lisp/emacs-lisp/comp.el | 12 ++++++------
 src/comp.c              |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 6ed50dc..599c8c7 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -1229,8 +1229,8 @@ Return value is the fall through block name."
       (when label-sp
         (cl-assert (= (1- label-sp) (+ target-offset (comp-sp)))))
       (comp-emit (if negated
-                    (list 'cond-jump a b eff-target-name bb)
-                  (list 'cond-jump a b bb eff-target-name)))
+                     (list 'cond-jump a b bb eff-target-name)
+                  (list 'cond-jump a b eff-target-name bb)))
       (comp-mark-curr-bb-closed)
       bb)))
 
@@ -1321,7 +1321,7 @@ Return value is the fall through block name."
                                             (comp-new-block-sym)))
         for ff-bb-name = (comp-block-name ff-bb)
         if (eq test-func 'eq)
-          do (comp-emit (list 'cond-jump var m-test ff-bb-name target-name))
+          do (comp-emit (list 'cond-jump var m-test target-name ff-bb-name))
         else
         ;; Store the result of the comparison into the scratch slot before
         ;; emitting the conditional jump.
@@ -1330,7 +1330,7 @@ Return value is the fall through block name."
              (comp-emit (list 'cond-jump
                               (make-comp-mvar :slot 'scratch)
                               (make-comp-mvar :constant nil)
-                              target-name ff-bb-name))
+                              ff-bb-name target-name))
         unless last
         ;; All fall through are artificially created here except the last one.
           do (puthash ff-bb-name ff-bb (comp-func-blocks comp-func))
@@ -1615,7 +1615,7 @@ the annotation emission."
   (cl-loop for i from minarg below nonrest
            for bb = (intern (format "entry_%s" i))
            for fallback = (intern (format "entry_fallback_%s" i))
-           do (comp-emit `(cond-jump-narg-leq ,i ,bb ,fallback))
+           do (comp-emit `(cond-jump-narg-leq ,i ,fallback ,bb))
               (comp-make-curr-block bb (comp-sp))
               (comp-emit `(set-args-to-local ,(comp-slot-n i)))
               (comp-emit '(inc-args))
@@ -1971,7 +1971,7 @@ TARGET-BB-SYM is the symbol name of the target block."
         for branch-target-cell on blocks
         for branch-target = (car branch-target-cell)
         for assume-target = (comp-add-cond-cstrs-target-block b branch-target)
-        for negated in '(nil t)
+        for negated in '(t nil)
         do (setf (car branch-target-cell) (comp-block-name assume-target))
         when target-mvar1
           do (comp-emit-assume target-mvar1 op2 assume-target negated)
diff --git a/src/comp.c b/src/comp.c
index 166c75b..ee3c15a 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -2038,7 +2038,7 @@ emit_limple_insn (Lisp_Object insn)
       gcc_jit_block *target1 = retrive_block (arg[2]);
       gcc_jit_block *target2 = retrive_block (arg[3]);
 
-      emit_cond_jump (emit_EQ (a, b), target2, target1);
+      emit_cond_jump (emit_EQ (a, b), target1, target2);
     }
   else if (EQ (op, Qcond_jump_narg_leq))
     {
@@ -2060,7 +2060,7 @@ emit_limple_insn (Lisp_Object insn)
                               GCC_JIT_COMPARISON_LE,
                               gcc_jit_lvalue_as_rvalue (nargs),
                               n);
-      emit_cond_jump (test, target2, target1);
+      emit_cond_jump (test, target1, target2);
     }
   else if (EQ (op, Qphi) || EQ (op, Qassume))
     {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]