aboutsummaryrefslogtreecommitdiff
path: root/opcodes/mips-formats.h
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2013-08-03 10:49:48 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2013-08-03 10:49:48 +0000
commit3ccad066ac853353fb20d9bf2993107dda242801 (patch)
tree50222c01bc5d4e226cc9b32442b1be3215278165 /opcodes/mips-formats.h
parent0acfaea6cd192fce727369cdcede034410a5a1da (diff)
downloadgdb-3ccad066ac853353fb20d9bf2993107dda242801.zip
gdb-3ccad066ac853353fb20d9bf2993107dda242801.tar.gz
gdb-3ccad066ac853353fb20d9bf2993107dda242801.tar.bz2
include/opcode/
* mips.h (mips_pcrel_operand): Inherit from mips_int_operand. (mips_int_operand_min, mips_int_operand_max): New functions. (mips_decode_pcrel_operand): Use mips_decode_int_operand. opcodes/ * mips-formats.h (PCREL): Reorder parameters and update the definition to match new mips_pcrel_operand layout. (JUMP, JALX, BRANCH): Update accordingly. * mips16-opc.c (decode_mips16_operand): Likewise. gas/ * config/tc-mips.c (match_int_operand): Use mips_int_operand_min and mips_int_operand_max. (mips16_immed_operand, mips16_immed_operands, MIPS16_NUM_IMMED): Delete. (mips16_immed_operand, mips16_immed_in_range_p): New functions. (mips16_immed, mips16_extended_frag): Use them. Use mips_int_operand instead of mips16_immed_operand.
Diffstat (limited to 'opcodes/mips-formats.h')
-rw-r--r--opcodes/mips-formats.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/opcodes/mips-formats.h b/opcodes/mips-formats.h
index c55bb27..49a0623 100644
--- a/opcodes/mips-formats.h
+++ b/opcodes/mips-formats.h
@@ -91,24 +91,25 @@
return &op.root; \
}
-#define PCREL(SIZE, LSB, ALIGN_LOG2, SHIFT, IS_SIGNED, INCLUDE_ISA_BIT, \
+#define PCREL(SIZE, LSB, IS_SIGNED, SHIFT, ALIGN_LOG2, INCLUDE_ISA_BIT, \
FLIP_ISA_BIT) \
{ \
static const struct mips_pcrel_operand op = { \
- { OP_PCREL, SIZE, LSB }, ALIGN_LOG2, SHIFT, IS_SIGNED, \
- INCLUDE_ISA_BIT, FLIP_ISA_BIT \
+ { { OP_PCREL, SIZE, LSB }, \
+ (1 << ((SIZE) - (IS_SIGNED))) - 1, 0, SHIFT, TRUE }, \
+ ALIGN_LOG2, INCLUDE_ISA_BIT, FLIP_ISA_BIT \
}; \
- return &op.root; \
+ return &op.root.root; \
}
#define JUMP(SIZE, LSB, SHIFT) \
- PCREL (SIZE, LSB, SIZE + SHIFT, SHIFT, FALSE, TRUE, FALSE)
+ PCREL (SIZE, LSB, FALSE, SHIFT, SIZE + SHIFT, TRUE, FALSE)
#define JALX(SIZE, LSB, SHIFT) \
- PCREL (SIZE, LSB, SIZE + SHIFT, SHIFT, FALSE, TRUE, TRUE)
+ PCREL (SIZE, LSB, FALSE, SHIFT, SIZE + SHIFT, TRUE, TRUE)
#define BRANCH(SIZE, LSB, SHIFT) \
- PCREL (SIZE, LSB, 0, SHIFT, TRUE, TRUE, FALSE)
+ PCREL (SIZE, LSB, TRUE, SHIFT, 0, TRUE, FALSE)
#define SPECIAL(SIZE, LSB, TYPE) \
{ \