diff options
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/i386/i386-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 30 | ||||
-rw-r--r-- | gcc/config/i386/i386.h | 34 | ||||
-rwxr-xr-x | gcc/configure | 2 |
5 files changed, 54 insertions, 21 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7e5f0f5..aac7623 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h index 03fa84f..57fdaa4 100644 --- a/gcc/config/i386/i386-protos.h +++ b/gcc/config/i386/i386-protos.h @@ -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)); diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 2737b6b..683c881 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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; +} diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 4800872..162da52 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -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. diff --git a/gcc/configure b/gcc/configure index 6ec98d7..2fa4611 100755 --- a/gcc/configure +++ b/gcc/configure @@ -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 |