aboutsummaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-08-30 11:09:41 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-08-30 11:09:41 +0000
commit857c7b46875bdcf9d889543baad54977034d57ef (patch)
tree60a693fba5c631712da730e6ce07a8deda2af759 /gcc/emit-rtl.c
parentd16c828e7aa2a704d887b071864823fc1e39670f (diff)
downloadgcc-857c7b46875bdcf9d889543baad54977034d57ef.zip
gcc-857c7b46875bdcf9d889543baad54977034d57ef.tar.gz
gcc-857c7b46875bdcf9d889543baad54977034d57ef.tar.bz2
[11/77] Add a float_mode_for_size helper function
This provides a type-safe way to ask for a float mode and get it as a scalar_float_mode. 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * coretypes.h (opt_scalar_float_mode): New typedef. * machmode.h (float_mode_for_size): New function. * emit-rtl.c (double_mode): Delete. (init_emit_once): Use float_mode_for_size. * stor-layout.c (layout_type): Likewise. * gdbhooks.py (build_pretty_printer): Handle opt_scalar_float_mode. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251463
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 3856ac0..eaae009 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -72,7 +72,6 @@ struct target_rtl *this_target_rtl = &default_target_rtl;
machine_mode byte_mode; /* Mode whose width is BITS_PER_UNIT. */
machine_mode word_mode; /* Mode whose width is BITS_PER_WORD. */
-machine_mode double_mode; /* Mode whose width is DOUBLE_TYPE_SIZE. */
machine_mode ptr_mode; /* Mode whose width is POINTER_SIZE. */
/* Datastructures maintained for currently processed function in RTL form. */
@@ -5889,7 +5888,7 @@ init_emit_once (void)
{
int i;
machine_mode mode;
- machine_mode double_mode;
+ scalar_float_mode double_mode;
/* Initialize the CONST_INT, CONST_WIDE_INT, CONST_DOUBLE,
CONST_FIXED, and memory attribute hash tables. */
@@ -5933,7 +5932,7 @@ init_emit_once (void)
else
const_true_rtx = gen_rtx_CONST_INT (VOIDmode, STORE_FLAG_VALUE);
- double_mode = mode_for_size (DOUBLE_TYPE_SIZE, MODE_FLOAT, 0);
+ double_mode = float_mode_for_size (DOUBLE_TYPE_SIZE).require ();
real_from_integer (&dconst0, double_mode, 0, SIGNED);
real_from_integer (&dconst1, double_mode, 1, SIGNED);