public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kito Cheng <kito.cheng@gmail.com>
To: "juzhe.zhong@rivai.ai" <juzhe.zhong@rivai.ai>
Cc: jeffreyalaw <jeffreyalaw@gmail.com>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: Re: [PATCH] RISC-V: Fix bugs of ternary integer and floating-point ternary intrinsics.
Date: Thu, 23 Mar 2023 11:28:59 +0800	[thread overview]
Message-ID: <CA+yXCZBEz4sewfV4=Rt9tsvB=-TjctFY=cdtrLZdgfQR6xoJYg@mail.gmail.com> (raw)
In-Reply-To: <6044423573881F46+202303200851012766431@rivai.ai>

committed as https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=0e2715176df3787d1470d7b9bde26b1b5e16e1e2

On Mon, Mar 20, 2023 at 8:51 AM juzhe.zhong@rivai.ai
<juzhe.zhong@rivai.ai> wrote:
>
> The last patch. Kito is still keep testing with pressure tests.
>
>
>
> juzhe.zhong@rivai.ai
>
> From: Jeff Law
> Date: 2023-03-20 01:03
> To: juzhe.zhong; gcc-patches
> CC: kito.cheng
> Subject: Re: [PATCH] RISC-V: Fix bugs of ternary integer and floating-point ternary intrinsics.
>
>
> On 3/15/23 00:37, juzhe.zhong@rivai.ai wrote:
> > From: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
> >
> > Fix bugs of ternary intrinsic pattern:
> >
> > interger:
> > vnmsac.vv vd, vs1, vs2, vm    # vd[i] = -(vs1[i] * vs2[i]) + vd[i]  (minus op3 (mult op1 op2))
> > vnmsac.vx vd, rs1, vs2, vm    # vd[i] = -(x[rs1] * vs2[i]) + vd[i]   (minus op3 (mult op1 op2))
> >
> > floating-point:
> > # FP multiply-accumulate, overwrites addend
> > vfmacc.vv vd, vs1, vs2, vm    # vd[i] = +(vs1[i] * vs2[i]) + vd[i] (plus (mult (op1 op2)) op3)
> > vfmacc.vf vd, rs1, vs2, vm    # vd[i] = +(f[rs1] * vs2[i]) + vd[i] (plus (mult (op1 op2)) op3)
> >
> >
> > # FP negate-(multiply-accumulate), overwrites subtrahend
> > vfnmacc.vv vd, vs1, vs2, vm   # vd[i] = -(vs1[i] * vs2[i]) - vd[i] (minus (neg (mult (op1 op2))) op3))
> > vfnmacc.vf vd, rs1, vs2, vm   # vd[i] = -(f[rs1] * vs2[i]) - vd[i] (minus (neg (mult (op1 op2)) op3))
> > # FP multiply-subtract-accumulator, overwrites subtrahend
> > vfmsac.vv vd, vs1, vs2, vm    # vd[i] = +(vs1[i] * vs2[i]) - vd[i] (minus (mult (op1 op2)) op3)
> > vfmsac.vf vd, rs1, vs2, vm    # vd[i] = +(f[rs1] * vs2[i]) - vd[i] (minus (mult (op1 op2)) op3)
> >
> > # FP negate-(multiply-subtract-accumulator), overwrites minuend
> > vfnmsac.vv vd, vs1, vs2, vm   # vd[i] = -(vs1[i] * vs2[i]) + vd[i] (plus (neg:(mult (op1 op2))) op3)
> > vfnmsac.vf vd, rs1, vs2, vm   # vd[i] = -(f[rs1] * vs2[i]) + vd[i] (plus (neg:(mult (op1 op2))) op3)
> >
> > gcc/ChangeLog:
> >
> >          * config/riscv/riscv-vector-builtins-bases.cc: Fix ternary bug.
> >          * config/riscv/vector-iterators.md (nmsac): Ditto.
> >          (nmsub): Ditto.
> >          (msac): Ditto.
> >          (msub): Ditto.
> >          (nmadd): Ditto.
> >          (nmacc): Ditto.
> >          * config/riscv/vector.md (@pred_mul_<optab><mode>): Ditto.
> >          (@pred_mul_plus<mode>): Ditto.
> >          (*pred_madd<mode>): Ditto.
> >          (*pred_macc<mode>): Ditto.
> >          (*pred_mul_plus<mode>): Ditto.
> >          (@pred_mul_plus<mode>_scalar): Ditto.
> >          (*pred_madd<mode>_scalar): Ditto.
> >          (*pred_macc<mode>_scalar): Ditto.
> >          (*pred_mul_plus<mode>_scalar): Ditto.
> >          (*pred_madd<mode>_extended_scalar): Ditto.
> >          (*pred_macc<mode>_extended_scalar): Ditto.
> >          (*pred_mul_plus<mode>_extended_scalar): Ditto.
> >          (@pred_minus_mul<mode>): Ditto.
> >          (*pred_<madd_nmsub><mode>): Ditto.
> >          (*pred_nmsub<mode>): Ditto.
> >          (*pred_<macc_nmsac><mode>): Ditto.
> >          (*pred_nmsac<mode>): Ditto.
> >          (*pred_mul_<optab><mode>): Ditto.
> >          (*pred_minus_mul<mode>): Ditto.
> >          (@pred_mul_<optab><mode>_scalar): Ditto.
> >          (@pred_minus_mul<mode>_scalar): Ditto.
> >          (*pred_<madd_nmsub><mode>_scalar): Ditto.
> >          (*pred_nmsub<mode>_scalar): Ditto.
> >          (*pred_<macc_nmsac><mode>_scalar): Ditto.
> >          (*pred_nmsac<mode>_scalar): Ditto.
> >          (*pred_mul_<optab><mode>_scalar): Ditto.
> >          (*pred_minus_mul<mode>_scalar): Ditto.
> >          (*pred_<madd_nmsub><mode>_extended_scalar): Ditto.
> >          (*pred_nmsub<mode>_extended_scalar): Ditto.
> >          (*pred_<macc_nmsac><mode>_extended_scalar): Ditto.
> >          (*pred_nmsac<mode>_extended_scalar): Ditto.
> >          (*pred_mul_<optab><mode>_extended_scalar): Ditto.
> >          (*pred_minus_mul<mode>_extended_scalar): Ditto.
> >          (*pred_<madd_msub><mode>): Ditto.
> >          (*pred_<macc_msac><mode>): Ditto.
> >          (*pred_<madd_msub><mode>_scalar): Ditto.
> >          (*pred_<macc_msac><mode>_scalar): Ditto.
> >          (@pred_neg_mul_<optab><mode>): Ditto.
> >          (@pred_mul_neg_<optab><mode>): Ditto.
> >          (*pred_<nmadd_msub><mode>): Ditto.
> >          (*pred_<nmsub_nmadd><mode>): Ditto.
> >          (*pred_<nmacc_msac><mode>): Ditto.
> >          (*pred_<nmsac_nmacc><mode>): Ditto.
> >          (*pred_neg_mul_<optab><mode>): Ditto.
> >          (*pred_mul_neg_<optab><mode>): Ditto.
> >          (@pred_neg_mul_<optab><mode>_scalar): Ditto.
> >          (@pred_mul_neg_<optab><mode>_scalar): Ditto.
> >          (*pred_<nmadd_msub><mode>_scalar): Ditto.
> >          (*pred_<nmsub_nmadd><mode>_scalar): Ditto.
> >          (*pred_<nmacc_msac><mode>_scalar): Ditto.
> >          (*pred_<nmsac_nmacc><mode>_scalar): Ditto.
> >          (*pred_neg_mul_<optab><mode>_scalar): Ditto.
> >          (*pred_mul_neg_<optab><mode>_scalar): Ditto.
> >          (@pred_widen_neg_mul_<optab><mode>): Ditto.
> >          (@pred_widen_mul_neg_<optab><mode>): Ditto.
> >          (@pred_widen_neg_mul_<optab><mode>_scalar): Ditto.
> >          (@pred_widen_mul_neg_<optab><mode>_scalar): Ditto.
> It looks like you've got two patches that are almost 100% identical
> except for a few bits in vector.md.  Which is the correct version?
>
> One is dated 3/14/23 00:30 the other 3/15/23: 04:07.
>
> jeff
>

      reply	other threads:[~2023-03-23  3:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15  6:37 juzhe.zhong
2023-03-19 17:03 ` Jeff Law
2023-03-20  0:51   ` juzhe.zhong
2023-03-23  3:28     ` Kito Cheng [this message]

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='CA+yXCZBEz4sewfV4=Rt9tsvB=-TjctFY=cdtrLZdgfQR6xoJYg@mail.gmail.com' \
    --to=kito.cheng@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=juzhe.zhong@rivai.ai \
    /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).