int
smalloffset_mem_p (rtx op)
{
- if (GET_CODE (op) == MEM)
+ if (MEM_P (op))
{
rtx addr = XEXP (op, 0);
- if (GET_CODE (addr) == REG)
+ if (REG_P (addr))
return BASE_REG_P (addr, 0);
if (GET_CODE (addr) == PLUS)
{
rtx offset = XEXP (addr, 0);
HOST_WIDE_INT val;
- if (GET_CODE (offset) != CONST_INT)
+ if (! CONST_INT_P (offset))
offset = XEXP (addr, 1);
- if (GET_CODE (offset) != CONST_INT)
+ if (! CONST_INT_P (offset))
return FALSE;
val = INTVAL (offset);
sym = XEXP (addr, 0);
}
- if ((GET_CODE (sym) == SYMBOL_REF)
+ if (SYMBOL_REF_P (sym)
&& CONSTANT_POOL_ADDRESS_P (sym))
return true;
return false;
int
constantpool_mem_p (rtx op)
{
- if (GET_CODE (op) == SUBREG)
+ if (SUBREG_P (op))
op = SUBREG_REG (op);
- if (GET_CODE (op) == MEM)
+ if (MEM_P (op))
return constantpool_address_p (XEXP (op, 0));
return FALSE;
}
if (! targetm.have_tls)
return false;
- return GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x) != 0;
+ return SYMBOL_REF_P (x) && SYMBOL_REF_TLS_MODEL (x) != 0;
}
mode = GET_MODE (cmp1);
/* Make sure we can handle any constants given to us. */
- if (GET_CODE (cmp1) == CONST_INT)
+ if (CONST_INT_P (cmp1))
{
HOST_WIDE_INT value = INTVAL (cmp1);
unsigned HOST_WIDE_INT uvalue = (unsigned HOST_WIDE_INT)value;
cmp1 = force_reg (mode, cmp1);
}
}
- else if ((GET_CODE (cmp1) != REG) && (GET_CODE (cmp1) != SUBREG))
+ else if (! REG_P (cmp1) && ! SUBREG_P (cmp1))
{
cmp1 = force_reg (mode, cmp1);
}
/* Comparison to constants, may involve adding 1 to change a LT into LE.
Comparison between two registers, may involve switching operands. */
- if (GET_CODE (cmp1) == CONST_INT)
+ if (CONST_INT_P (cmp1))
{
if (p_info->const_add != 0)
cmp1 = GEN_INT (INTVAL (cmp1) + p_info->const_add);
rtx src = operands[1];
if (CONSTANT_P (src)
- && (GET_CODE (src) != CONST_INT || ! xtensa_simm12b (INTVAL (src))))
+ && (! CONST_INT_P (src) || ! xtensa_simm12b (INTVAL (src))))
{
rtx dst = operands[0];
/* The operand using a7 may come in a later instruction, so just return
the original operand if it doesn't use a7. */
reg = opnd;
- if (GET_CODE (reg) == SUBREG)
+ if (SUBREG_P (reg))
{
gcc_assert (SUBREG_BYTE (reg) == 0);
reg = SUBREG_REG (reg);
}
- if (GET_CODE (reg) != REG
+ if (! REG_P (reg)
|| REGNO (reg) > A7_REG
|| REGNO (reg) + hard_regno_nregs (A7_REG, mode) <= A7_REG)
return opnd;
rtx x;
/* If this is not a fixed size move, just call memcpy. */
- if (!optimize || (GET_CODE (operands[2]) != CONST_INT))
+ if (!optimize || ! CONST_INT_P (operands[2]))
return 0;
bytes = INTVAL (operands[2]);
/* Generate a call to "__xtensa_nonlocal_goto" (in libgcc); the code
is too big to generate in-line. */
- if (GET_CODE (containing_fp) != REG)
+ if (! REG_P (containing_fp))
containing_fp = force_reg (Pmode, containing_fp);
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__xtensa_nonlocal_goto"),
static char result[64];
rtx tgt = operands[callop];
- if (GET_CODE (tgt) == CONST_INT)
+ if (CONST_INT_P (tgt))
sprintf (result, "call%d\t" HOST_WIDE_INT_PRINT_HEX,
WINDOW_SIZE, INTVAL (tgt));
else if (register_operand (tgt, VOIDmode))
&& ! xtensa_tls_referenced_p (addr))
return true;
- while (GET_CODE (addr) == SUBREG)
+ while (SUBREG_P (addr))
addr = SUBREG_REG (addr);
/* Allow base registers. */
- if (GET_CODE (addr) == REG && BASE_REG_P (addr, strict))
+ if (REG_P (addr) && BASE_REG_P (addr, strict))
return true;
/* Check for "register + offset" addressing. */
enum rtx_code code0;
enum rtx_code code1;
- while (GET_CODE (xplus0) == SUBREG)
+ while (SUBREG_P (xplus0))
xplus0 = SUBREG_REG (xplus0);
code0 = GET_CODE (xplus0);
- while (GET_CODE (xplus1) == SUBREG)
+ while (SUBREG_P (xplus1))
xplus1 = SUBREG_REG (xplus1);
code1 = GET_CODE (xplus1);
rtx plus0 = XEXP (x, 0);
rtx plus1 = XEXP (x, 1);
- if (GET_CODE (plus0) != REG && GET_CODE (plus1) == REG)
+ if (! REG_P (plus0) && REG_P (plus1))
{
plus0 = XEXP (x, 1);
plus1 = XEXP (x, 0);
}
/* Try to split up the offset to use an ADDMI instruction. */
- if (GET_CODE (plus0) == REG
- && GET_CODE (plus1) == CONST_INT
+ if (REG_P (plus0) && CONST_INT_P (plus1)
&& !xtensa_mem_offset (INTVAL (plus1), mode)
&& !xtensa_simm8 (INTVAL (plus1))
&& xtensa_mem_offset (INTVAL (plus1) & 0xff, mode)
FOR_EACH_SUBRTX (iter, array, x, ALL)
{
const_rtx x = *iter;
- if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x) != 0)
+ if (SYMBOL_REF_P (x) && SYMBOL_REF_TLS_MODEL (x) != 0)
return true;
/* Ignore TLS references that have already been legitimized. */
switch (letter)
{
case 'D':
- if (GET_CODE (x) == REG || GET_CODE (x) == SUBREG)
+ if (REG_P (x) || SUBREG_P (x))
fprintf (file, "%s", reg_names[xt_true_regnum (x) + 1]);
else
output_operand_lossage ("invalid %%D value");
break;
case 'v':
- if (GET_CODE (x) == MEM)
+ if (MEM_P (x))
{
/* For a volatile memory reference, emit a MEMW before the
load or store. */
break;
case 'N':
- if (GET_CODE (x) == MEM
+ if (MEM_P (x)
&& (GET_MODE (x) == DFmode || GET_MODE (x) == DImode))
{
x = adjust_address (x, GET_MODE (x) == DFmode ? E_SFmode : E_SImode,
break;
case 'K':
- if (GET_CODE (x) == CONST_INT)
+ if (CONST_INT_P (x))
{
unsigned val = INTVAL (x);
if (!xtensa_mask_immediate (val))
break;
case 'L':
- if (GET_CODE (x) == CONST_INT)
+ if (CONST_INT_P (x))
fprintf (file, HOST_WIDE_INT_PRINT_DEC, (32 - INTVAL (x)) & 0x1f);
else
output_operand_lossage ("invalid %%L value");
break;
case 'R':
- if (GET_CODE (x) == CONST_INT)
+ if (CONST_INT_P (x))
fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) & 0x1f);
else
output_operand_lossage ("invalid %%R value");
break;
case 'x':
- if (GET_CODE (x) == CONST_INT)
+ if (CONST_INT_P (x))
printx (file, INTVAL (x));
else
output_operand_lossage ("invalid %%x value");
break;
case 'd':
- if (GET_CODE (x) == CONST_INT)
+ if (CONST_INT_P (x))
fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
else
output_operand_lossage ("invalid %%d value");
case 't':
case 'b':
- if (GET_CODE (x) == CONST_INT)
+ if (CONST_INT_P (x))
{
printx (file, INTVAL (x));
fputs (letter == 't' ? "@h" : "@l", file);
}
- else if (GET_CODE (x) == CONST_DOUBLE)
+ else if (CONST_DOUBLE_P (x))
{
if (GET_MODE (x) == SFmode)
{
/* X must be a symbolic constant on ELF. Write an expression
suitable for 'const16' that sets the high or low 16 bits. */
if (GET_CODE (XEXP (x, 0)) != PLUS
- || (GET_CODE (XEXP (XEXP (x, 0), 0)) != SYMBOL_REF
- && GET_CODE (XEXP (XEXP (x, 0), 0)) != LABEL_REF)
- || GET_CODE (XEXP (XEXP (x, 0), 1)) != CONST_INT)
+ || (! SYMBOL_REF_P (XEXP (XEXP (x, 0), 0))
+ && ! LABEL_REF_P (XEXP (XEXP (x, 0), 0)))
+ || ! CONST_INT_P (XEXP (XEXP (x, 0), 1)))
output_operand_lossage ("invalid %%t/%%b value");
print_operand (file, XEXP (XEXP (x, 0), 0), 0);
fputs (letter == 't' ? "@h" : "@l", file);
break;
case 'y':
- if (GET_CODE (x) == CONST_DOUBLE &&
- GET_MODE (x) == SFmode)
+ if (CONST_DOUBLE_P (x) && GET_MODE (x) == SFmode)
{
long l;
REAL_VALUE_TO_TARGET_SINGLE (*CONST_DOUBLE_REAL_VALUE (x), l);
/* fall through */
default:
- if (GET_CODE (x) == REG || GET_CODE (x) == SUBREG)
+ if (REG_P (x) || SUBREG_P (x))
fprintf (file, "%s", reg_names[xt_true_regnum (x)]);
- else if (GET_CODE (x) == MEM)
+ else if (MEM_P (x))
output_address (GET_MODE (x), XEXP (x, 0));
- else if (GET_CODE (x) == CONST_INT)
+ else if (CONST_INT_P (x))
fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
else
output_addr_const (file, x);
rtx arg0 = XEXP (addr, 0);
rtx arg1 = XEXP (addr, 1);
- if (GET_CODE (arg0) == REG)
+ if (REG_P (arg0))
{
reg = arg0;
offset = arg1;
}
- else if (GET_CODE (arg1) == REG)
+ else if (REG_P (arg1))
{
reg = arg1;
offset = arg0;
switch (GET_MODE_CLASS (mode))
{
case MODE_FLOAT:
- gcc_assert (GET_CODE (x) == CONST_DOUBLE);
+ gcc_assert (CONST_DOUBLE_P (x));
switch (mode)
{