This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed][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.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]