[9/77] Add SCALAR_FLOAT_TYPE_MODE
commit299dd9faedce15aa35cc99b8c3cb9eb942c149c0
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Aug 2017 11:09:27 +0000 (30 11:09 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Aug 2017 11:09:27 +0000 (30 11:09 +0000)
tree7128c82384620d1aa931e09c93420443dbee1554
parentca437bbe9f51d59f9eff311ff2256846192cf040
[9/77] Add SCALAR_FLOAT_TYPE_MODE

This patch adds a macro that extracts the TYPE_MODE and forcibly
converts it to a scalar_float_mode.  The forcible conversion
includes a gcc_checking_assert that the mode is a SCALAR_FLOAT_MODE_P.

This becomes important as more static type checking is added by
later patches.  It has the additional benefit of bypassing the
VECTOR_TYPE_P (...) ? vector_type_mode (...) : ... condition
in TYPE_MODE; in release builds the new macro is a simple
field access.

2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
    Alan Hayward  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
* tree.h (SCALAR_FLOAT_TYPE_MODE): New macro.
* builtins.c (expand_builtin_signbit): Use it instead of TYPE_MODE.
* fold-const.c (fold_convert_const_real_from_fixed): Likewise.
(native_encode_real): Likewise.
(native_interpret_real): Likewise.
* hsa-brig.c (emit_immediate_scalar_to_buffer): Likewise.
* tree-vrp.c (simplify_float_conversion_using_ranges): Likewise.

gcc/cp/
* mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
instead of TYPE_MODE.

gcc/fortran/
* target-memory.c (size_float): Use SCALAR_FLOAT_TYPE_MODE
instead of TYPE_MODE.

gcc/objc/
* objc-encoding.c (encode_type): Use SCALAR_FLOAT_TYPE_MODE
instead of TYPE_MODE.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@251460 138bc75d-0d04-0410-961f-82ee72b054a4
12 files changed:
gcc/ChangeLog
gcc/builtins.c
gcc/cp/ChangeLog
gcc/cp/mangle.c
gcc/fold-const.c
gcc/fortran/ChangeLog
gcc/fortran/target-memory.c
gcc/hsa-brig.c
gcc/objc/ChangeLog
gcc/objc/objc-encoding.c
gcc/tree-vrp.c
gcc/tree.h