From: Jeff Law <jeffreyalaw@gmail.com>
To: juzhe.zhong@rivai.ai, gcc-patches@gcc.gnu.org
Cc: kito.cheng@gmail.com
Subject: Re: [PATCH] RISC-V: Fix bugs of ternary integer and floating-point ternary intrinsics.
Date: Sun, 19 Mar 2023 11:03:04 -0600 [thread overview]
Message-ID: <4d7cbf53-ef94-f504-07d7-be51ede40a03@gmail.com> (raw)
In-Reply-To: <20230315063746.166390-1-juzhe.zhong@rivai.ai>
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
next prev parent reply other threads:[~2023-03-19 17:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-15 6:37 juzhe.zhong
2023-03-19 17:03 ` Jeff Law [this message]
2023-03-20 0:51 ` juzhe.zhong
2023-03-23 3:28 ` Kito Cheng
-- strict thread matches above, loose matches on Subject: below --
2023-03-15 5:23 juzhe.zhong
2023-03-14 2:23 juzhe.zhong
2023-03-14 2:37 ` Kito Cheng
2023-03-14 14:50 ` Jeff Law
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=4d7cbf53-ef94-f504-07d7-be51ede40a03@gmail.com \
--to=jeffreyalaw@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=juzhe.zhong@rivai.ai \
--cc=kito.cheng@gmail.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).