From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1285) id 5165B3856DC0; Fri, 21 Oct 2022 14:10:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5165B3856DC0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666361418; bh=r1dXlP+tL/rA8Z5mVa49FwmnaIRss272zwzp3QZxN44=; h=From:To:Subject:Date:From; b=pwNYRa1rel9ekdBGnWdrD3wOPdQ9u96IAXScNN00PL9+E4ej5Dmt2bX/jYRt/+clk cw703R8OkXYAiIramHF0GOxxzXMfJxsDyn0X1eCf00SRnog/A7eFNTKtzQh86UHEZq ThEPwj2rEN+0nPVD20Eszvqzt57hJesLGsqZjGIQ= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Eric Botcazou To: gcc-cvs@gcc.gnu.org Subject: [gcc r10-11052] Fix VCOND expansion X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/releases/gcc-10 X-Git-Oldrev: 382201fea8d422108b2b038716fb6469c2c020f9 X-Git-Newrev: 5076eefe23b96279e34351a2a044858bae3251ae Message-Id: <20221021141018.5165B3856DC0@sourceware.org> Date: Fri, 21 Oct 2022 14:10:18 +0000 (GMT) List-Id: https://gcc.gnu.org/g:5076eefe23b96279e34351a2a044858bae3251ae commit r10-11052-g5076eefe23b96279e34351a2a044858bae3251ae Author: Eric Botcazou Date: Fri Oct 21 15:46:37 2022 +0200 Fix VCOND expansion Instead of only allowing the signed optab to provide EQ/NE compares, we allow both here since there seems to be no documented canonicalization. gcc/ PR target/107336 * optabs.c (expand_vec_cond_expr): Query both VCOND and VCONDU for EQ and NE. Diff: --- gcc/optabs.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gcc/optabs.c b/gcc/optabs.c index 64f23d2c293..93f99423727 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -5902,6 +5902,14 @@ expand_vec_cond_expr (tree vec_cond_type, tree op0, tree op1, tree op2, GET_MODE_NUNITS (cmp_op_mode))); icode = get_vcond_icode (mode, cmp_op_mode, unsignedp); + /* Some targets do not have vcondeq and only vcond with NE/EQ + but not vcondu, so make sure to also try vcond here as + vcond_icode_p would canonicalize the optab query to. */ + if (icode == CODE_FOR_nothing + && (tcode == NE_EXPR || tcode == EQ_EXPR) + && ((icode = get_vcond_icode (mode, cmp_op_mode, !unsignedp)) + != CODE_FOR_nothing)) + unsignedp = !unsignedp; if (icode == CODE_FOR_nothing) { if (tcode == LT_EXPR