diff options
author | Shujing Zhao <pearly.zhao@oracle.com> | 2009-06-05 19:08:10 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2009-06-05 19:08:10 +0000 |
commit | 47ac44d6bafe68785e5f6443969b6b654ab39567 (patch) | |
tree | feb0f9a15a31137072334187c573068bf4b6d2c4 /gcc | |
parent | 19b905ce29121de6335c9a90b3ef10c068ce0a66 (diff) | |
download | gcc-47ac44d6bafe68785e5f6443969b6b654ab39567.zip gcc-47ac44d6bafe68785e5f6443969b6b654ab39567.tar.gz gcc-47ac44d6bafe68785e5f6443969b6b654ab39567.tar.bz2 |
mips.c: Use REG_P and CONST_INT_P where applicable.
2009-06-05 Shujing Zhao <pearly.zhao@oracle.com>
* config/mips/mips.c: Use REG_P and CONST_INT_P where applicable.
* config/mips/mips.md: Ditto.
From-SVN: r148224
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 24 | ||||
-rw-r--r-- | gcc/config/mips/mips.md | 12 |
3 files changed, 23 insertions, 18 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8487345..7473556 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-06-05 Shujing Zhao <pearly.zhao@oracle.com> + + * config/mips/mips.c: Use REG_P and CONST_INT_P where applicable. + * config/mips/mips.md: Ditto. + 2009-06-05 Nathan Froyd <froydnj@codesourcery.com> * config/rs6000/eabi.asm (__eabi_convert): Don't define if diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 9e3d20b..44dd450 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -1327,7 +1327,7 @@ mips_merge_decl_attributes (tree olddecl, tree newdecl) static void mips_split_plus (rtx x, rtx *base_ptr, HOST_WIDE_INT *offset_ptr) { - if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT) + if (GET_CODE (x) == PLUS && CONST_INT_P (XEXP (x, 1))) { *base_ptr = XEXP (x, 0); *offset_ptr = INTVAL (XEXP (x, 1)); @@ -1921,7 +1921,7 @@ mips_cannot_force_const_mem (rtx x) references, reload will consider forcing C into memory and using one of the instruction's memory alternatives. Returning false here will force it to use an input reload instead. */ - if (GET_CODE (x) == CONST_INT && LEGITIMATE_CONSTANT_P (x)) + if (CONST_INT_P (x) && LEGITIMATE_CONSTANT_P (x)) return true; split_const (x, &base, &offset); @@ -2153,7 +2153,7 @@ mips_lwxs_address_p (rtx addr) rtx offset = XEXP (addr, 0); if (GET_CODE (offset) == MULT && REG_P (XEXP (offset, 0)) - && GET_CODE (XEXP (offset, 1)) == CONST_INT + && CONST_INT_P (XEXP (offset, 1)) && INTVAL (XEXP (offset, 1)) == 4) return true; } @@ -3068,7 +3068,7 @@ mips_rewrite_small_data (rtx pattern) static int m16_check_op (rtx op, int low, int high, int mask) { - return (GET_CODE (op) == CONST_INT + return (CONST_INT_P (op) && IN_RANGE (INTVAL (op), low, high) && (INTVAL (op) & mask) == 0); } @@ -4108,7 +4108,7 @@ mips_canonicalize_int_order_test (enum rtx_code *code, rtx *cmp1, if (mips_int_order_operand_ok_p (*code, *cmp1)) return true; - if (GET_CODE (*cmp1) == CONST_INT) + if (CONST_INT_P (*cmp1)) switch (*code) { case LE: @@ -6439,7 +6439,7 @@ mips_block_move_loop (rtx dest, rtx src, HOST_WIDE_INT length, bool mips_expand_block_move (rtx dest, rtx src, rtx length) { - if (GET_CODE (length) == CONST_INT) + if (CONST_INT_P (length)) { if (INTVAL (length) <= MIPS_MAX_MOVE_BYTES_STRAIGHT) { @@ -7194,28 +7194,28 @@ mips_print_operand (FILE *file, rtx op, int letter) switch (letter) { case 'X': - if (GET_CODE (op) == CONST_INT) + if (CONST_INT_P (op)) fprintf (file, HOST_WIDE_INT_PRINT_HEX, INTVAL (op)); else output_operand_lossage ("invalid use of '%%%c'", letter); break; case 'x': - if (GET_CODE (op) == CONST_INT) + if (CONST_INT_P (op)) fprintf (file, HOST_WIDE_INT_PRINT_HEX, INTVAL (op) & 0xffff); else output_operand_lossage ("invalid use of '%%%c'", letter); break; case 'd': - if (GET_CODE (op) == CONST_INT) + if (CONST_INT_P (op)) fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (op)); else output_operand_lossage ("invalid use of '%%%c'", letter); break; case 'm': - if (GET_CODE (op) == CONST_INT) + if (CONST_INT_P (op)) fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (op) - 1); else output_operand_lossage ("invalid use of '%%%c'", letter); @@ -9398,7 +9398,7 @@ mips_emit_loadgp (void) static int mips_kernel_reg_p (rtx *x, void *data ATTRIBUTE_UNUSED) { - return GET_CODE (*x) == REG && KERNEL_REG_P (REGNO (*x)); + return REG_P (*x) && KERNEL_REG_P (REGNO (*x)); } /* Expand the "prologue" pattern. */ @@ -14710,7 +14710,7 @@ mips_epilogue_uses (unsigned int regno) static int mips_at_reg_p (rtx *x, void *data ATTRIBUTE_UNUSED) { - return GET_CODE (*x) == REG && REGNO (*x) == AT_REGNUM; + return REG_P (*x) && REGNO (*x) == AT_REGNUM; } diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index e571614..46e7afa 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -4837,7 +4837,7 @@ reload pass. */ if (TARGET_MIPS16 && optimize - && GET_CODE (operands[2]) == CONST_INT + && CONST_INT_P (operands[2]) && INTVAL (operands[2]) > 8 && INTVAL (operands[2]) <= 16 && !reload_in_progress @@ -4858,7 +4858,7 @@ (match_operand:SI 2 "arith_operand" "dI")))] "!TARGET_MIPS16" { - if (GET_CODE (operands[2]) == CONST_INT) + if (CONST_INT_P (operands[2])) operands[2] = GEN_INT (INTVAL (operands[2]) & (GET_MODE_BITSIZE (<MODE>mode) - 1)); @@ -4874,7 +4874,7 @@ (match_operand:SI 2 "arith_operand" "dI"))))] "TARGET_64BIT && !TARGET_MIPS16" { - if (GET_CODE (operands[2]) == CONST_INT) + if (CONST_INT_P (operands[2])) operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f); return "<insn>\t%0,%1,%2"; @@ -4930,7 +4930,7 @@ (match_operand:SI 2 "arith_operand" "d,I")))] "TARGET_64BIT && TARGET_MIPS16" { - if (GET_CODE (operands[2]) == CONST_INT) + if (CONST_INT_P (operands[2])) operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f); return "dsra\t%0,%2"; @@ -4949,7 +4949,7 @@ (match_operand:SI 2 "arith_operand" "d,I")))] "TARGET_64BIT && TARGET_MIPS16" { - if (GET_CODE (operands[2]) == CONST_INT) + if (CONST_INT_P (operands[2])) operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f); return "dsrl\t%0,%2"; @@ -5004,7 +5004,7 @@ (match_operand:SI 2 "arith_operand" "dI")))] "ISA_HAS_ROR" { - if (GET_CODE (operands[2]) == CONST_INT) + if (CONST_INT_P (operands[2])) gcc_assert (INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) < GET_MODE_BITSIZE (<MODE>mode)); |