+2002-05-29 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Remove prototypes for
+ ok_for_bclr and small_power_of_two.
+ * config/h8300/h8300.c (small_power_of_two): Remove.
+ (ok_for_blcr): Likewise.
+ (fix_bit_operand): Make WHAT deal with an integer instead of a
+ constraint character.
+ * config/h8300/h8300.h (CONST_OK_FOR_O): Remove.
+ (CONST_OK_FOR_P): Likewise.
+ (CONST_OK_FOR_LETTER_P): Do not call CONST_OK_FOR_O or
+ CONST_OK_FOR_P any more.
+ * config/h8300/h8300.md (andqi3): Adjust to the new prototype
+ of fix_bit_operand.
+ (iorqi3): Likewise.
+ (xorqi3): Likewise.
+
2002-05-29 Jason Thorpe <thorpej@wasabisystems.com>
* config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Define.
fprintf (file, "\t.end\n");
}
\f
-/* Return true if VALUE is a valid constant for constraint 'P'.
- IE: VALUE is a power of two <= 2**15. */
-
-int
-small_power_of_two (value)
- HOST_WIDE_INT value;
-{
- int power = exact_log2 (value);
- return power >= 0 && power <= 15;
-}
-
-/* Return true if VALUE is a valid constant for constraint 'O', which
- means that the constant would be ok to use as a bit for a bclr
- instruction. */
-
-int
-ok_for_bclr (value)
- HOST_WIDE_INT value;
-{
- return small_power_of_two ((~value) & 0xff);
-}
-
/* Return true if OP is a valid source operand for an integer move
instruction. */
only 'U' memory afterwards, so if this is a MEM operand, we must force
it to be valid for 'U' by reloading the address. */
- if (GET_CODE (operands[2]) == CONST_INT)
+ if ((what == 0 && single_zero_operand (operands[2], QImode))
+ || (what == 1 && single_one_operand (operands[2], QImode)))
{
- if (CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), what))
+ /* OK to have a memory dest. */
+ if (GET_CODE (operands[0]) == MEM
+ && !EXTRA_CONSTRAINT (operands[0], 'U'))
{
- /* Ok to have a memory dest. */
- if (GET_CODE (operands[0]) == MEM
- && !EXTRA_CONSTRAINT (operands[0], 'U'))
- {
- rtx mem = gen_rtx_MEM (GET_MODE (operands[0]),
- copy_to_mode_reg (Pmode,
- XEXP (operands[0], 0)));
- MEM_COPY_ATTRIBUTES (mem, operands[0]);
- operands[0] = mem;
- }
+ rtx mem = gen_rtx_MEM (GET_MODE (operands[0]),
+ copy_to_mode_reg (Pmode,
+ XEXP (operands[0], 0)));
+ MEM_COPY_ATTRIBUTES (mem, operands[0]);
+ operands[0] = mem;
+ }
- if (GET_CODE (operands[1]) == MEM
- && !EXTRA_CONSTRAINT (operands[1], 'U'))
- {
- rtx mem = gen_rtx_MEM (GET_MODE (operands[1]),
- copy_to_mode_reg (Pmode,
- XEXP (operands[1], 0)));
- MEM_COPY_ATTRIBUTES (mem, operands[0]);
- operands[1] = mem;
- }
- return 0;
+ if (GET_CODE (operands[1]) == MEM
+ && !EXTRA_CONSTRAINT (operands[1], 'U'))
+ {
+ rtx mem = gen_rtx_MEM (GET_MODE (operands[1]),
+ copy_to_mode_reg (Pmode,
+ XEXP (operands[1], 0)));
+ MEM_COPY_ATTRIBUTES (mem, operands[0]);
+ operands[1] = mem;
}
+ return 0;
}
/* Dest and src op must be register. */
(TARGET_H8300H || TARGET_H8300S \
? (VALUE) == -1 || (VALUE) == -2 || (VALUE) == -4 \
: (VALUE) == -1 || (VALUE) == -2)
-#define CONST_OK_FOR_O(VALUE) (ok_for_bclr (VALUE))
-#define CONST_OK_FOR_P(VALUE) (small_power_of_two (VALUE))
#define CONST_OK_FOR_LETTER_P(VALUE, C) \
((C) == 'I' ? CONST_OK_FOR_I (VALUE) : \
(C) == 'L' ? CONST_OK_FOR_L (VALUE) : \
(C) == 'M' ? CONST_OK_FOR_M (VALUE) : \
(C) == 'N' ? CONST_OK_FOR_N (VALUE) : \
- (C) == 'O' ? CONST_OK_FOR_O (VALUE) : \
- (C) == 'P' ? CONST_OK_FOR_P (VALUE) : \
0)
/* Similar, but for floating constants, and defining letters G and H.
""
"
{
- if (fix_bit_operand (operands, 'O', AND))
+ if (fix_bit_operand (operands, 0, AND))
DONE;
}")
""
"
{
- if (fix_bit_operand (operands, 'P', IOR))
+ if (fix_bit_operand (operands, 1, IOR))
DONE;
}")
""
"
{
- if (fix_bit_operand (operands, 'O', XOR))
+ if (fix_bit_operand (operands, 1, XOR))
DONE;
}")