Commit 54138d95 by Richard Henderson Committed by Richard Henderson

arm: Rename CC_NOOVmode to CC_NZmode

CC_NZmode is a more accurate description of what we require
from the mode, and matches up with the definition in aarch64.

Rename noov_comparison_operator to nz_comparison_operator
in order to match.

	* config/arm/arm-modes.def (CC_NZ): Rename from CC_NOOV.
	* config/arm/predicates.md (nz_comparison_operator): Rename
	from noov_comparison_operator.
	* config/arm/arm.c (arm_select_cc_mode): Use CC_NZmode name.
	(arm_gen_dicompare_reg): Likewise.
	(maybe_get_arm_condition_code): Likewise.
	(thumb1_final_prescan_insn): Likewise.
	(arm_emit_coreregs_64bit_shift): Likewise.
	* config/arm/arm.md (addsi3_compare0): Likewise.
	(*addsi3_compare0_scratch, subsi3_compare0): Likewise.
	(*mulsi3_compare0, *mulsi3_compare0_v6): Likewise.
	(*mulsi3_compare0_scratch, *mulsi3_compare0_scratch_v6): Likewise.
	(*mulsi3addsi_compare0, *mulsi3addsi_compare0_v6): Likewise.
	(*mulsi3addsi_compare0_scratch): Likewise.
	(*mulsi3addsi_compare0_scratch_v6): Likewise.
	(*andsi3_compare0, *andsi3_compare0_scratch): Likewise.
	(*zeroextractsi_compare0_scratch): Likewise.
	(*ne_zeroextractsi, *ne_zeroextractsi_shifted): Likewise.
	(*ite_ne_zeroextractsi, *ite_ne_zeroextractsi_shifted): Likewise.
	(andsi_not_shiftsi_si_scc_no_reuse): Likewise.
	(andsi_not_shiftsi_si_scc): Likewise.
	(*andsi_notsi_si_compare0, *andsi_notsi_si_compare0_scratch): Likewise.
	(*iorsi3_compare0, *iorsi3_compare0_scratch): Likewise.
	(*xorsi3_compare0, *xorsi3_compare0_scratch): Likewise.
	(*shiftsi3_compare0, *shiftsi3_compare0_scratch): Likewise.
	(*not_shiftsi_compare0, *not_shiftsi_compare0_scratch): Likewise.
	(*notsi_compare0, *notsi_compare0_scratch): Likewise.
	(return_addr_mask, *check_arch2): Likewise.
	(*arith_shiftsi_compare0, *arith_shiftsi_compare0_scratch): Likewise.
	(*sub_shiftsi_compare0, *sub_shiftsi_compare0_scratch): Likewise.
	(compare_scc splitters): Likewise.
	(movcond_addsi): Likewise.
	* config/arm/thumb2.md (thumb2_addsi3_compare0): Likewise.
	(*thumb2_addsi3_compare0_scratch): Likewise.
	(*thumb2_mulsi_short_compare0): Likewise.
	(*thumb2_mulsi_short_compare0_scratch): Likewise.
	(compare peephole2s): Likewise.
	* config/arm/thumb1.md (thumb1_cbz): Use CC_NZmode and
	nz_comparison_operator names.
	(cbranchsi4_insn): Likewise.

From-SVN: r278225
parent 0be72bfa
2019-11-14 Richard Henderson <richard.henderson@linaro.org> 2019-11-14 Richard Henderson <richard.henderson@linaro.org>
* config/arm/arm-modes.def (CC_NZ): Rename from CC_NOOV.
* config/arm/predicates.md (nz_comparison_operator): Rename
from noov_comparison_operator.
* config/arm/arm.c (arm_select_cc_mode): Use CC_NZmode name.
(arm_gen_dicompare_reg): Likewise.
(maybe_get_arm_condition_code): Likewise.
(thumb1_final_prescan_insn): Likewise.
(arm_emit_coreregs_64bit_shift): Likewise.
* config/arm/arm.md (addsi3_compare0): Likewise.
(*addsi3_compare0_scratch, subsi3_compare0): Likewise.
(*mulsi3_compare0, *mulsi3_compare0_v6): Likewise.
(*mulsi3_compare0_scratch, *mulsi3_compare0_scratch_v6): Likewise.
(*mulsi3addsi_compare0, *mulsi3addsi_compare0_v6): Likewise.
(*mulsi3addsi_compare0_scratch): Likewise.
(*mulsi3addsi_compare0_scratch_v6): Likewise.
(*andsi3_compare0, *andsi3_compare0_scratch): Likewise.
(*zeroextractsi_compare0_scratch): Likewise.
(*ne_zeroextractsi, *ne_zeroextractsi_shifted): Likewise.
(*ite_ne_zeroextractsi, *ite_ne_zeroextractsi_shifted): Likewise.
(andsi_not_shiftsi_si_scc_no_reuse): Likewise.
(andsi_not_shiftsi_si_scc): Likewise.
(*andsi_notsi_si_compare0, *andsi_notsi_si_compare0_scratch): Likewise.
(*iorsi3_compare0, *iorsi3_compare0_scratch): Likewise.
(*xorsi3_compare0, *xorsi3_compare0_scratch): Likewise.
(*shiftsi3_compare0, *shiftsi3_compare0_scratch): Likewise.
(*not_shiftsi_compare0, *not_shiftsi_compare0_scratch): Likewise.
(*notsi_compare0, *notsi_compare0_scratch): Likewise.
(return_addr_mask, *check_arch2): Likewise.
(*arith_shiftsi_compare0, *arith_shiftsi_compare0_scratch): Likewise.
(*sub_shiftsi_compare0, *sub_shiftsi_compare0_scratch): Likewise.
(compare_scc splitters): Likewise.
(movcond_addsi): Likewise.
* config/arm/thumb2.md (thumb2_addsi3_compare0): Likewise.
(*thumb2_addsi3_compare0_scratch): Likewise.
(*thumb2_mulsi_short_compare0): Likewise.
(*thumb2_mulsi_short_compare0_scratch): Likewise.
(compare peephole2s): Likewise.
* config/arm/thumb1.md (thumb1_cbz): Use CC_NZmode and
nz_comparison_operator names.
(cbranchsi4_insn): Likewise.
* config/arm/constraints.md (c): Use cc_register predicate. * config/arm/constraints.md (c): Use cc_register predicate.
* config/aarch64/constraints.md (c): New constraint. * config/aarch64/constraints.md (c): New constraint.
...@@ -29,7 +29,7 @@ ADJUST_FLOAT_FORMAT (HF, ((arm_fp16_format == ARM_FP16_FORMAT_ALTERNATIVE) ...@@ -29,7 +29,7 @@ ADJUST_FLOAT_FORMAT (HF, ((arm_fp16_format == ARM_FP16_FORMAT_ALTERNATIVE)
/* CCFPEmode should be used with floating inequalities, /* CCFPEmode should be used with floating inequalities,
CCFPmode should be used with floating equalities. CCFPmode should be used with floating equalities.
CC_NOOVmode should be used with SImode integer equalities. CC_NZmode should be used if only the N and Z bits are set correctly.
CC_Zmode should be used if only the Z flag is set correctly CC_Zmode should be used if only the Z flag is set correctly
CC_Cmode should be used if only the C flag is set correctly, after an CC_Cmode should be used if only the C flag is set correctly, after an
addition. addition.
...@@ -47,7 +47,7 @@ ADJUST_FLOAT_FORMAT (HF, ((arm_fp16_format == ARM_FP16_FORMAT_ALTERNATIVE) ...@@ -47,7 +47,7 @@ ADJUST_FLOAT_FORMAT (HF, ((arm_fp16_format == ARM_FP16_FORMAT_ALTERNATIVE)
against one of the other operands. against one of the other operands.
CCmode should be used otherwise. */ CCmode should be used otherwise. */
CC_MODE (CC_NOOV); CC_MODE (CC_NZ);
CC_MODE (CC_Z); CC_MODE (CC_Z);
CC_MODE (CC_NV); CC_MODE (CC_NV);
CC_MODE (CC_SWP); CC_MODE (CC_SWP);
......
...@@ -15376,7 +15376,7 @@ arm_select_cc_mode (enum rtx_code op, rtx x, rtx y) ...@@ -15376,7 +15376,7 @@ arm_select_cc_mode (enum rtx_code op, rtx x, rtx y)
|| GET_CODE (x) == ASHIFT || GET_CODE (x) == ASHIFTRT || GET_CODE (x) == ASHIFT || GET_CODE (x) == ASHIFTRT
|| GET_CODE (x) == ROTATERT || GET_CODE (x) == ROTATERT
|| (TARGET_32BIT && GET_CODE (x) == ZERO_EXTRACT))) || (TARGET_32BIT && GET_CODE (x) == ZERO_EXTRACT)))
return CC_NOOVmode; return CC_NZmode;
/* A comparison of ~reg with a const is really a special /* A comparison of ~reg with a const is really a special
canoncialization of compare (~const, reg), which is a reverse canoncialization of compare (~const, reg), which is a reverse
...@@ -15492,11 +15492,11 @@ arm_gen_dicompare_reg (rtx_code code, rtx x, rtx y, rtx scratch) ...@@ -15492,11 +15492,11 @@ arm_gen_dicompare_reg (rtx_code code, rtx x, rtx y, rtx scratch)
} }
rtx clobber = gen_rtx_CLOBBER (VOIDmode, scratch); rtx clobber = gen_rtx_CLOBBER (VOIDmode, scratch);
cc_reg = gen_rtx_REG (CC_NOOVmode, CC_REGNUM); cc_reg = gen_rtx_REG (CC_NZmode, CC_REGNUM);
rtx set rtx set
= gen_rtx_SET (cc_reg, = gen_rtx_SET (cc_reg,
gen_rtx_COMPARE (CC_NOOVmode, gen_rtx_COMPARE (CC_NZmode,
gen_rtx_IOR (SImode, x_lo, x_hi), gen_rtx_IOR (SImode, x_lo, x_hi),
const0_rtx)); const0_rtx));
emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, set, emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, set,
...@@ -23881,7 +23881,7 @@ maybe_get_arm_condition_code (rtx comparison) ...@@ -23881,7 +23881,7 @@ maybe_get_arm_condition_code (rtx comparison)
return code; return code;
return ARM_NV; return ARM_NV;
case E_CC_NOOVmode: case E_CC_NZmode:
switch (comp_code) switch (comp_code)
{ {
case NE: return ARM_NE; case NE: return ARM_NE;
...@@ -25304,7 +25304,7 @@ thumb1_final_prescan_insn (rtx_insn *insn) ...@@ -25304,7 +25304,7 @@ thumb1_final_prescan_insn (rtx_insn *insn)
cfun->machine->thumb1_cc_insn = insn; cfun->machine->thumb1_cc_insn = insn;
cfun->machine->thumb1_cc_op0 = SET_DEST (set); cfun->machine->thumb1_cc_op0 = SET_DEST (set);
cfun->machine->thumb1_cc_op1 = const0_rtx; cfun->machine->thumb1_cc_op1 = const0_rtx;
cfun->machine->thumb1_cc_mode = CC_NOOVmode; cfun->machine->thumb1_cc_mode = CC_NZmode;
if (INSN_CODE (insn) == CODE_FOR_thumb1_subsi3_insn) if (INSN_CODE (insn) == CODE_FOR_thumb1_subsi3_insn)
{ {
rtx src1 = XEXP (SET_SRC (set), 1); rtx src1 = XEXP (SET_SRC (set), 1);
...@@ -30486,7 +30486,7 @@ arm_emit_coreregs_64bit_shift (enum rtx_code code, rtx out, rtx in, ...@@ -30486,7 +30486,7 @@ arm_emit_coreregs_64bit_shift (enum rtx_code code, rtx out, rtx in,
else else
{ {
/* We have a shift-by-register. */ /* We have a shift-by-register. */
rtx cc_reg = gen_rtx_REG (CC_NOOVmode, CC_REGNUM); rtx cc_reg = gen_rtx_REG (CC_NZmode, CC_REGNUM);
/* This alternative requires the scratch registers. */ /* This alternative requires the scratch registers. */
gcc_assert (scratch1 && REG_P (scratch1)); gcc_assert (scratch1 && REG_P (scratch1));
......
...@@ -430,7 +430,7 @@ ...@@ -430,7 +430,7 @@
(match_operand 0 "arm_vsel_comparison_operator")) (match_operand 0 "arm_vsel_comparison_operator"))
(match_operand 0 "expandable_comparison_operator"))) (match_operand 0 "expandable_comparison_operator")))
(define_special_predicate "noov_comparison_operator" (define_special_predicate "nz_comparison_operator"
(match_code "lt,ge,eq,ne")) (match_code "lt,ge,eq,ne"))
(define_special_predicate "minmax_operator" (define_special_predicate "minmax_operator"
......
...@@ -1023,9 +1023,9 @@ ...@@ -1023,9 +1023,9 @@
if (!rtx_equal_p (cfun->machine->thumb1_cc_op0, operands[1]) if (!rtx_equal_p (cfun->machine->thumb1_cc_op0, operands[1])
|| !rtx_equal_p (cfun->machine->thumb1_cc_op1, operands[2])) || !rtx_equal_p (cfun->machine->thumb1_cc_op1, operands[2]))
t = NULL_RTX; t = NULL_RTX;
if (cfun->machine->thumb1_cc_mode == CC_NOOVmode) if (cfun->machine->thumb1_cc_mode == CC_NZmode)
{ {
if (!noov_comparison_operator (operands[0], VOIDmode)) if (!nz_comparison_operator (operands[0], VOIDmode))
t = NULL_RTX; t = NULL_RTX;
} }
else if (cfun->machine->thumb1_cc_mode != CCmode) else if (cfun->machine->thumb1_cc_mode != CCmode)
...@@ -1097,9 +1097,9 @@ ...@@ -1097,9 +1097,9 @@
if (!rtx_equal_p (cfun->machine->thumb1_cc_op0, operands[1]) if (!rtx_equal_p (cfun->machine->thumb1_cc_op0, operands[1])
|| !rtx_equal_p (cfun->machine->thumb1_cc_op1, operands[2])) || !rtx_equal_p (cfun->machine->thumb1_cc_op1, operands[2]))
t = NULL_RTX; t = NULL_RTX;
if (cfun->machine->thumb1_cc_mode == CC_NOOVmode) if (cfun->machine->thumb1_cc_mode == CC_NZmode)
{ {
if (!noov_comparison_operator (operands[0], VOIDmode)) if (!nz_comparison_operator (operands[0], VOIDmode))
t = NULL_RTX; t = NULL_RTX;
} }
else if (cfun->machine->thumb1_cc_mode != CCmode) else if (cfun->machine->thumb1_cc_mode != CCmode)
......
...@@ -1287,8 +1287,8 @@ ...@@ -1287,8 +1287,8 @@
) )
(define_insn "thumb2_addsi3_compare0" (define_insn "thumb2_addsi3_compare0"
[(set (reg:CC_NOOV CC_REGNUM) [(set (reg:CC_NZ CC_REGNUM)
(compare:CC_NOOV (compare:CC_NZ
(plus:SI (match_operand:SI 1 "s_register_operand" "l, 0, r") (plus:SI (match_operand:SI 1 "s_register_operand" "l, 0, r")
(match_operand:SI 2 "arm_add_operand" "lPt,Ps,rIL")) (match_operand:SI 2 "arm_add_operand" "lPt,Ps,rIL"))
(const_int 0))) (const_int 0)))
...@@ -1321,8 +1321,8 @@ ...@@ -1321,8 +1321,8 @@
) )
(define_insn "*thumb2_addsi3_compare0_scratch" (define_insn "*thumb2_addsi3_compare0_scratch"
[(set (reg:CC_NOOV CC_REGNUM) [(set (reg:CC_NZ CC_REGNUM)
(compare:CC_NOOV (compare:CC_NZ
(plus:SI (match_operand:SI 0 "s_register_operand" "l, r") (plus:SI (match_operand:SI 0 "s_register_operand" "l, r")
(match_operand:SI 1 "arm_add_operand" "lPv,rIL")) (match_operand:SI 1 "arm_add_operand" "lPv,rIL"))
(const_int 0)))] (const_int 0)))]
...@@ -1359,8 +1359,8 @@ ...@@ -1359,8 +1359,8 @@
(set_attr "type" "muls")]) (set_attr "type" "muls")])
(define_insn "*thumb2_mulsi_short_compare0" (define_insn "*thumb2_mulsi_short_compare0"
[(set (reg:CC_NOOV CC_REGNUM) [(set (reg:CC_NZ CC_REGNUM)
(compare:CC_NOOV (compare:CC_NZ
(mult:SI (match_operand:SI 1 "register_operand" "%0") (mult:SI (match_operand:SI 1 "register_operand" "%0")
(match_operand:SI 2 "register_operand" "l")) (match_operand:SI 2 "register_operand" "l"))
(const_int 0))) (const_int 0)))
...@@ -1372,8 +1372,8 @@ ...@@ -1372,8 +1372,8 @@
(set_attr "type" "muls")]) (set_attr "type" "muls")])
(define_insn "*thumb2_mulsi_short_compare0_scratch" (define_insn "*thumb2_mulsi_short_compare0_scratch"
[(set (reg:CC_NOOV CC_REGNUM) [(set (reg:CC_NZ CC_REGNUM)
(compare:CC_NOOV (compare:CC_NZ
(mult:SI (match_operand:SI 1 "register_operand" "%0") (mult:SI (match_operand:SI 1 "register_operand" "%0")
(match_operand:SI 2 "register_operand" "l")) (match_operand:SI 2 "register_operand" "l"))
(const_int 0))) (const_int 0)))
...@@ -1477,15 +1477,15 @@ ...@@ -1477,15 +1477,15 @@
) )
(define_peephole2 (define_peephole2
[(set (match_operand:CC_NOOV 0 "cc_register" "") [(set (match_operand:CC_NZ 0 "cc_register" "")
(compare:CC_NOOV (zero_extract:SI (compare:CC_NZ (zero_extract:SI
(match_operand:SI 1 "low_register_operand" "") (match_operand:SI 1 "low_register_operand" "")
(const_int 1) (const_int 1)
(match_operand:SI 2 "const_int_operand" "")) (match_operand:SI 2 "const_int_operand" ""))
(const_int 0))) (const_int 0)))
(match_scratch:SI 3 "l") (match_scratch:SI 3 "l")
(set (pc) (set (pc)
(if_then_else (match_operator:CC_NOOV 4 "equality_operator" (if_then_else (match_operator:CC_NZ 4 "equality_operator"
[(match_dup 0) (const_int 0)]) [(match_dup 0) (const_int 0)])
(match_operand 5 "" "") (match_operand 5 "" "")
(match_operand 6 "" "")))] (match_operand 6 "" "")))]
...@@ -1493,7 +1493,7 @@ ...@@ -1493,7 +1493,7 @@
&& (INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) < 32) && (INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) < 32)
&& peep2_reg_dead_p (2, operands[0])" && peep2_reg_dead_p (2, operands[0])"
[(parallel [(set (match_dup 0) [(parallel [(set (match_dup 0)
(compare:CC_NOOV (ashift:SI (match_dup 1) (match_dup 2)) (compare:CC_NZ (ashift:SI (match_dup 1) (match_dup 2))
(const_int 0))) (const_int 0)))
(clobber (match_dup 3))]) (clobber (match_dup 3))])
(set (pc) (set (pc)
...@@ -1506,15 +1506,15 @@ ...@@ -1506,15 +1506,15 @@
") ")
(define_peephole2 (define_peephole2
[(set (match_operand:CC_NOOV 0 "cc_register" "") [(set (match_operand:CC_NZ 0 "cc_register" "")
(compare:CC_NOOV (zero_extract:SI (compare:CC_NZ (zero_extract:SI
(match_operand:SI 1 "low_register_operand" "") (match_operand:SI 1 "low_register_operand" "")
(match_operand:SI 2 "const_int_operand" "") (match_operand:SI 2 "const_int_operand" "")
(const_int 0)) (const_int 0))
(const_int 0))) (const_int 0)))
(match_scratch:SI 3 "l") (match_scratch:SI 3 "l")
(set (pc) (set (pc)
(if_then_else (match_operator:CC_NOOV 4 "equality_operator" (if_then_else (match_operator:CC_NZ 4 "equality_operator"
[(match_dup 0) (const_int 0)]) [(match_dup 0) (const_int 0)])
(match_operand 5 "" "") (match_operand 5 "" "")
(match_operand 6 "" "")))] (match_operand 6 "" "")))]
...@@ -1522,8 +1522,8 @@ ...@@ -1522,8 +1522,8 @@
&& (INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 32) && (INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 32)
&& peep2_reg_dead_p (2, operands[0])" && peep2_reg_dead_p (2, operands[0])"
[(parallel [(set (match_dup 0) [(parallel [(set (match_dup 0)
(compare:CC_NOOV (ashift:SI (match_dup 1) (match_dup 2)) (compare:CC_NZ (ashift:SI (match_dup 1) (match_dup 2))
(const_int 0))) (const_int 0)))
(clobber (match_dup 3))]) (clobber (match_dup 3))])
(set (pc) (set (pc)
(if_then_else (match_op_dup 4 [(match_dup 0) (const_int 0)]) (if_then_else (match_op_dup 4 [(match_dup 0) (const_int 0)])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment