X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=opcodes%2Fmips-formats.h;h=49a0623da535a65bda28a7a39a4c01b01b1f12be;hb=3ccad066ac853353fb20d9bf2993107dda242801;hp=7deba5e0ebc4777bbe34d0da3837c6a12ffa970a;hpb=ab90248154ba05dc800c480712c3cb03eb33b135;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/mips-formats.h b/opcodes/mips-formats.h index 7deba5e0eb..49a0623da5 100644 --- a/opcodes/mips-formats.h +++ b/opcodes/mips-formats.h @@ -45,7 +45,8 @@ #define MAPPED_INT(SIZE, LSB, MAP, PRINT_HEX) \ { \ - typedef char static_assert[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \ + typedef char ATTRIBUTE_UNUSED \ + static_assert[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \ static const struct mips_mapped_int_operand op = { \ { OP_MAPPED_INT, SIZE, LSB }, MAP, PRINT_HEX \ }; \ @@ -70,7 +71,8 @@ #define MAPPED_REG(SIZE, LSB, BANK, MAP) \ { \ - typedef char static_assert[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \ + typedef char ATTRIBUTE_UNUSED \ + static_assert[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \ static const struct mips_reg_operand op = { \ { OP_REG, SIZE, LSB }, OP_REG_##BANK, MAP \ }; \ @@ -79,32 +81,35 @@ #define REG_PAIR(SIZE, LSB, BANK, MAP) \ { \ - typedef char static_assert1[(1 << (SIZE)) == ARRAY_SIZE (MAP##1)]; \ - typedef char static_assert2[(1 << (SIZE)) == ARRAY_SIZE (MAP##2)]; \ + typedef char ATTRIBUTE_UNUSED \ + static_assert1[(1 << (SIZE)) == ARRAY_SIZE (MAP##1)]; \ + typedef char ATTRIBUTE_UNUSED \ + static_assert2[(1 << (SIZE)) == ARRAY_SIZE (MAP##2)]; \ static const struct mips_reg_pair_operand op = { \ { OP_REG_PAIR, SIZE, LSB }, OP_REG_##BANK, MAP##1, MAP##2 \ }; \ 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) \ { \