diff options
| author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-09-20 20:11:25 +0000 |
|---|---|---|
| committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-09-20 20:11:25 +0000 |
| commit | c89e85ef3be1bbaa5bcc32dd01eaf929b6120eb3 (patch) | |
| tree | b6ca836dcfa21c14457388a9fb8b674893d5b152 /gcc/config/mips/mips.c | |
| parent | 2db7f8d113db10e3c5fe9ab7b98a9a929e376f8e (diff) | |
| download | ppe42-gcc-c89e85ef3be1bbaa5bcc32dd01eaf929b6120eb3.tar.gz ppe42-gcc-c89e85ef3be1bbaa5bcc32dd01eaf929b6120eb3.zip | |
* config/mips/mips.c (dfhigh, dflow, sfhigh, sflow): Remove.
(override_options): Do not initialize them.
(mips_const_double_ok): Allow no fp constants except zero,
and not even that for mips16.
(const_float_1_operand): Use dconst1.
* config/mips/mips.md (movsf, movsf_internal1, movsf_internal2,
movdf, movdf_internal1, movdf_internal1a, movdf_internal2):
Don't allow arbitrary constants; fix predicates and C constraint.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57368 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/mips/mips.c')
| -rw-r--r-- | gcc/config/mips/mips.c | 59 |
1 files changed, 5 insertions, 54 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 192c60b4f3d..1d7157d8d05 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -352,11 +352,6 @@ int mips_split_addresses; /* Generating calls to position independent functions? */ enum mips_abicalls_type mips_abicalls; -/* High and low marks for floating point values which we will accept - as legitimate constants for LEGITIMATE_CONSTANT_P. These are - initialized in override_options. */ -REAL_VALUE_TYPE dfhigh, dflow, sfhigh, sflow; - /* Mode used for saving/restoring general purpose registers. */ static enum machine_mode gpr_mode; @@ -821,37 +816,16 @@ mips_const_double_ok (op, mode) if (mode == VOIDmode) return 1; + /* We've no zero register in mips16 mode. */ + if (TARGET_MIPS16) + return 0; + if (mode != SFmode && mode != DFmode) return 0; if (op == CONST0_RTX (mode)) return 1; - /* ??? li.s does not work right with SGI's Irix 6 assembler. */ - if (mips_abi != ABI_32 && mips_abi != ABI_O64 && mips_abi != ABI_EABI) - return 0; - - REAL_VALUE_FROM_CONST_DOUBLE (d, op); - - if (REAL_VALUE_ISNAN (d)) - return FALSE; - - if (REAL_VALUE_NEGATIVE (d)) - d = REAL_VALUE_NEGATE (d); - - if (mode == DFmode) - { - if (REAL_VALUES_LESS (d, dfhigh) - && REAL_VALUES_LESS (dflow, d)) - return 1; - } - else - { - if (REAL_VALUES_LESS (d, sfhigh) - && REAL_VALUES_LESS (sflow, d)) - return 1; - } - return 0; } @@ -863,9 +837,6 @@ const_float_1_operand (op, mode) enum machine_mode mode; { REAL_VALUE_TYPE d; - static REAL_VALUE_TYPE onedf; - static REAL_VALUE_TYPE onesf; - static int one_initialized; if (GET_CODE (op) != CONST_DOUBLE || mode != GET_MODE (op) @@ -874,19 +845,7 @@ const_float_1_operand (op, mode) REAL_VALUE_FROM_CONST_DOUBLE (d, op); - /* We only initialize these values if we need them, since we will - never get called unless mips_isa >= 4. */ - if (! one_initialized) - { - onedf = REAL_VALUE_ATOF ("1.0", DFmode); - onesf = REAL_VALUE_ATOF ("1.0", SFmode); - one_initialized = 1; - } - - if (mode == DFmode) - return REAL_VALUES_EQUAL (d, onedf); - else - return REAL_VALUES_EQUAL (d, onesf); + return REAL_VALUES_EQUAL (d, dconst1); } /* Return true if a memory load or store of REG plus OFFSET in MODE @@ -5310,14 +5269,6 @@ override_options () else mips16 = 0; - /* Initialize the high and low values for legitimate floating point - constants. Rather than trying to get the accuracy down to the - last bit, just use approximate ranges. */ - dfhigh = REAL_VALUE_ATOF ("1.0e300", DFmode); - dflow = REAL_VALUE_ATOF ("1.0e-300", DFmode); - sfhigh = REAL_VALUE_ATOF ("1.0e38", SFmode); - sflow = REAL_VALUE_ATOF ("1.0e-38", SFmode); - mips_print_operand_punct['?'] = 1; mips_print_operand_punct['#'] = 1; mips_print_operand_punct['&'] = 1; |

