From: Kazu Hirata Date: Thu, 30 May 2002 01:35:12 +0000 (+0000) Subject: h8300-protos.h: Remove prototypes for ok_for_bclr and small_power_of_two. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2e760b15f0cc7f1f0048fa997d225bb7c927b8ac;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d6895ef8941..19bcad2d1e3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2002-05-29 Kazu Hirata + + * 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 * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Define. diff --git a/gcc/config/h8300/h8300-protos.h b/gcc/config/h8300/h8300-protos.h index d02c082f8be..aa337d15e50 100644 --- a/gcc/config/h8300/h8300-protos.h +++ b/gcc/config/h8300/h8300-protos.h @@ -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 diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index 0258c68a9be..59e316192a7 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -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. */ diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index 7e78fc3f0bc..8109aee683c 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -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. diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index 6ae6d6f01e6..b789a3b446a 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -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; }")