From d7814449f229cecdee48afe381519a61ea7e3378 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Wed, 23 Oct 2019 10:31:01 +0000 Subject: [PATCH] [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 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 --- gcc/ChangeLog | 5 +++++ gcc/config/aarch64/aarch64.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cfc1bdceab9..c2253b9985e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-10-23 Richard Sandiford + + * 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 PR tree-optimization/92179 diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 2e73f3515bb..e439615664f 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 -- 2.30.2