[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
This commit is contained in:
Richard Sandiford 2019-10-23 10:31:01 +00:00 committed by Richard Sandiford
parent 6bd7e70695
commit d7814449f2
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2019-10-23 Richard Sandiford <richard.sandiford@arm.com>
* config/aarch64/aarch64.c (aarch64_emit_approx_sqrt): Use
int_mode_for_mode rather than mode_for_int_vector for scalars.
2019-10-23 Richard Biener <rguenther@suse.de>
PR tree-optimization/92179

View File

@ -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