aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2002-05-30 01:35:12 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2002-05-30 01:35:12 +0000
commit2e760b15f0cc7f1f0048fa997d225bb7c927b8ac (patch)
treeff1dfda87a769361d3707bb78a4b7cc2c9df4b09 /gcc
parente1c293ae205da90f0bc0788fbf9bbe87336dcd58 (diff)
downloadgcc-2e760b15f0cc7f1f0048fa997d225bb7c927b8ac.zip
gcc-2e760b15f0cc7f1f0048fa997d225bb7c927b8ac.tar.gz
gcc-2e760b15f0cc7f1f0048fa997d225bb7c927b8ac.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog17
-rw-r--r--gcc/config/h8300/h8300-protos.h2
-rw-r--r--gcc/config/h8300/h8300.c64
-rw-r--r--gcc/config/h8300/h8300.h4
-rw-r--r--gcc/config/h8300/h8300.md6
5 files changed, 40 insertions, 53 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d6895ef..19bcad2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,20 @@
+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.
diff --git a/gcc/config/h8300/h8300-protos.h b/gcc/config/h8300/h8300-protos.h
index d02c082..aa337d1 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 0258c68..59e3161 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 7e78fc3..8109aee6 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 6ae6d6f..b789a3b 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;
}")