* rtl.h (CONST_INT_P): Define.
* config/vax/vax.c (print_operand_address): Use CONST_INT_P()
instead of GET_CODE(x) == CONST_INT.
(vax_rtx_costs): Likewise.
(vax_output_int_move): Likewise.
(vax_output_int_add): Likewise.
(legitimate_constant_address_p): Likewise.
(index_term_p): Likewise.
* config/vax/vax.h (PRINT_OPERAND): Likewise.
* config/vax/vax.md (and<mode>3): Likewise.
(ashrsi3): Likewise.
(extv): Likewise.
(movstricthi): Likewise.
(movstrictqi): Likewise.
(rotrsi3): Likewise.
(five unnamed insns): Likewise.
From-SVN: r112169
+2006-03-16 Jan-Benedict Glaw <jbglaw@lug-owl.de>
+
+ * rtl.h (CONST_INT_P): Define.
+ * config/vax/vax.c (print_operand_address): Use CONST_INT_P()
+ instead of GET_CODE(x) == CONST_INT.
+ (vax_rtx_costs): Likewise.
+ (vax_output_int_move): Likewise.
+ (vax_output_int_add): Likewise.
+ (legitimate_constant_address_p): Likewise.
+ (index_term_p): Likewise.
+ * config/vax/vax.h (PRINT_OPERAND): Likewise.
+ * config/vax/vax.md (and<mode>3): Likewise.
+ (ashrsi3): Likewise.
+ (extv): Likewise.
+ (movstricthi): Likewise.
+ (movstrictqi): Likewise.
+ (rotrsi3): Likewise.
+ (five unnamed insns): Likewise.
+
2006-03-16 Geoffrey Keating <geoffk@apple.com>
* doc/tm.texi (SDB and DWARF): Add extra parameter to
{
if (offset)
{
- if (GET_CODE (offset) == CONST_INT)
+ if (CONST_INT_P (offset))
offset = plus_constant (XEXP (addr, 0), INTVAL (offset));
else
{
- gcc_assert (GET_CODE (XEXP (addr, 0)) == CONST_INT);
+ gcc_assert (CONST_INT_P (XEXP (addr, 0)));
offset = plus_constant (offset, INTVAL (XEXP (addr, 0)));
}
}
{
if (offset)
{
- if (GET_CODE (offset) == CONST_INT)
+ if (CONST_INT_P (offset))
offset = plus_constant (XEXP (addr, 1), INTVAL (offset));
else
{
- gcc_assert (GET_CODE (XEXP (addr, 1)) == CONST_INT);
+ gcc_assert (CONST_INT_P (XEXP (addr, 1)));
offset = plus_constant (offset, INTVAL (XEXP (addr, 1)));
}
}
case ROTATE:
case ROTATERT:
*total = 6; /* 5 on VAX 2, 4 on VAX 9000 */
- if (GET_CODE (XEXP (x, 1)) == CONST_INT)
+ if (CONST_INT_P (XEXP (x, 1)))
fmt = "e"; /* all constant rotate counts are short */
break;
case MINUS:
*total = (mode == DFmode) ? 13 : 8; /* 6/8 on VAX 9000, 16/15 on VAX 2 */
/* Small integer operands can use subl2 and addl2. */
- if ((GET_CODE (XEXP (x, 1)) == CONST_INT)
+ if ((CONST_INT_P (XEXP (x, 1)))
&& (unsigned HOST_WIDE_INT)(INTVAL (XEXP (x, 1)) + 63) < 127)
fmt = "e";
break;
case AND:
/* AND is special because the first operand is complemented. */
*total = 3;
- if (GET_CODE (XEXP (x, 0)) == CONST_INT)
+ if (CONST_INT_P (XEXP (x, 0)))
{
if ((unsigned HOST_WIDE_INT)~INTVAL (XEXP (x, 0)) > 63)
*total = 4;
}
if (operands[1] == const0_rtx)
return "clrl %0";
- if (GET_CODE (operands[1]) == CONST_INT
+ if (CONST_INT_P (operands[1])
&& (unsigned) INTVAL (operands[1]) >= 64)
{
int i = INTVAL (operands[1]);
return "movl %1,%0";
case HImode:
- if (GET_CODE (operands[1]) == CONST_INT)
+ if (CONST_INT_P (operands[1]))
{
int i = INTVAL (operands[1]);
if (i == 0)
return "movw %1,%0";
case QImode:
- if (GET_CODE (operands[1]) == CONST_INT)
+ if (CONST_INT_P (operands[1]))
{
int i = INTVAL (operands[1]);
if (i == 0)
return "incl %0";
if (operands[2] == constm1_rtx)
return "decl %0";
- if (GET_CODE (operands[2]) == CONST_INT
+ if (CONST_INT_P (operands[2])
&& (unsigned) (- INTVAL (operands[2])) < 64)
return "subl2 $%n2,%0";
- if (GET_CODE (operands[2]) == CONST_INT
+ if (CONST_INT_P (operands[2])
&& (unsigned) INTVAL (operands[2]) >= 64
&& REG_P (operands[1])
&& ((INTVAL (operands[2]) < 32767 && INTVAL (operands[2]) > -32768)
if (rtx_equal_p (operands[0], operands[2]))
return "addl2 %1,%0";
- if (GET_CODE (operands[2]) == CONST_INT
+ if (CONST_INT_P (operands[2])
&& INTVAL (operands[2]) < 32767
&& INTVAL (operands[2]) > -32768
&& REG_P (operands[1])
&& push_operand (operands[0], SImode))
return "pushab %c2(%1)";
- if (GET_CODE (operands[2]) == CONST_INT
+ if (CONST_INT_P (operands[2])
&& (unsigned) (- INTVAL (operands[2])) < 64)
return "subl3 $%n2,%1,%0";
- if (GET_CODE (operands[2]) == CONST_INT
+ if (CONST_INT_P (operands[2])
&& (unsigned) INTVAL (operands[2]) >= 64
&& REG_P (operands[1])
&& ((INTVAL (operands[2]) < 32767 && INTVAL (operands[2]) > -32768)
return "incw %0";
if (operands[2] == constm1_rtx)
return "decw %0";
- if (GET_CODE (operands[2]) == CONST_INT
+ if (CONST_INT_P (operands[2])
&& (unsigned) (- INTVAL (operands[2])) < 64)
return "subw2 $%n2,%0";
return "addw2 %2,%0";
}
if (rtx_equal_p (operands[0], operands[2]))
return "addw2 %1,%0";
- if (GET_CODE (operands[2]) == CONST_INT
+ if (CONST_INT_P (operands[2])
&& (unsigned) (- INTVAL (operands[2])) < 64)
return "subw3 $%n2,%1,%0";
return "addw3 %1,%2,%0";
return "incb %0";
if (operands[2] == constm1_rtx)
return "decb %0";
- if (GET_CODE (operands[2]) == CONST_INT
+ if (CONST_INT_P (operands[2])
&& (unsigned) (- INTVAL (operands[2])) < 64)
return "subb2 $%n2,%0";
return "addb2 %2,%0";
}
if (rtx_equal_p (operands[0], operands[2]))
return "addb2 %1,%0";
- if (GET_CODE (operands[2]) == CONST_INT
+ if (CONST_INT_P (operands[2])
&& (unsigned) (- INTVAL (operands[2])) < 64)
return "subb3 $%n2,%1,%0";
return "addb3 %1,%2,%0";
legitimate_constant_address_p (rtx x)
{
return (GET_CODE (x) == LABEL_REF || GET_CODE (x) == SYMBOL_REF
- || GET_CODE (x) == CONST_INT || GET_CODE (x) == CONST
+ || CONST_INT_P (x) || GET_CODE (x) == CONST
|| GET_CODE (x) == HIGH);
}
xfoo0 = XEXP (prod, 0);
xfoo1 = XEXP (prod, 1);
- if (GET_CODE (xfoo0) == CONST_INT
+ if (CONST_INT_P (xfoo0)
&& INTVAL (xfoo0) == (int)GET_MODE_SIZE (mode)
&& INDEX_REGISTER_P (xfoo1, strict))
return 1;
- if (GET_CODE (xfoo1) == CONST_INT
+ if (CONST_INT_P (xfoo1)
&& INTVAL (xfoo1) == (int)GET_MODE_SIZE (mode)
&& INDEX_REGISTER_P (xfoo0, strict))
return 1;
fputs (REGISTER_PREFIX, FILE); \
else if (CODE == 'C') \
fputs (rev_cond_name (X), FILE); \
- else if (CODE == 'D' && GET_CODE (X) == CONST_INT && INTVAL (X) < 0) \
+ else if (CODE == 'D' && CONST_INT_P (X) && INTVAL (X) < 0) \
fprintf (FILE, "$" NEG_HWI_PRINT_HEX16, INTVAL (X)); \
- else if (CODE == 'P' && GET_CODE (X) == CONST_INT) \
+ else if (CODE == 'P' && CONST_INT_P (X)) \
fprintf (FILE, "$" HOST_WIDE_INT_PRINT_DEC, INTVAL (X) + 1); \
- else if (CODE == 'N' && GET_CODE (X) == CONST_INT) \
+ else if (CODE == 'N' && CONST_INT_P (X)) \
fprintf (FILE, "$" HOST_WIDE_INT_PRINT_DEC, ~ INTVAL (X)); \
/* rotl instruction cannot deal with negative arguments. */ \
- else if (CODE == 'R' && GET_CODE (X) == CONST_INT) \
+ else if (CODE == 'R' && CONST_INT_P (X)) \
fprintf (FILE, "$" HOST_WIDE_INT_PRINT_DEC, 32 - INTVAL (X)); \
- else if (CODE == 'H' && GET_CODE (X) == CONST_INT) \
+ else if (CODE == 'H' && CONST_INT_P (X)) \
fprintf (FILE, "$%d", (int) (0xffff & ~ INTVAL (X))); \
- else if (CODE == 'h' && GET_CODE (X) == CONST_INT) \
+ else if (CODE == 'h' && CONST_INT_P (X)) \
fprintf (FILE, "$%d", (short) - INTVAL (x)); \
- else if (CODE == 'B' && GET_CODE (X) == CONST_INT) \
+ else if (CODE == 'B' && CONST_INT_P (X)) \
fprintf (FILE, "$%d", (int) (0xff & ~ INTVAL (X))); \
- else if (CODE == 'b' && GET_CODE (X) == CONST_INT) \
+ else if (CODE == 'b' && CONST_INT_P (X)) \
fprintf (FILE, "$%d", (int) (0xff & - INTVAL (X))); \
- else if (CODE == 'M' && GET_CODE (X) == CONST_INT) \
+ else if (CODE == 'M' && CONST_INT_P (X)) \
fprintf (FILE, "$%d", ~((1 << INTVAL (x)) - 1)); \
else if (REG_P (X)) \
fprintf (FILE, "%s", reg_names[REGNO (X)]); \
""
"*
{
- if (GET_CODE (operands[1]) == CONST_INT)
+ if (CONST_INT_P (operands[1]))
{
int i = INTVAL (operands[1]);
if (i == 0)
""
"*
{
- if (GET_CODE (operands[1]) == CONST_INT)
+ if (CONST_INT_P (operands[1]))
{
int i = INTVAL (operands[1]);
if (i == 0)
rtx op1 = operands[1];
/* If there is a constant argument, complement that one. */
- if (GET_CODE (operands[2]) == CONST_INT && GET_CODE (op1) != CONST_INT)
+ if (CONST_INT_P (operands[2]) && !CONST_INT_P (op1))
{
operands[1] = operands[2];
operands[2] = op1;
op1 = operands[1];
}
- if (GET_CODE (op1) == CONST_INT)
+ if (CONST_INT_P (op1))
operands[1] = GEN_INT (~INTVAL (op1));
else
operands[1] = expand_unop (<MODE>mode, one_cmpl_optab, op1, 0, 1);
""
"
{
- if (GET_CODE (operands[2]) != CONST_INT)
+ if (!CONST_INT_P (operands[2]))
operands[2] = gen_rtx_NEG (QImode, negate_rtx (QImode, operands[2]));
}")
if (operands[2] == const1_rtx && rtx_equal_p (operands[0], operands[1]))
return \"addl2 %0,%0\";
if (REG_P (operands[1])
- && GET_CODE (operands[2]) == CONST_INT)
+ && CONST_INT_P (operands[2]))
{
int i = INTVAL (operands[2]);
if (i == 1)
""
"
{
- if (GET_CODE (operands[2]) != CONST_INT)
+ if (!CONST_INT_P (operands[2]))
operands[2] = gen_rtx_NEG (QImode, negate_rtx (QImode, operands[2]));
}")
""
"*
{
- if (GET_CODE (operands[3]) != CONST_INT || GET_CODE (operands[2]) != CONST_INT
+ if (!CONST_INT_P (operands[3])
+ || !CONST_INT_P (operands[2])
|| !REG_P (operands[0])
|| (INTVAL (operands[2]) != 8 && INTVAL (operands[2]) != 16))
return \"extv %3,%2,%1,%0\";
""
"*
{
- if (GET_CODE (operands[3]) != CONST_INT || GET_CODE (operands[2]) != CONST_INT
+ if (!CONST_INT_P (operands[3])
+ || !CONST_INT_P (operands[2])
|| !REG_P (operands[0]))
return \"extzv %3,%2,%1,%0\";
if (INTVAL (operands[2]) == 8)
""
"*
{
- if (!REG_P (operands[0]) || GET_CODE (operands[2]) != CONST_INT
- || GET_CODE (operands[3]) != CONST_INT
+ if (!REG_P (operands[0])
+ || !CONST_INT_P (operands[2])
+ || !CONST_INT_P (operands[3])
|| (INTVAL (operands[2]) != 8 && INTVAL (operands[2]) != 16)
|| INTVAL (operands[2]) + INTVAL (operands[3]) > 32
|| side_effects_p (operands[1])
""
"*
{
- if (!REG_P (operands[0]) || GET_CODE (operands[2]) != CONST_INT
- || GET_CODE (operands[3]) != CONST_INT
+ if (!REG_P (operands[0])
+ || !CONST_INT_P (operands[2])
+ || !CONST_INT_P (operands[3])
|| INTVAL (operands[2]) + INTVAL (operands[3]) > 32
|| side_effects_p (operands[1])
|| (MEM_P (operands[1])
(set (match_dup 0)
(plus:SI (match_dup 0)
(const_int 1)))]
- "!TARGET_UNIX_ASM && GET_CODE (operands[1]) == CONST_INT"
+ "!TARGET_UNIX_ASM && CONST_INT_P (operands[1])"
"jaoblss %P1,%0,%l2")
(define_insn ""
(set (match_dup 0)
(plus:SI (match_dup 0)
(const_int 1)))]
- "!TARGET_UNIX_ASM && GET_CODE (operands[1]) == CONST_INT"
+ "!TARGET_UNIX_ASM && CONST_INT_P (operands[1])"
"jaobleq %P1,%0,%l2")
;; Something like a sob insn, but compares against -1.
/* Predicate yielding nonzero iff X is an rtx for a memory location. */
#define MEM_P(X) (GET_CODE (X) == MEM)
+/* Prediacte yielding nonzero iff X is an rtx for a constant integer. */
+#define CONST_INT_P(X) (GET_CODE (X) == CONST_INT)
+
/* Predicate yielding nonzero iff X is a label insn. */
#define LABEL_P(X) (GET_CODE (X) == CODE_LABEL)