diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-08-30 11:19:54 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-08-30 11:19:54 +0000 |
commit | 3bd8f4816fe24ef00641cde33dd13155b83db6e1 (patch) | |
tree | 15a160b63509849b48c344d86076730d54907975 /gcc/omp-expand.c | |
parent | 79052416a684cde121a3f70619c2eb12371be67a (diff) | |
download | gcc-3bd8f4816fe24ef00641cde33dd13155b83db6e1.zip gcc-3bd8f4816fe24ef00641cde33dd13155b83db6e1.tar.gz gcc-3bd8f4816fe24ef00641cde33dd13155b83db6e1.tar.bz2 |
[68/77] Use scalar_mode for is_int_mode/is_float_mode pairs
This patch uses scalar_mode for code that operates only on MODE_INT
and MODE_FLOAT.
2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* omp-expand.c (expand_omp_atomic): Use is_int_mode, is_float_mode
and scalar_mode.
* tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Likewise.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r251519
Diffstat (limited to 'gcc/omp-expand.c')
-rw-r--r-- | gcc/omp-expand.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c index ac83ba1..7e27ae0 100644 --- a/gcc/omp-expand.c +++ b/gcc/omp-expand.c @@ -6739,17 +6739,18 @@ expand_omp_atomic (struct omp_region *region) if (exact_log2 (align) >= index) { /* Atomic load. */ + scalar_mode smode; if (loaded_val == stored_val - && (GET_MODE_CLASS (TYPE_MODE (type)) == MODE_INT - || GET_MODE_CLASS (TYPE_MODE (type)) == MODE_FLOAT) - && GET_MODE_BITSIZE (TYPE_MODE (type)) <= BITS_PER_WORD + && (is_int_mode (TYPE_MODE (type), &smode) + || is_float_mode (TYPE_MODE (type), &smode)) + && GET_MODE_BITSIZE (smode) <= BITS_PER_WORD && expand_omp_atomic_load (load_bb, addr, loaded_val, index)) return; /* Atomic store. */ - if ((GET_MODE_CLASS (TYPE_MODE (type)) == MODE_INT - || GET_MODE_CLASS (TYPE_MODE (type)) == MODE_FLOAT) - && GET_MODE_BITSIZE (TYPE_MODE (type)) <= BITS_PER_WORD + if ((is_int_mode (TYPE_MODE (type), &smode) + || is_float_mode (TYPE_MODE (type), &smode)) + && GET_MODE_BITSIZE (smode) <= BITS_PER_WORD && store_bb == single_succ (load_bb) && first_stmt (store_bb) == store && expand_omp_atomic_store (load_bb, addr, loaded_val, |