aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Corallo2020-12-22 09:57:51 +0100
committerAndrea Corallo2020-12-24 15:22:32 +0100
commit4deeb2f2eec340f8f2ef6f0d474503ea9b30ed43 (patch)
treef65ab42039fd2242a0d28b50eac4152f1d82aaf6
parentb99a4744822a11e4af098b63db18f54a4e323d58 (diff)
downloademacs-4deeb2f2eec340f8f2ef6f0d474503ea9b30ed43.tar.gz
emacs-4deeb2f2eec340f8f2ef6f0d474503ea9b30ed43.zip
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.
-rw-r--r--lisp/emacs-lisp/comp.el12
-rw-r--r--src/comp.c4
2 files changed, 8 insertions, 8 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 6ed50dc0122..599c8c75006 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."
1229 (when label-sp 1229 (when label-sp
1230 (cl-assert (= (1- label-sp) (+ target-offset (comp-sp))))) 1230 (cl-assert (= (1- label-sp) (+ target-offset (comp-sp)))))
1231 (comp-emit (if negated 1231 (comp-emit (if negated
1232 (list 'cond-jump a b eff-target-name bb) 1232 (list 'cond-jump a b bb eff-target-name)
1233 (list 'cond-jump a b bb eff-target-name))) 1233 (list 'cond-jump a b eff-target-name bb)))
1234 (comp-mark-curr-bb-closed) 1234 (comp-mark-curr-bb-closed)
1235 bb))) 1235 bb)))
1236 1236
@@ -1321,7 +1321,7 @@ Return value is the fall through block name."
1321 (comp-new-block-sym))) 1321 (comp-new-block-sym)))
1322 for ff-bb-name = (comp-block-name ff-bb) 1322 for ff-bb-name = (comp-block-name ff-bb)
1323 if (eq test-func 'eq) 1323 if (eq test-func 'eq)
1324 do (comp-emit (list 'cond-jump var m-test ff-bb-name target-name)) 1324 do (comp-emit (list 'cond-jump var m-test target-name ff-bb-name))
1325 else 1325 else
1326 ;; Store the result of the comparison into the scratch slot before 1326 ;; Store the result of the comparison into the scratch slot before
1327 ;; emitting the conditional jump. 1327 ;; emitting the conditional jump.
@@ -1330,7 +1330,7 @@ Return value is the fall through block name."
1330 (comp-emit (list 'cond-jump 1330 (comp-emit (list 'cond-jump
1331 (make-comp-mvar :slot 'scratch) 1331 (make-comp-mvar :slot 'scratch)
1332 (make-comp-mvar :constant nil) 1332 (make-comp-mvar :constant nil)
1333 target-name ff-bb-name)) 1333 ff-bb-name target-name))
1334 unless last 1334 unless last
1335 ;; All fall through are artificially created here except the last one. 1335 ;; All fall through are artificially created here except the last one.
1336 do (puthash ff-bb-name ff-bb (comp-func-blocks comp-func)) 1336 do (puthash ff-bb-name ff-bb (comp-func-blocks comp-func))
@@ -1615,7 +1615,7 @@ the annotation emission."
1615 (cl-loop for i from minarg below nonrest 1615 (cl-loop for i from minarg below nonrest
1616 for bb = (intern (format "entry_%s" i)) 1616 for bb = (intern (format "entry_%s" i))
1617 for fallback = (intern (format "entry_fallback_%s" i)) 1617 for fallback = (intern (format "entry_fallback_%s" i))
1618 do (comp-emit `(cond-jump-narg-leq ,i ,bb ,fallback)) 1618 do (comp-emit `(cond-jump-narg-leq ,i ,fallback ,bb))
1619 (comp-make-curr-block bb (comp-sp)) 1619 (comp-make-curr-block bb (comp-sp))
1620 (comp-emit `(set-args-to-local ,(comp-slot-n i))) 1620 (comp-emit `(set-args-to-local ,(comp-slot-n i)))
1621 (comp-emit '(inc-args)) 1621 (comp-emit '(inc-args))
@@ -1971,7 +1971,7 @@ TARGET-BB-SYM is the symbol name of the target block."
1971 for branch-target-cell on blocks 1971 for branch-target-cell on blocks
1972 for branch-target = (car branch-target-cell) 1972 for branch-target = (car branch-target-cell)
1973 for assume-target = (comp-add-cond-cstrs-target-block b branch-target) 1973 for assume-target = (comp-add-cond-cstrs-target-block b branch-target)
1974 for negated in '(nil t) 1974 for negated in '(t nil)
1975 do (setf (car branch-target-cell) (comp-block-name assume-target)) 1975 do (setf (car branch-target-cell) (comp-block-name assume-target))
1976 when target-mvar1 1976 when target-mvar1
1977 do (comp-emit-assume target-mvar1 op2 assume-target negated) 1977 do (comp-emit-assume target-mvar1 op2 assume-target negated)
diff --git a/src/comp.c b/src/comp.c
index 166c75bea0d..ee3c15a2f67 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -2038,7 +2038,7 @@ emit_limple_insn (Lisp_Object insn)
2038 gcc_jit_block *target1 = retrive_block (arg[2]); 2038 gcc_jit_block *target1 = retrive_block (arg[2]);
2039 gcc_jit_block *target2 = retrive_block (arg[3]); 2039 gcc_jit_block *target2 = retrive_block (arg[3]);
2040 2040
2041 emit_cond_jump (emit_EQ (a, b), target2, target1); 2041 emit_cond_jump (emit_EQ (a, b), target1, target2);
2042 } 2042 }
2043 else if (EQ (op, Qcond_jump_narg_leq)) 2043 else if (EQ (op, Qcond_jump_narg_leq))
2044 { 2044 {
@@ -2060,7 +2060,7 @@ emit_limple_insn (Lisp_Object insn)
2060 GCC_JIT_COMPARISON_LE, 2060 GCC_JIT_COMPARISON_LE,
2061 gcc_jit_lvalue_as_rvalue (nargs), 2061 gcc_jit_lvalue_as_rvalue (nargs),
2062 n); 2062 n);
2063 emit_cond_jump (test, target2, target1); 2063 emit_cond_jump (test, target1, target2);
2064 } 2064 }
2065 else if (EQ (op, Qphi) || EQ (op, Qassume)) 2065 else if (EQ (op, Qphi) || EQ (op, Qassume))
2066 { 2066 {