public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Stubbs <ams@codesourcery.com>
To: Paul-Antoine Arras <pa@codesourcery.com>, <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] amdgcn: Add instruction patterns for conditional min/max operations
Date: Thu, 2 Mar 2023 17:18:11 +0000	[thread overview]
Message-ID: <9d103f4d-f11d-6705-8a3f-2d8644e10809@codesourcery.com> (raw)
In-Reply-To: <1f1f9f15-e12e-ec4e-7b74-ba7bf3b64449@codesourcery.com>

On 01/03/2023 16:56, Paul-Antoine Arras wrote:
> This patch introduces instruction patterns for conditional min and max
> operations (cond_{f|s|u}{max|min}) in the GCN machine description. It 
> also allows the exec register to be saved in SGPRs to avoid spilling to 
> memory.
> Tested on GCN3 Fiji gfx803.
> 
> OK for trunk?

Not quite yet, but it's only a few cosmetic issues, I think.

> +(define_insn_and_split "<expander><mode>3"
> +  [(set (match_operand:V_DI 0 "register_operand"      "=  v")
> +	(minmaxop:V_DI
> +	  (match_operand:V_DI 1 "gcn_alu_operand"     "%  v")
> +          (match_operand:V_DI 2 "gcn_alu_operand"     "   v")))
> +    (clobber (reg:DI VCC_REG))]

No need to make it commutative when the two operands have the same 
constraints. There's a few more instances of this later.

> +    if (<code> == smin || <code> == smax)
> +      emit_insn (gen_vec_cmp<mode>di (vcc, minp ? gen_rtx_LT (VOIDmode, 0, 0) :
> +                                    gen_rtx_GT (VOIDmode, 0, 0), operands[1], operands[2]));
> +    else
> +      emit_insn (gen_vec_cmp<mode>di (vcc, minp ? gen_rtx_LTU (VOIDmode, 0, 0) :
> +                                    gen_rtx_GTU (VOIDmode, 0, 0), operands[1], operands[2]));
> +

Long lines need to be wrapped, here and elsewhere.

Andrew

  reply	other threads:[~2023-03-02 17:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-01 16:56 Paul-Antoine Arras
2023-03-02 17:18 ` Andrew Stubbs [this message]
2023-03-03 17:05   ` Paul-Antoine Arras
2023-03-06 13:27     ` Andrew Stubbs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d103f4d-f11d-6705-8a3f-2d8644e10809@codesourcery.com \
    --to=ams@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=pa@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).