diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2019-10-23 10:31:01 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2019-10-23 10:31:01 +0000 |
commit | d7814449f229cecdee48afe381519a61ea7e3378 (patch) | |
tree | 2c35e34c2ea6cae6ca23864a4f8db36d5882824d /gcc/config | |
parent | 6bd7e7069504668eb37b2b9c976f4f0942666ef2 (diff) | |
download | gcc-d7814449f229cecdee48afe381519a61ea7e3378.zip gcc-d7814449f229cecdee48afe381519a61ea7e3378.tar.gz gcc-d7814449f229cecdee48afe381519a61ea7e3378.tar.bz2 |
[AArch64] Don't apply mode_for_int_vector to scalars
aarch64_emit_approx_sqrt handles both vectors and scalars and was using
mode_for_int_vector even for the scalar case. Although that happened
to work, it isn't how mode_for_int_vector is supposed to be used.
2019-10-23 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* config/aarch64/aarch64.c (aarch64_emit_approx_sqrt): Use
int_mode_for_mode rather than mode_for_int_vector for scalars.
From-SVN: r277311
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 2e73f35..e439615 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -11828,7 +11828,9 @@ aarch64_emit_approx_sqrt (rtx dst, rtx src, bool recp) /* Caller assumes we cannot fail. */ gcc_assert (use_rsqrt_p (mode)); - machine_mode mmsk = mode_for_int_vector (mode).require (); + machine_mode mmsk = (VECTOR_MODE_P (mode) + ? mode_for_int_vector (mode).require () + : int_mode_for_mode (mode).require ()); rtx xmsk = gen_reg_rtx (mmsk); if (!recp) /* When calculating the approximate square root, compare the |