summaryrefslogtreecommitdiff
path: root/gcc/hsa-brig.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-08-30 11:09:27 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-08-30 11:09:27 +0000
commitb5f2d801b10c25ef32a80c03d6df8668920a593c (patch)
tree7128c82384620d1aa931e09c93420443dbee1554 /gcc/hsa-brig.c
parent3205ab28e639b69e5979f9d8336e2be75f681661 (diff)
[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. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251460
Diffstat (limited to 'gcc/hsa-brig.c')
-rw-r--r--gcc/hsa-brig.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/hsa-brig.c b/gcc/hsa-brig.c
index 0f6cac57776..d15ce261ed2 100644
--- a/gcc/hsa-brig.c
+++ b/gcc/hsa-brig.c
@@ -910,7 +910,7 @@ emit_immediate_scalar_to_buffer (tree value, char *data, unsigned need_len)
"operands");
return 2;
}
- unsigned int_len = GET_MODE_SIZE (TYPE_MODE (type));
+ unsigned int_len = GET_MODE_SIZE (SCALAR_FLOAT_TYPE_MODE (type));
/* There are always 32 bits in each long, no matter the size of
the hosts long. */
long tmp[6];