summaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2013-06-25 08:21:42 +0000
committerNick Clifton <nickc@redhat.com>2013-06-25 08:21:42 +0000
commitb04ffe464484f00a4d4a68b5b50f4101b8933491 (patch)
treead811ef8c6396ab0c8a07baba5fd75d37bb78008 /gas
parent4d4626344eb23b04eeead046132808c648fbb356 (diff)
downloadbinutils-redhat-b04ffe464484f00a4d4a68b5b50f4101b8933491.tar.gz
* config/tc-msp430.c (msp430_srcoperand): Do not allow the use of
the PC in indirect addressing on 430xv2 parts. (msp430_operands): Add version test to hardware bug encoding restrictions.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/tc-msp430.c25
2 files changed, 21 insertions, 11 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 905d953d60..fcdb900382 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2013-06-25 Nick Clifton <nickc@redhat.com>
+
+ * config/tc-msp430.c (msp430_srcoperand): Do not allow the use of
+ the PC in indirect addressing on 430xv2 parts.
+ (msp430_operands): Add version test to hardware bug encoding
+ restrictions.
+
2013-06-24 Roland McGrath <mcgrathr@google.com>
* config/tc-arm.c (parse_reg_list): Use skip_past_char for '}',
diff --git a/gas/config/tc-msp430.c b/gas/config/tc-msp430.c
index f319b23656..e16fcd9527 100644
--- a/gas/config/tc-msp430.c
+++ b/gas/config/tc-msp430.c
@@ -1215,7 +1215,6 @@ md_parse_option (int c, char * arg)
return 0;
}
-
const pseudo_typeS md_pseudo_table[] =
{
{"arch", msp430_set_arch, OPTION_MMCU},
@@ -1649,6 +1648,12 @@ msp430_srcoperand (struct msp430_operand_s * op,
op->am = m ? 3 : 2;
op->ol = 0;
+ /* PC cannot be used in indirect addressing. */
+ if (target_is_430xv2 () && op->reg == 0)
+ {
+ as_bad (_("cannot use indirect addressing with the PC"));
+ return 1;
+ }
return 0;
}
@@ -2300,8 +2305,8 @@ msp430_operands (struct msp430_opcode_s * opcode, char * line)
frag = frag_more (insn_length);
where = frag - frag_now->fr_literal;
- /* Issue 3831743. */
- if (op1.mode == OP_REG
+ if (target_is_430xv2 ()
+ && op1.mode == OP_REG
&& op1.reg == 0
&& (is_opcode ("rlax")
|| is_opcode ("rlcx")
@@ -2580,8 +2585,8 @@ msp430_operands (struct msp430_opcode_s * opcode, char * line)
return 0;
}
- /* Issue 3831713: CPU21 parts cannot use POPM to restore the SR register. */
- if (target_is_430x ()
+ /* CPU21 parts cannot use POPM to restore the SR register. */
+ if (target_is_430xv2 ()
&& (reg - n + 1 < 3)
&& reg >= 2
&& is_opcode ("popm"))
@@ -2640,8 +2645,7 @@ msp430_operands (struct msp430_opcode_s * opcode, char * line)
return 0;
}
- /* Issue 3831743. */
- if (reg == 0)
+ if (target_is_430xv2 () && reg == 0)
{
as_bad (_("%s: attempt to rotate the PC register"), opcode->name);
return 0;
@@ -2681,8 +2685,7 @@ msp430_operands (struct msp430_opcode_s * opcode, char * line)
return 0;
}
- /* Issue 3831743. */
- if (reg == 0)
+ if (target_is_430xv2 () && reg == 0)
{
as_bad (_("%s: attempt to rotate the PC register"), opcode->name);
return 0;
@@ -3060,8 +3063,8 @@ msp430_operands (struct msp430_opcode_s * opcode, char * line)
if (res)
break; /* Error in operand. */
- /* Issue 3831743. */
- if (op1.mode == OP_REG
+ if (target_is_430xv2 ()
+ && op1.mode == OP_REG
&& op1.reg == 0
&& (is_opcode ("rrax")
|| is_opcode ("rrcx")