From: Wilco Dijkstra Date: Mon, 16 May 2016 12:52:22 +0000 (+0000) Subject: Some patterns are using '%w2' for immediate operands... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=954224d7318d36379c7c997d51cc72ce1e62a7e7;p=gcc.git Some patterns are using '%w2' for immediate operands... Some patterns are using '%w2' for immediate operands, which means that a zero immediate is actually emitted as 'wzr' or 'xzr'. This not only changes an immediate operand into a register operand but may emit illegal instructions from legal RTL (eg. ORR x0, SP, xzr rather than ORR x0, SP, 0). * config/aarch64/aarch64.md (add3_compareC_cconly_imm): Remove use of %w. (add3_compareC_imm): Likewise. (si3_uxtw): Split into register and immediate variants. (andsi3_compare0_uxtw): Likewise. (and3_compare0): Likewise. (and3nr_compare0): Likewise. (stack_protect_test_): Don't use %x for memory operands. From-SVN: r236285 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 45076866e1e..ec7cf67a522 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2016-05-16 Wilco Dijkstra + + * config/aarch64/aarch64.md + (add3_compareC_cconly_imm): Remove use of %w. + (add3_compareC_imm): Likewise. + (si3_uxtw): Split into register and immediate variants. + (andsi3_compare0_uxtw): Likewise. + (and3_compare0): Likewise. + (and3nr_compare0): Likewise. + (stack_protect_test_): Don't use %x for memory operands. + 2016-05-16 Matthew Fortune * config/mips/mips-cpus.def (p5600): Add multi-line brackets. diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index f6bc12dd2ef..223a4cc6d31 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -1786,7 +1786,7 @@ "aarch64_zero_extend_const_eq (mode, operands[2], mode, operands[1])" "@ - cmn\\t%0, %1 + cmn\\t%0, %1 cmp\\t%0, #%n1" [(set_attr "type" "alus_imm")] ) @@ -1818,11 +1818,11 @@ "aarch64_zero_extend_const_eq (mode, operands[3], mode, operands[2])" "@ - adds\\t%0, %1, %2 + adds\\t%0, %1, %2 subs\\t%0, %1, #%n2" [(set_attr "type" "alus_imm")] ) - + (define_insn "add3_compareC" [(set (reg:CC_C CC_REGNUM) (ne:CC_C @@ -3425,7 +3425,9 @@ (LOGICAL:SI (match_operand:SI 1 "register_operand" "%r,r") (match_operand:SI 2 "aarch64_logical_operand" "r,K"))))] "" - "\\t%w0, %w1, %w2" + "@ + \\t%w0, %w1, %w2 + \\t%w0, %w1, %2" [(set_attr "type" "logic_reg,logic_imm")] ) @@ -3438,7 +3440,9 @@ (set (match_operand:GPI 0 "register_operand" "=r,r") (and:GPI (match_dup 1) (match_dup 2)))] "" - "ands\\t%0, %1, %2" + "@ + ands\\t%0, %1, %2 + ands\\t%0, %1, %2" [(set_attr "type" "logics_reg,logics_imm")] ) @@ -3452,7 +3456,9 @@ (set (match_operand:DI 0 "register_operand" "=r,r") (zero_extend:DI (and:SI (match_dup 1) (match_dup 2))))] "" - "ands\\t%w0, %w1, %w2" + "@ + ands\\t%w0, %w1, %w2 + ands\\t%w0, %w1, %2" [(set_attr "type" "logics_reg,logics_imm")] ) @@ -3806,7 +3812,9 @@ (match_operand:GPI 1 "aarch64_logical_operand" "r,")) (const_int 0)))] "" - "tst\\t%0, %1" + "@ + tst\\t%0, %1 + tst\\t%0, %1" [(set_attr "type" "logics_reg,logics_imm")] ) @@ -5201,7 +5209,7 @@ UNSPEC_SP_TEST)) (clobber (match_scratch:PTR 3 "=&r"))] "" - "ldr\t%3, %x1\;ldr\t%0, %x2\;eor\t%0, %3, %0" + "ldr\t%3, %1\;ldr\t%0, %2\;eor\t%0, %3, %0" [(set_attr "length" "12") (set_attr "type" "multiple")])