/* For small integers, we may actually use testb. */
if (GET_CODE (operands[1]) == CONST_INT
&& ! (GET_CODE (operands[0]) == MEM && MEM_VOLATILE_P (operands[0]))
- && (! REG_P (operands[0]) || QI_REG_P (operands[0])))
+ && (! REG_P (operands[0]) || QI_REG_P (operands[0]))
+ /* A Pentium test is pairable only with eax. Not with ah or al. */
+ && (! REG_P (operands[0]) || REGNO (operands[0]) || !TARGET_PENTIUM
+ || optimize_size))
{
/* We may set the sign bit spuriously. */
mask = ((1 << INTVAL (operands[1])) - 1) << INTVAL (operands[2]);
operands[1] = GEN_INT (mask);
- if (QI_REG_P (operands[0]))
+ if (QI_REG_P (operands[0])
+ /* A Pentium test is pairable only with eax. Not with ah or al. */
+ && (! REG_P (operands[0]) || REGNO (operands[0]) || !TARGET_PENTIUM
+ || optimize_size))
{
if ((mask & ~0xff) == 0)
{
mask = ((1 << INTVAL (operands[1])) - 1) << INTVAL (operands[2]);
operands[1] = GEN_INT (mask);
- if (! REG_P (operands[0]) || QI_REG_P (operands[0]))
+ if (! REG_P (operands[0]) || QI_REG_P (operands[0])
+ /* A Pentium test is pairable only with eax. Not with ah or al. */
+ && (! REG_P (operands[0]) || REGNO (operands[0]) || !TARGET_PENTIUM
+ || optimize_size))
{
if ((mask & ~0xff) == 0)
{
default:
abort ();
}
- operands[3] = GEN_INT (c);
- output_asm_insn (AS2 (testl,%3,%2), operands);
+ if (!TARGET_PENTIUM || optimize_size)
+ {
+ operands[3] = GEN_INT (c >> 8);
+ output_asm_insn (AS2 (test%B0,%3,%h2), operands);
+ }
+ else
+ {
+ operands[3] = GEN_INT (c);
+ output_asm_insn (AS2 (test%L0,%3,%2), operands);
+ }
return eq ? AS1 (sete,%0) : AS1 (setne, %0);
}
default:
abort ();
}
- operands[3] = GEN_INT (c);
- output_asm_insn (AS2 (testl,%3,%2), operands);
+ if (!TARGET_PENTIUM || optimize_size)
+ {
+ operands[3] = GEN_INT (c >> 8);
+ output_asm_insn (AS2 (test%B0,%3,%h2), operands);
+ }
+ else
+ {
+ operands[3] = GEN_INT (c);
+ output_asm_insn (AS2 (test%L0,%3,%2), operands);
+ }
return eq ? AS1 (je,%l1) : AS1 (jne, %l1);
}
if ((cc_status.flags & CC_NO_OVERFLOW) && (code == LE || code == GT))
default:
abort ();
}
- operands[3] = GEN_INT (c);
- output_asm_insn (AS2 (testl,%3,%2), operands);
+ if (!TARGET_PENTIUM || optimize_size)
+ {
+ operands[3] = GEN_INT (c >> 8);
+ output_asm_insn (AS2 (test%B0,%3,%h2), operands);
+ }
+ else
+ {
+ operands[3] = GEN_INT (c);
+ output_asm_insn (AS2 (test%L0,%3,%2), operands);
+ }
return eq ? AS1 (je,%l1) : AS1 (jne, %l1);
}
if ((cc_status.flags & CC_NO_OVERFLOW) && (code == LE || code == GT))