* i386.h (VALID_FP_MODE_P, VALID_INT_MODE_P): New.
(HARD_REGNO_MODE_OK): Move offline to ....
* i386.c (ix86_hard_regno_mode_ok) ... here;
refuse all incorrect modes.
* i386-protos.h (ix86_hard_regno_mode_ok): Declare.
From-SVN: r39621
+Die Feb 13 11:04:25 CET 2001 Jan Hubicka <jh@suse.cz>
+
+ * i386.h (VALID_FP_MODE_P, VALID_INT_MODE_P): New.
+ (HARD_REGNO_MODE_OK): Move offline to ....
+ * i386.c (ix86_hard_regno_mode_ok) ... here;
+ refuse all incorrect modes.
+ * i386-protos.h (ix86_hard_regno_mode_ok): Declare.
+
2001-02-13 Richard Henderson <rth@redhat.com>
* sparc.md (cmp_cc_arith_op_set): Don't use match_dup on the
extern rtx ix86_force_to_memory PARAMS ((enum machine_mode, rtx));
extern void ix86_free_from_memory PARAMS ((enum machine_mode));
extern void ix86_split_fp_branch PARAMS ((rtx, rtx, rtx, rtx, rtx, rtx));
+extern int ix86_hard_regno_mode_ok PARAMS ((int, enum machine_mode));
#ifdef TREE_CODE
extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, rtx));
? 2
: 4))));
}
+
+/* Return 1 if hard register REGNO can hold a value of machine-mode MODE. */
+int
+ix86_hard_regno_mode_ok (regno, mode)
+ int regno;
+ enum machine_mode mode;
+{
+ /* Flags and only flags can only hold CCmode values. */
+ if (CC_REGNO_P (regno))
+ return GET_MODE_CLASS (mode) == MODE_CC;
+ if (GET_MODE_CLASS (mode) == MODE_CC
+ || GET_MODE_CLASS (mode) == MODE_RANDOM
+ || GET_MODE_CLASS (mode) == MODE_PARTIAL_INT)
+ return 0;
+ if (FP_REGNO_P (regno))
+ return VALID_FP_MODE_P (mode);
+ if (SSE_REGNO_P (regno))
+ return VALID_SSE_REG_MODE (mode);
+ if (MMX_REGNO_P (regno))
+ return VALID_MMX_REG_MODE (mode);
+ /* We handle both integer and floats in the general purpose registers.
+ In future we should be able to handle vector modes as well. */
+ if (!VALID_INT_MODE_P (mode) && !VALID_FP_MODE_P (mode))
+ return 0;
+ /* Take care for QImode values - they can be in non-QI regs, but then
+ they do cause partial register stalls. */
+ if (QI_REG_P (regno) || mode != QImode)
+ return 1;
+ return reload_in_progress || reload_completed || !TARGET_PARTIAL_REG_STALL;
+}
(VALID_SSE_REG_MODE (MODE) && TARGET_SSE ? 1 \
: VALID_MMX_REG_MODE (MODE) && TARGET_MMX ? 1 : 0)
+#define VALID_FP_MODE_P(mode) \
+ ((mode) == SFmode || (mode) == DFmode || (mode) == TFmode \
+ || (mode) == XFmode \
+ || (mode) == SCmode || (mode) == DCmode || (mode) == TCmode\
+ || (mode) == XCmode)
+
+#define VALID_INT_MODE_P(mode) \
+ ((mode) == QImode || (mode) == HImode || (mode) == SImode \
+ || (mode) == DImode \
+ || (mode) == CQImode || (mode) == CHImode || (mode) == CSImode \
+ || (mode) == CDImode)
+
/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */
-#define HARD_REGNO_MODE_OK(REGNO, MODE) \
- /* Flags and only flags can only hold CCmode values. */ \
- (CC_REGNO_P (REGNO) \
- ? GET_MODE_CLASS (MODE) == MODE_CC \
- : GET_MODE_CLASS (MODE) == MODE_CC ? 0 \
- /* FP regs can only hold floating point; make it clear they \
- cannot hold TFmode floats. */ \
- : FP_REGNO_P (REGNO) \
- ? ((GET_MODE_CLASS (MODE) == MODE_FLOAT \
- || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT) \
- && GET_MODE_UNIT_SIZE (MODE) <= 16)\
- : SSE_REGNO_P (REGNO) ? VALID_SSE_REG_MODE (MODE) \
- : MMX_REGNO_P (REGNO) ? VALID_MMX_REG_MODE (MODE) \
- /* Only SSE and MMX regs can hold vector modes. */ \
- : VECTOR_MODE_P (MODE) || (MODE) == TImode ? 0 \
- : (REGNO) < 4 ? 1 \
- /* Other regs cannot do byte accesses. */ \
- : (MODE) != QImode ? 1 \
- : reload_in_progress || reload_completed \
- || !TARGET_PARTIAL_REG_STALL)
+#define HARD_REGNO_MODE_OK(REGNO, MODE) \
+ ix86_hard_regno_mode_ok (REGNO, MODE)
/* Value is 1 if it is a good idea to tie two pseudo registers
when one has mode MODE1 and one has mode MODE2.
# Find some useful tools
-for ac_prog in gawk mawk nawk awk
+for ac_prog in mawk gawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2