aboutsummaryrefslogtreecommitdiff
path: root/gcc/machmode.h
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-09-05 19:57:09 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-09-05 19:57:09 +0000
commit7773dca7d22dad2a9e6d2385584411308913ab1b (patch)
tree9279a37b868d19fa66cea7d4844d640febbd9883 /gcc/machmode.h
parentf4b316470bf7cccab22fbb97d1b6c541fcfc2855 (diff)
downloadgcc-7773dca7d22dad2a9e6d2385584411308913ab1b.zip
gcc-7773dca7d22dad2a9e6d2385584411308913ab1b.tar.gz
gcc-7773dca7d22dad2a9e6d2385584411308913ab1b.tar.bz2
(decimal_)float_mode_for_size in real.h
This patch makes the binary float macros in real.h use float_mode_for_size and adds a corresponding decimal_float_mode_for_size for the decimal macros. 2017-09-05 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * machmode.h (decimal_float_mode_for_size): New function. * real.h (REAL_VALUE_TO_TARGET_LONG_DOUBLE): Use float_mode_for_size. (REAL_VALUE_TO_TARGET_DOUBLE): Likewise. (REAL_VALUE_TO_TARGET_SINGLE): Likewise. (REAL_VALUE_TO_TARGET_DECIMAL128): Use decimal_float_mode_for_size. (REAL_VALUE_TO_TARGET_DECIMAL64): Likewise. (REAL_VALUE_TO_TARGET_DECIMAL32): Likewise. From-SVN: r251727
Diffstat (limited to 'gcc/machmode.h')
-rw-r--r--gcc/machmode.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/machmode.h b/gcc/machmode.h
index b331f07..d8344a9 100644
--- a/gcc/machmode.h
+++ b/gcc/machmode.h
@@ -652,6 +652,15 @@ float_mode_for_size (unsigned int size)
return dyn_cast <scalar_float_mode> (mode_for_size (size, MODE_FLOAT, 0));
}
+/* Likewise for MODE_DECIMAL_FLOAT. */
+
+inline opt_scalar_float_mode
+decimal_float_mode_for_size (unsigned int size)
+{
+ return dyn_cast <scalar_float_mode>
+ (mode_for_size (size, MODE_DECIMAL_FLOAT, 0));
+}
+
/* Similar to mode_for_size, but find the smallest mode for a given width. */
extern machine_mode smallest_mode_for_size (unsigned int, enum mode_class);