summaryrefslogtreecommitdiff
path: root/gcc/config/sparc
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2017-09-05 19:57:18 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2017-09-05 19:57:18 +0000
commitef379746656d7c1de0ac45d5d7df89f026aa396e (patch)
treed9340114f5023e3bd3cdef8624f2ae51f4132ca2 /gcc/config/sparc
parent98ec37cffe214b7592c32d7efa3dcc575ec07e54 (diff)
downloadgcc-ef379746656d7c1de0ac45d5d7df89f026aa396e.tar.gz
Make mode_for_size return an opt_mode
...to make it consistent with int_mode_for_size etc. require () seems like the right choice in replace_reg_with_saved_mem because we use the chosen mode for saving and restoring registers, which cannot be done in BLKmode. Similarly require () seems like the right choice in calls related to secondary memory reloads (the ones in config/, and in get_secondary_mem) because the reload must always have a defined mode, which e.g. determines the size of the slot. We can use require () in simplify_subreg_concatn and assemble_integer because it isn't meaningful to create a subreg with BLKmode (for one thing, we couldn't tell then whether it was partial, paradoxical, etc.). make_fract_type and make_accum_type must find a mode because that's what distinguishes accumulator FIXED_POINT_TYPEs from fractional FIXED_POINT_TYPEs. 2017-09-05 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * machmode.h (opt_machine_mode): New type. (opt_mode<T>): Allow construction from anything that can be converted to a T. (is_a, as_a, dyn_cast): Add overloads for opt_mode. (mode_for_size): Return an opt_machine_mode. * stor-layout.c (mode_for_size): Likewise. (mode_for_size_tree): Update call accordingly. (bitwise_mode_for_mode): Likewise. (make_fract_type): Likewise. (make_accum_type): Likewise. * caller-save.c (replace_reg_with_saved_mem): Update call accordingly. * config/alpha/alpha.h (SECONDARY_MEMORY_NEEDED_MODE): Likewise. * config/i386/i386.h (SECONDARY_MEMORY_NEEDED_MODE): Likewise. * config/s390/s390.h (SECONDARY_MEMORY_NEEDED_MODE): Likewise. * config/sparc/sparc.h (SECONDARY_MEMORY_NEEDED_MODE): Likewise. * expmed.c (extract_bit_field_1): Likewise. * reload.c (get_secondary_mem): Likewise. * varasm.c (assemble_integer): Likewise. * lower-subreg.c (simplify_subreg_concatn): Likewise. Move early-out. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@251728 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/sparc')
-rw-r--r--gcc/config/sparc/sparc.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index 36f7667100e..3c71a3fe156 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -1077,13 +1077,13 @@ extern char leaf_reg_remap[];
/* Get_secondary_mem widens its argument to BITS_PER_WORD which loses on v9
because the movsi and movsf patterns don't handle r/f moves.
For v8 we copy the default definition. */
-#define SECONDARY_MEMORY_NEEDED_MODE(MODE) \
- (TARGET_ARCH64 \
- ? (GET_MODE_BITSIZE (MODE) < 32 \
- ? mode_for_size (32, GET_MODE_CLASS (MODE), 0) \
- : MODE) \
- : (GET_MODE_BITSIZE (MODE) < BITS_PER_WORD \
- ? mode_for_size (BITS_PER_WORD, GET_MODE_CLASS (MODE), 0) \
+#define SECONDARY_MEMORY_NEEDED_MODE(MODE) \
+ (TARGET_ARCH64 \
+ ? (GET_MODE_BITSIZE (MODE) < 32 \
+ ? mode_for_size (32, GET_MODE_CLASS (MODE), 0).require () \
+ : MODE) \
+ : (GET_MODE_BITSIZE (MODE) < BITS_PER_WORD \
+ ? mode_for_size (BITS_PER_WORD, GET_MODE_CLASS (MODE), 0).require () \
: MODE))
/* Return the maximum number of consecutive registers