diff options
author | krebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-03-29 11:55:53 +0000 |
---|---|---|
committer | krebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-03-29 11:55:53 +0000 |
commit | 3686849050cfe9e28fee36c7785f70ee9d4e491c (patch) | |
tree | d8d134d3bae1ae04863febb7e4b3e1647676337e /gcc/config/s390 | |
parent | 0840f4fe9eecbb786f6ff885e4ce52ab470f05d6 (diff) | |
download | gcc-3686849050cfe9e28fee36c7785f70ee9d4e491c.tar.gz |
2006-03-29 Andreas Krebbel <krebbel1@de.ibm.com>
* config.gcc (s390-*-linux-*, s390x-*-linux*): Add t-dfprules to
tmake_file.
* config/s390/s390.c (S390_scalar_mode_supported_p): New function.
(NR_C_MODES): Add TDmode, DDmode and SDmode.
(s390_output_pool_entry, ): Accept MODE_DECIMAL_FLOAT.
(s390_hard_regno_mode_ok): Disallow TDmode in integer regs.
(s390_function_arg_float): Allow SDmode and DDmode values to be
passed in floating point registers.
(s390_function_arg_integer, s390_function_value): Replace MODE_FLOAT
check with SCALAR_FLOAT_MODE_P.
(TARGET_SCALAR_MODE_SUPPORTED_P): Define target macro.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112491 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/s390')
-rw-r--r-- | gcc/config/s390/s390.c | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 1ee6fba6add..fdd4b5c5431 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -334,6 +334,16 @@ struct machine_function GTY(()) #define REGNO_PAIR_OK(REGNO, MODE) \ (HARD_REGNO_NREGS ((REGNO), (MODE)) == 1 || !((REGNO) & 1)) +/* Return true if the back end supports mode MODE. */ +static bool +s390_scalar_mode_supported_p (enum machine_mode mode) +{ + if (DECIMAL_FLOAT_MODE_P (mode)) + return true; + else + return default_scalar_mode_supported_p (mode); +} + /* Set the has_landing_pad_p flag in struct machine_function to VALUE. */ void @@ -5259,12 +5269,12 @@ replace_ltrel_base (rtx *x) /* We keep a list of constants which we have to add to internal constant tables in the middle of large functions. */ -#define NR_C_MODES 8 +#define NR_C_MODES 11 enum machine_mode constant_modes[NR_C_MODES] = { - TFmode, TImode, - DFmode, DImode, - SFmode, SImode, + TFmode, TImode, TDmode, + DFmode, DImode, DDmode, + SFmode, SImode, SDmode, HImode, QImode }; @@ -6207,6 +6217,7 @@ s390_output_pool_entry (rtx exp, enum machine_mode mode, unsigned int align) switch (GET_MODE_CLASS (mode)) { case MODE_FLOAT: + case MODE_DECIMAL_FLOAT: gcc_assert (GET_CODE (exp) == CONST_DOUBLE); REAL_VALUE_FROM_CONST_DOUBLE (r, exp); @@ -6782,7 +6793,7 @@ s390_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode) if (REGNO_PAIR_OK (regno, mode)) { if (TARGET_64BIT - || (mode != TFmode && mode != TCmode)) + || (mode != TFmode && mode != TCmode && mode != TDmode)) return true; } break; @@ -7601,7 +7612,7 @@ s390_function_arg_float (enum machine_mode mode, tree type) /* No type info available for some library calls ... */ if (!type) - return mode == SFmode || mode == DFmode; + return mode == SFmode || mode == DFmode || mode == SDmode || mode == DDmode; /* The ABI says that record types with a single member are treated just like that member would be. */ @@ -7643,7 +7654,7 @@ s390_function_arg_integer (enum machine_mode mode, tree type) /* No type info available for some library calls ... */ if (!type) return GET_MODE_CLASS (mode) == MODE_INT - || (TARGET_SOFT_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT); + || (TARGET_SOFT_FLOAT && SCALAR_FLOAT_MODE_P (mode)); /* We accept small integral (and similar) types. */ if (INTEGRAL_TYPE_P (type) @@ -7805,11 +7816,10 @@ s390_function_value (tree type, enum machine_mode mode) mode = promote_mode (type, TYPE_MODE (type), &unsignedp, 1); } - gcc_assert (GET_MODE_CLASS (mode) == MODE_INT - || GET_MODE_CLASS (mode) == MODE_FLOAT); + gcc_assert (GET_MODE_CLASS (mode) == MODE_INT || SCALAR_FLOAT_MODE_P (mode)); gcc_assert (GET_MODE_SIZE (mode) <= 8); - if (TARGET_HARD_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT) + if (TARGET_HARD_FLOAT && SCALAR_FLOAT_MODE_P (mode)) return gen_rtx_REG (mode, 16); else return gen_rtx_REG (mode, 2); @@ -9303,6 +9313,9 @@ s390_reorg (void) #define TARGET_MANGLE_FUNDAMENTAL_TYPE s390_mangle_fundamental_type #endif +#undef TARGET_SCALAR_MODE_SUPPORTED_P +#define TARGET_SCALAR_MODE_SUPPORTED_P s390_scalar_mode_supported_p + struct gcc_target targetm = TARGET_INITIALIZER; #include "gt-s390.h" |