OSDN Git Service

* i386.h (VALID_FP_MODE_P, VALID_INT_MODE_P): New.
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 13 Feb 2001 10:05:56 +0000 (10:05 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 13 Feb 2001 10:05:56 +0000 (10:05 +0000)
(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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39621 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386-protos.h
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/configure

index 7e5f0f5..aac7623 100644 (file)
@@ -1,3 +1,11 @@
+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
index 03fa84f..57fdaa4 100644 (file)
@@ -131,6 +131,7 @@ extern enum machine_mode ix86_fp_compare_mode PARAMS ((enum rtx_code));
 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));
index 2737b6b..683c881 100644 (file)
@@ -8724,3 +8724,33 @@ ix86_free_from_memory (mode)
                                                 ? 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;
+}
index 4800872..162da52 100644 (file)
@@ -775,28 +775,22 @@ extern int ix86_arch;
     (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.
index 6ec98d7..2fa4611 100755 (executable)
@@ -1571,7 +1571,7 @@ esac
 
 
 # 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