diff options
author | Maciej W. Rozycki <macro@imgtec.com> | 2016-12-23 19:40:09 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@imgtec.com> | 2016-12-23 20:37:18 +0000 |
commit | 5d766ae78a9dd4e71d7c989e8f3bdf1fd61b8068 (patch) | |
tree | 56e867c6b548ace4e137272572a562bdb3deb96b /gas | |
parent | 3e523b9b0c5bccde948494ab85a5d6821d8ecf78 (diff) | |
download | gdb-5d766ae78a9dd4e71d7c989e8f3bdf1fd61b8068.zip gdb-5d766ae78a9dd4e71d7c989e8f3bdf1fd61b8068.tar.gz gdb-5d766ae78a9dd4e71d7c989e8f3bdf1fd61b8068.tar.bz2 |
MIPS16: Simplify extended operand handling
Simplify extended operand handling and only specially process immediates
which require bit shuffling, using the generic operand insertion and
extraction handlers for the '<' (5-bit shift amount) operand code in
particular. Require the least significant bit of all extended operand
forms to be (artificially) set to 0 for their special processing to
trigger.
gas/
* config/tc-mips.c (mips16_immed): Limit `mips16_immed_extend'
use to operands whose LSB position is zero.
opcodes/
* mips-dis.c (print_mips16_insn_arg): Simplify processing of
extended operands.
* mips16-opc.c (decode_mips16_operand): Switch the extended
form of the `<' operand type to LSB position 22.
(cherry picked from commit bdd152861ce75c36828904cf3d10f8ce14da6cf5)
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-mips.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 2d0f4b1..3a05d78 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,10 @@ 2016-12-23 Maciej W. Rozycki <macro@imgtec.com> + * config/tc-mips.c (mips16_immed): Limit `mips16_immed_extend' + use to operands whose LSB position is zero. + +2016-12-23 Maciej W. Rozycki <macro@imgtec.com> + * config/tc-mips.c (match_mips16_insn): Don't update `forced_insn_length' or the instruction opcode if an operand requires an extended instruction form, but an unextended one diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 20e8020..1e7cddc 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -14023,7 +14023,7 @@ mips16_immed (const char *file, unsigned int line, int type, _("operand value out of range for instruction")); } uval = ((unsigned int) val >> operand->shift) - operand->bias; - if (length == 2) + if (length == 2 || operand->root.lsb != 0) *insn = mips_insert_operand (&operand->root, *insn, uval); else *insn |= mips16_immed_extend (uval, operand->root.size); |