00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "config.h"
00022 #include "system.h"
00023 #include "coretypes.h"
00024 #include "tm.h"
00025 #include "rtl.h"
00026 #include "rtlhooks-def.h"
00027 #include "expr.h"
00028
00029
00030
00031
00032
00033
00034
00035
00036 const struct rtl_hooks general_rtl_hooks = RTL_HOOKS_INITIALIZER;
00037 struct rtl_hooks rtl_hooks = RTL_HOOKS_INITIALIZER;
00038
00039 rtx
00040 gen_lowpart_general (enum machine_mode mode, rtx x)
00041 {
00042 rtx result = gen_lowpart_common (mode, x);
00043
00044 if (result)
00045 return result;
00046 else if (REG_P (x))
00047 {
00048
00049 result = gen_lowpart_common (mode, copy_to_reg (x));
00050 gcc_assert (result != 0);
00051 return result;
00052 }
00053 else
00054 {
00055 int offset = 0;
00056
00057
00058 gcc_assert (MEM_P (x));
00059
00060
00061 if (GET_MODE_SIZE (GET_MODE (x)) <= UNITS_PER_WORD
00062 && SCALAR_INT_MODE_P (GET_MODE (x))
00063 && TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode),
00064 GET_MODE_BITSIZE (GET_MODE (x)))
00065 && ! no_new_pseudos)
00066 return gen_lowpart_general (mode, force_reg (GET_MODE (x), x));
00067
00068 if (WORDS_BIG_ENDIAN)
00069 offset = (MAX (GET_MODE_SIZE (GET_MODE (x)), UNITS_PER_WORD)
00070 - MAX (GET_MODE_SIZE (mode), UNITS_PER_WORD));
00071
00072 if (BYTES_BIG_ENDIAN)
00073
00074
00075 offset -= (MIN (UNITS_PER_WORD, GET_MODE_SIZE (mode))
00076 - MIN (UNITS_PER_WORD, GET_MODE_SIZE (GET_MODE (x))));
00077
00078 return adjust_address (x, mode, offset);
00079 }
00080 }
00081
00082 rtx
00083 reg_num_sign_bit_copies_general (rtx x ATTRIBUTE_UNUSED,
00084 enum machine_mode mode ATTRIBUTE_UNUSED,
00085 rtx known_x ATTRIBUTE_UNUSED,
00086 enum machine_mode known_mode ATTRIBUTE_UNUSED,
00087 unsigned int known_ret ATTRIBUTE_UNUSED,
00088 unsigned int *result ATTRIBUTE_UNUSED)
00089 {
00090 return NULL;
00091 }
00092
00093 rtx
00094 reg_nonzero_bits_general (rtx x ATTRIBUTE_UNUSED,
00095 enum machine_mode mode ATTRIBUTE_UNUSED,
00096 rtx known_x ATTRIBUTE_UNUSED,
00097 enum machine_mode known_mode ATTRIBUTE_UNUSED,
00098 unsigned HOST_WIDE_INT known_ret ATTRIBUTE_UNUSED,
00099 unsigned HOST_WIDE_INT *nonzero ATTRIBUTE_UNUSED)
00100 {
00101 return NULL;
00102 }