Commit 2e760b15 by Kazu Hirata Committed by Kazu Hirata

h8300-protos.h: Remove prototypes for ok_for_bclr and small_power_of_two.

	* 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.

From-SVN: r54037
parent e1c293ae
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.
......
......@@ -74,8 +74,6 @@ extern int h8300_tiny_data_p PARAMS ((tree));
extern void h8300_init_once PARAMS ((void));
extern void asm_file_start PARAMS ((FILE *));
extern void asm_file_end PARAMS ((FILE *));
extern int ok_for_bclr PARAMS ((HOST_WIDE_INT));
extern int small_power_of_two PARAMS ((HOST_WIDE_INT));
extern int initial_offset PARAMS ((int, int));
#ifdef GCC_C_PRAGMA_H
......
......@@ -521,28 +521,6 @@ asm_file_end (file)
fprintf (file, "\t.end\n");
}
/* 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. */
......@@ -3245,32 +3223,30 @@ fix_bit_operand (operands, what, type)
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. */
......
......@@ -429,8 +429,6 @@ enum reg_class {
(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) : \
......@@ -439,8 +437,6 @@ enum reg_class {
(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.
......
......@@ -1023,7 +1023,7 @@
""
"
{
if (fix_bit_operand (operands, 'O', AND))
if (fix_bit_operand (operands, 0, AND))
DONE;
}")
......@@ -1094,7 +1094,7 @@
""
"
{
if (fix_bit_operand (operands, 'P', IOR))
if (fix_bit_operand (operands, 1, IOR))
DONE;
}")
......@@ -1136,7 +1136,7 @@
""
"
{
if (fix_bit_operand (operands, 'O', XOR))
if (fix_bit_operand (operands, 1, XOR))
DONE;
}")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment