diff options
author | Bob Wilson <bob.wilson@acm.org> | 2007-07-25 17:33:27 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@acm.org> | 2007-07-25 17:33:27 +0000 |
commit | d12f9798efc24cae3261f9956d035d24caa1d7e1 (patch) | |
tree | c641ca9e9a0bde1ba8c009474d9b32c3537a325c | |
parent | 5b31182830a4cd48ad5781887c55ff9d56c9674d (diff) | |
download | gdb-d12f9798efc24cae3261f9956d035d24caa1d7e1.zip gdb-d12f9798efc24cae3261f9956d035d24caa1d7e1.tar.gz gdb-d12f9798efc24cae3261f9956d035d24caa1d7e1.tar.bz2 |
* config/tc-xtensa.c (xtensa_extui_opcode): New.
(xg_expand_assembly_insn): Check for invalid extui operands.
(md_begin): Initialize xtensa_extui_opcode.
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/config/tc-xtensa.c | 16 |
2 files changed, 22 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 72439ba..a4e2bb7 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2007-07-25 Sterling Augustine <sterling@tensilica.com> + + * config/tc-xtensa.c (xtensa_extui_opcode): New. + (xg_expand_assembly_insn): Check for invalid extui operands. + (md_begin): Initialize xtensa_extui_opcode. + 2007-07-24 Nick Clifton <nickc@redhat.com> * config/tc-mep.h (skip_whitespace): Remove definition. diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index d4eb7f4..aef5fc9 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -553,6 +553,7 @@ static xtensa_opcode xtensa_callx8_opcode; static xtensa_opcode xtensa_callx12_opcode; static xtensa_opcode xtensa_const16_opcode; static xtensa_opcode xtensa_entry_opcode; +static xtensa_opcode xtensa_extui_opcode; static xtensa_opcode xtensa_movi_opcode; static xtensa_opcode xtensa_movi_n_opcode; static xtensa_opcode xtensa_isync_opcode; @@ -3888,6 +3889,20 @@ xg_expand_assembly_insn (IStack *istack, TInsn *orig_insn) if (tinsn_has_invalid_symbolic_operands (orig_insn)) return TRUE; + /* Special case for extui opcode which has constraints not handled + by the ordinary operand encoding checks. The number of operands + and related syntax issues have already been checked. */ + if (orig_insn->opcode == xtensa_extui_opcode) + { + int shiftimm = orig_insn->tok[2].X_add_number; + int maskimm = orig_insn->tok[3].X_add_number; + if (shiftimm + maskimm > 32) + { + as_bad (_("immediate operands sum to greater than 32")); + return TRUE; + } + } + /* If the instruction will definitely need to be relaxed, it is better to expand it now for better scheduling. Decide whether to expand now.... */ @@ -5012,6 +5027,7 @@ md_begin (void) xtensa_callx12_opcode = xtensa_opcode_lookup (isa, "callx12"); xtensa_const16_opcode = xtensa_opcode_lookup (isa, "const16"); xtensa_entry_opcode = xtensa_opcode_lookup (isa, "entry"); + xtensa_extui_opcode = xtensa_opcode_lookup (isa, "extui"); xtensa_movi_opcode = xtensa_opcode_lookup (isa, "movi"); xtensa_movi_n_opcode = xtensa_opcode_lookup (isa, "movi.n"); xtensa_isync_opcode = xtensa_opcode_lookup (isa, "isync"); |