summaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authorbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-25 12:04:17 +0000
committerbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-25 12:04:17 +0000
commitd263732c915b08ccfb5ef155ed27a8671760dc91 (patch)
tree0fecbc9fb7d6fe74247aea9809ba392638ca87c6 /gcc/emit-rtl.c
parent25715f21635867d814cee580670af40bb5185be9 (diff)
downloadgcc-d263732c915b08ccfb5ef155ed27a8671760dc91.tar.gz
2004-05-25 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in (OBJS): Add rtlhooks.o. (rtlanal.o): Depend on function.h. (cse.o): Depend on rtlhooks-def.h. (combine.o): Depend on rtlhooks-def.h. (rtlhooks.o): New rule. * combine.c: Include rtlhooks-def.h. (nonzero_bits, cached_nonzero_bits, nonzero_bits1, num_sign_bit_copies, cached_num_sign_bit_copies, num_sign_bit_copies1): Move most of the code to rtlanal.c. (reg_nonzero_bits_for_combine, reg_num_sign_bit_copies_for_combine): New functions holding the remnants of the above. (combine_rtl_hooks): New. (combine_instructions): Set rtl_hooks instead of gen_lowpart. * cse.c: Include rtlhooks-def.h. (cse_rtl_hooks): New. (cse_main): Set rtl_hooks instead of gen_lowpart. * emit-rtl.c (gen_lowpart): Remove. (gen_lowpart_general): Move to rtlhooks.c. * rtl.h (nonzero_bits, num_sign_bit_copies, struct rtl_hooks, rtl_hooks, general_rtl_hooks): New. (gen_lowpart_general): Remove. (gen_lowpart): Temporarily redefine as a macro. * rtlanal.c: Include function.h. (nonzero_bits, cached_nonzero_bits, nonzero_bits1, num_sign_bit_copies, cached_num_sign_bit_copies, num_sign_bit_copies1): New, from combine.c. * rtlhooks.c: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82234 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c58
1 files changed, 0 insertions, 58 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index ba8a3d6cf24..9211c087537 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -97,8 +97,6 @@ rtx global_rtl[GR_MAX];
at the beginning of each function. */
static GTY(()) rtx static_regno_reg_rtx[FIRST_PSEUDO_REGISTER];
-rtx (*gen_lowpart) (enum machine_mode mode, rtx x) = gen_lowpart_general;
-
/* We record floating-point CONST_DOUBLEs in each floating-point mode for
the values of 0, 1, and 2. For the integer entries and VOIDmode, we
record a copy of const[012]_rtx. */
@@ -1124,62 +1122,6 @@ gen_imagpart (enum machine_mode mode, rtx x)
return gen_highpart (mode, x);
}
-/* Assuming that X is an rtx (e.g., MEM, REG or SUBREG) for a value,
- return an rtx (MEM, SUBREG, or CONST_INT) that refers to the
- least-significant part of X.
- MODE specifies how big a part of X to return;
- it usually should not be larger than a word.
- If X is a MEM whose address is a QUEUED, the value may be so also. */
-
-rtx
-gen_lowpart_general (enum machine_mode mode, rtx x)
-{
- rtx result = gen_lowpart_common (mode, x);
-
- if (result)
- return result;
- else if (GET_CODE (x) == REG)
- {
- /* Must be a hard reg that's not valid in MODE. */
- result = gen_lowpart_common (mode, copy_to_reg (x));
- if (result == 0)
- abort ();
- return result;
- }
- else if (GET_CODE (x) == MEM)
- {
- /* The only additional case we can do is MEM. */
- int offset = 0;
-
- /* The following exposes the use of "x" to CSE. */
- if (GET_MODE_SIZE (GET_MODE (x)) <= UNITS_PER_WORD
- && SCALAR_INT_MODE_P (GET_MODE (x))
- && TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode),
- GET_MODE_BITSIZE (GET_MODE (x)))
- && ! no_new_pseudos)
- return gen_lowpart (mode, force_reg (GET_MODE (x), x));
-
- if (WORDS_BIG_ENDIAN)
- offset = (MAX (GET_MODE_SIZE (GET_MODE (x)), UNITS_PER_WORD)
- - MAX (GET_MODE_SIZE (mode), UNITS_PER_WORD));
-
- if (BYTES_BIG_ENDIAN)
- /* Adjust the address so that the address-after-the-data
- is unchanged. */
- offset -= (MIN (UNITS_PER_WORD, GET_MODE_SIZE (mode))
- - MIN (UNITS_PER_WORD, GET_MODE_SIZE (GET_MODE (x))));
-
- return adjust_address (x, mode, offset);
- }
- else if (GET_CODE (x) == ADDRESSOF)
- return gen_lowpart (mode, force_reg (GET_MODE (x), x));
- else
- abort ();
-}
-
-/* Like `gen_lowpart', but refer to the most significant part.
- This is used to access the imaginary part of a complex number. */
-
rtx
gen_highpart (enum machine_mode mode, rtx x)
{