* [committed][AArch64] Don't apply mode_for_int_vector to scalars
@ 2019-10-23 11:00 Richard Sandiford
0 siblings, 0 replies; only message in thread
From: Richard Sandiford @ 2019-10-23 11:00 UTC (permalink / raw)
To: gcc-patches
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.
Tested on aarch64-linux-gnu and applied as r277311.
Richard
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.
Index: gcc/config/aarch64/aarch64.c
===================================================================
--- gcc/config/aarch64/aarch64.c 2019-10-22 08:46:57.363355908 +0100
+++ gcc/config/aarch64/aarch64.c 2019-10-23 11:30:08.169740215 +0100
@@ -11828,7 +11828,9 @@ aarch64_emit_approx_sqrt (rtx dst, rtx s
/* 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-10-23 10:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-23 11:00 [committed][AArch64] Don't apply mode_for_int_vector to scalars Richard Sandiford
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).