aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/msp430/msp430.md
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2014-01-17 11:35:46 +0000
committerNick Clifton <nickc@gcc.gnu.org>2014-01-17 11:35:46 +0000
commitd4f283a153449eb77df3fe4083538b5f191a6b38 (patch)
tree45f78eb9fc0d83e901196ae36dfc52c2f5defb84 /gcc/config/msp430/msp430.md
parent7be64667c127a0cdb9dc7e4f02dcd7720589919d (diff)
downloadgcc-d4f283a153449eb77df3fe4083538b5f191a6b38.zip
gcc-d4f283a153449eb77df3fe4083538b5f191a6b38.tar.gz
gcc-d4f283a153449eb77df3fe4083538b5f191a6b38.tar.bz2
msp430.opt: (mcpu): New option.
* config/msp430/msp430.opt: (mcpu): New option. * config/msp430/msp430.c (msp430_mcu_name): Use target_mcu. (msp430_option_override): Parse target_cpu. If the MCU name matches a generic string, clear target_mcu. (msp430_attr): Allow numeric interrupt values up to 63. (msp430_expand_epilogue): No longer invert operand 1 of gen_popm. * config/msp430/msp430.h (ASM_SPEC): Convert -mcpu into a -mmcu option. * config/msp430/t-msp430: (MULTILIB_MATCHES): Remove mcu matches. Add mcpu matches. * config/msp430/msp430.md (popm): Use %J rather than %I. (addsi3): Use msp430_nonimmediate_operand for operand 2. (addhi_cy_i): Use immediate_operand for operand 2. * doc/invoke.texi: Document -mcpu option. From-SVN: r206705
Diffstat (limited to 'gcc/config/msp430/msp430.md')
-rw-r--r--gcc/config/msp430/msp430.md38
1 files changed, 17 insertions, 21 deletions
diff --git a/gcc/config/msp430/msp430.md b/gcc/config/msp430/msp430.md
index 6a40fd9..ee01cd1 100644
--- a/gcc/config/msp430/msp430.md
+++ b/gcc/config/msp430/msp430.md
@@ -111,11 +111,7 @@
;; Operand1 is actually a register, but we cannot accept (REG...) because the
;; cprop_hardreg pass can and will renumber registers even inside
;; unspec_volatiles. So we take an integer register number parameter and
-;; fudge it to be a register name when we generate the assembler. We use %I
-;; because that is the only operator that will omit the # prefix to an
-;; integer value. Unfortunately it also inverts the integer value, so we
-;; have pre-invert it when generating this insn. (We could of course add a
-;; new operator, eg %J, just for this pattern...)
+;; fudge it to be a register name when we generate the assembler.
;;
;; The pushm pattern does not have this problem because of all of the
;; frame info cruft attached to it, so cprop_hardreg leaves it alone.
@@ -124,7 +120,7 @@
(match_operand 1 "immediate_operand" "i")
(match_operand 2 "immediate_operand" "i")] UNS_POPM)]
""
- "POPM%b0\t%2, r%I1"
+ "POPM%b0\t%2, r%J1"
)
;; The next two patterns are here to support a "feature" of how GCC implements
@@ -230,7 +226,7 @@
[(set (match_operand:PSI 0 "register_operand" "=r")
(subreg:PSI (match_operand:SI 1 "register_operand" "r") 0))]
"TARGET_LARGE"
- "PUSH.W\t%H1 { PUSH.W %L1 { POPM.A #1, %0 ; Move reg-pair %L1:%H1 into pointer %0"
+ "PUSH.W\t%H1 { PUSH.W\t%L1 { POPM.A #1, %0 ; Move reg-pair %L1:%H1 into pointer %0"
)
;;------------------------------------------------------------
@@ -275,7 +271,7 @@
(plus:SI (match_operand:SI 1 "register_operand" "0")
(match_operand 2 "general_operand" "rmi")))]
""
- "ADD.W\t%L2, %L0 { ADDC.W\t%H2, %H0 { PUSH.W %H0 { PUSH.W %L0 { POPM.A #1, %0"
+ "ADD.W\t%L2, %L0 { ADDC.W\t%H2, %H0 { PUSH.W\t%H0 { PUSH.W\t%L0 { POPM.A\t#1, %0"
)
(define_insn "addsi3"
@@ -318,7 +314,7 @@
(define_insn "addhi3_cy"
[(set (match_operand:HI 0 "msp_nonimmediate_operand" "=r,rm")
(plus:HI (match_operand:HI 1 "msp_nonimmediate_operand" "%0,0")
- (match_operand:HI 2 "msp_general_operand" "r,rm")))
+ (match_operand:HI 2 "msp_nonimmediate_operand" "r,rm")))
(set (reg:BI CARRY)
(truncate:BI (lshiftrt:SI (plus:SI (zero_extend:SI (match_dup 1))
(zero_extend:SI (match_dup 2)))
@@ -331,9 +327,9 @@
)
(define_insn "addhi3_cy_i"
- [(set (match_operand:HI 0 "nonimmediate_operand" "=r,rm")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=r,rm")
(plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0")
- (match_operand:HI 2 "general_operand" "i,i")))
+ (match_operand:HI 2 "immediate_operand" "i,i")))
(set (reg:BI CARRY)
(truncate:BI (lshiftrt:SI (plus:SI (zero_extend:SI (match_dup 1))
(match_operand 3 "immediate_operand" "i,i"))
@@ -349,7 +345,7 @@
(define_insn "addchi4_cy"
[(set (match_operand:HI 0 "msp_nonimmediate_operand" "=r,rm")
(plus:HI (plus:HI (match_operand:HI 1 "msp_nonimmediate_operand" "%0,0")
- (match_operand:HI 2 "msp_general_operand" "ri,rmi"))
+ (match_operand:HI 2 "msp_general_operand" "ri,rmi"))
(zero_extend:HI (reg:BI CARRY))))
]
""
@@ -516,7 +512,7 @@
)
(define_insn "zero_extendqihi2"
- [(set (match_operand:HI 0 "msp_nonimmediate_operand" "=rYs,m")
+ [(set (match_operand:HI 0 "msp_nonimmediate_operand" "=rYs,m")
(zero_extend:HI (match_operand:QI 1 "msp_nonimmediate_operand" "0,0")))]
""
"@
@@ -536,7 +532,7 @@
)
(define_insn "zero_extendhipsi2"
- [(set (match_operand:PSI 0 "msp_nonimmediate_operand" "=r,m")
+ [(set (match_operand:PSI 0 "msp_nonimmediate_operand" "=r,m")
(zero_extend:PSI (match_operand:HI 1 "msp_nonimmediate_operand" "rm,r")))]
""
"MOVX\t%1, %0"
@@ -621,9 +617,9 @@
stored in the stack slot will be the value *after* the
stack pointer has been decremented. So allow for that
here. */
- return \"PUSHM.A\t#1, %1 { ADDX.W #4, @r1 { POPX.W %L0 { POPX.W %H0 ; get stack pointer into %L0:%H0\";
+ return \"PUSHM.A\t#1, %1 { ADDX.W\t#4, @r1 { POPX.W\t%L0 { POPX.W\t%H0 ; get stack pointer into %L0:%H0\";
else
- return \"PUSHM.A\t#1, %1 { POPX.W %L0 { POPX.W %H0 ; move pointer in %1 into reg-pair %L0:%H0\";
+ return \"PUSHM.A\t#1, %1 { POPX.W\t%L0 { POPX.W\t%H0 ; move pointer in %1 into reg-pair %L0:%H0\";
"
)
@@ -642,9 +638,9 @@
it right by 16 bits, to get the top four bits of the pointer
sign-extended in %H0. */
if (REGNO (operands[0]) == REGNO (operands[1]))
- return \"MOVX.A\t%1, %H0 { MOV.W %1, %L0 { RPT #16 { RRAX.A %H0 ; sign extend pointer in %1 into %L0:%H0\";
+ return \"MOVX.A\t%1, %H0 { MOV.W\t%1, %L0 { RPT\t#16 { RRAX.A\t%H0 ; sign extend pointer in %1 into %L0:%H0\";
else
- return \"MOV.W \t%1, %L0 { MOVX.A %1, %H0 { RPT #16 { RRAX.A %H0 ; sign extend pointer in %1 into %L0:%H0\";
+ return \"MOV.W\t%1, %L0 { MOVX.A\t%1, %H0 { RPT\t#16 { RRAX.A\t%H0 ; sign extend pointer in %1 into %L0:%H0\";
"
)
@@ -654,7 +650,7 @@
[(set (match_operand:PSI 0 "register_operand" "=r")
(truncate:PSI (match_operand:SI 1 "register_operand" "r")))]
""
- "PUSH.W %H1 { PUSH.W %1 { POPM.A #1, %0"
+ "PUSH.W\t%H1 { PUSH.W\t%L1 { POPM.A\t#1, %L0"
)
;;------------------------------------------------------------
@@ -1304,8 +1300,8 @@
""
"*
if (REGNO (operands[0]) != REGNO (operands[1]))
- return \"MOV.W\t%1, %0 { SUB.W #0, %0 { AND.W %2, %0\";
+ return \"MOV.W\t%1, %0 { SUB.W\t#0, %0 { AND.W\t%2, %0\";
else
- return \"SUB.W\t#0, %0 { AND.W %2, %0\";
+ return \"SUB.W\t#0, %0 { AND.W\t%2, %0\";
"
)