From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id 136F03858D20 for ; Thu, 29 Dec 2022 12:23:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 136F03858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ventanamicro.com Received: by mail-wr1-x434.google.com with SMTP id bk16so4040222wrb.11 for ; Thu, 29 Dec 2022 04:23:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=DHVjm1JtrHWsd/n6GEojeN2zxUY+K8SsCZzKkjL9/0c=; b=Q3lNpcR4iqWHLuf4Kg8Yj2psffehZxODmr0a2h4k5y1oG0IfQ0OVSJxH9mnGmdm6py /1zWa2ucnaIxMR3l6alHwH2R3hJLFasJqLARpsyg6jgrhJ5g00zFY9i/hg0/GM7SwJlm kSjOR2ydW8Z9i/En0WMvp0wih+bbkwmVSMiwo2IGCJwF5h4gKsGmdvM1wjOHW6vDloPY DvAx3fH88qe1aAHq0kyqj4fTv3VQapyfLaOFpQ36QEmU0rvZzrY3Oner7Qz7ah3kZkSS iKBaRZuUSC5zgmukh/Kvbngd6XZtxuBozHuPCbdip26EXQk99HzT2rgZBtMonrD269UC thvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DHVjm1JtrHWsd/n6GEojeN2zxUY+K8SsCZzKkjL9/0c=; b=ThdtlS5nm+YqT1pq/6fSn9BEL4wA+MivPVjM6NhfRUgX6QzXM7mUTHRs/RwbZt/elH 7BdHO0uxqSHOgw6ZRY3284jPbNDwYRmNTjDwBvQieQK/Rt52habBWCBmgCClJuohbJRZ Me4GEokbKAghmLHqGGnQfMZGcFzSNYqzkV0oL/6l1ogz6IkKYwvUq/uv+uA6geawSBlC gNWZ4Se2UctgceUpo2DyBLk3LuEjmvWlhSzNKdPkBSaqHQm1DaLGLHInyx3YvQgu16Ze Q5XXCaArXqp9XTZVtCso0WIIlvmG7qGUUzuAJH30AUTCtsjv7JjI8Nabq1a07I+fejvT OvWg== X-Gm-Message-State: AFqh2kqx88Q/Qf1fNOmpN3zkgXUWJAUh8HhmGE++lEzT233M9VhBvdvV xlvADrHp+b2yN/Bbwjw3jtcOygwX0y5BOIbzbgFrsQ== X-Google-Smtp-Source: AMrXdXvoGSy25p1HH5s5nwQ3nu7g1UrrGulFWNcw0DPaM1bswTzQgzJF7QNiEkeQkHqRLvzlwghhvr1P29zCCyhj8Wg= X-Received: by 2002:a5d:4524:0:b0:278:29ac:f8a2 with SMTP id j4-20020a5d4524000000b0027829acf8a2mr527846wra.274.1672316625815; Thu, 29 Dec 2022 04:23:45 -0800 (PST) MIME-Version: 1.0 References: <20221228181817.193462-1-rzinsly@ventanamicro.com> <957c0039-9db1-ff1f-4654-27f448607ff2@gmail.com> In-Reply-To: <957c0039-9db1-ff1f-4654-27f448607ff2@gmail.com> From: Raphael Zinsly Date: Thu, 29 Dec 2022 09:23:29 -0300 Message-ID: Subject: Re: [PATCH] RISC-V: Optimize min/max with SImode sources on 64-bit To: Jeff Law Cc: gcc-patches@gcc.gnu.org, philipp.tomsich@vrull.eu Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, Dec 28, 2022 at 10:36 PM Jeff Law wrote: > > > > On 12/28/22 11:18, Raphael Moreira Zinsly wrote: > > The Zbb min/max pattern was not matching 32-bit sources when > > compiling for 64-bit. > > This patch separates the pattern into SImode and DImode, and > > use a define_expand to handle SImode on 64-bit. > > zbb-min-max-02.c generates different code as a result of the new > > expander. The resulting code is as efficient as the old code. > > Furthermore, the special sh1add pattern that appeared in > > zbb-min-max-02.c is tested by the zba-shNadd-* tests. > > > > gcc/ChangeLog: > > > > * config/riscv/bitmanip.md > > (3): Divide pattern into > > si3_insn and di3. > > (si3): Handle SImode sources on > > TARGET_64BIT. > > > > gcc/testsuite: > > > > * gcc.target/riscv/zbb-abs.c: New test. > > * gcc.target/riscv/zbb-min-max-02.c: Addapt the > > expected output. > So we need to do a bit of x86 debugging. > > Given the regressions below on the x86 testsuite, we should assume there > may be other targets where the optimization might result in testsuite > regressions. Thanks for checking it! > The good news is we can can use my upstream GCC tester to help identify > some of these cases. So I'll put the simplify-rtx change into my tester > and see what pops out overnight on the embedded targets. > > You're also missing a ChangeLog entry for the simplify-rtx change. > Sorry I didn't catch that sooner. There is no simplify-rtx change in this patch, I think you may be mixing my patches ;-) -- Raphael Moreira Zinsly