Re: Re: [PATCH] RISC-V: Fix bugs of ternary integer and floating-point ternary intrinsics.

2023-03-22 Thread Kito Cheng via Gcc-patches
f 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.zh...@rivai.ai wrote: > > From: Ju-Zhe Zhong > >

Re: Re: [PATCH] RISC-V: Fix bugs of ternary integer and floating-point ternary intrinsics.

2023-03-19 Thread juzhe.zh...@rivai.ai
The last patch. Kito is still keep testing with pressure tests. juzhe.zh...@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

Re: [PATCH] RISC-V: Fix bugs of ternary integer and floating-point ternary intrinsics.

2023-03-19 Thread Jeff Law via Gcc-patches
On 3/15/23 00:37, juzhe.zh...@rivai.ai wrote: From: Ju-Zhe Zhong 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

[PATCH] RISC-V: Fix bugs of ternary integer and floating-point ternary intrinsics.

2023-03-14 Thread juzhe . zhong
From: Ju-Zhe Zhong 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-accu

[PATCH] RISC-V: Fix bugs of ternary integer and floating-point ternary intrinsics.

2023-03-14 Thread juzhe . zhong
From: Ju-Zhe Zhong 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-accu

Re: [PATCH] RISC-V: Fix bugs of ternary integer and floating-point ternary intrinsics.

2023-03-14 Thread Jeff Law via Gcc-patches
On 3/13/23 20:37, Kito Cheng via Gcc-patches wrote: IIRC the canonical form of (plus (op) (mult (op) (op))) is (plus (mult (op) (op) (op)), so using the first form might not friendly for the combine pass. You're correct. The other form shouldn't be used at all and should not appear in the M

Re: [PATCH] RISC-V: Fix bugs of ternary integer and floating-point ternary intrinsics.

2023-03-13 Thread Kito Cheng via Gcc-patches
IIRC the canonical form of (plus (op) (mult (op) (op))) is (plus (mult (op) (op) (op)), so using the first form might not friendly for the combine pass. On Tue, Mar 14, 2023 at 10:24 AM wrote: > > From: Ju-Zhe Zhong > > Co-authored-by: kito-cheng > Co-authored-by: kito-cheng > > This patch is

[PATCH] RISC-V: Fix bugs of ternary integer and floating-point ternary intrinsics.

2023-03-13 Thread juzhe . zhong
From: Ju-Zhe Zhong Co-authored-by: kito-cheng Co-authored-by: kito-cheng This patch is fixing the bugs reported by @kito. // vnmsub.vx vd, rs1, vs2, vm# vd[i] = -(x[rs1] * vd[i]) + vs2[i] // vd = -(vb * a) + vc //= -(3 * 1) + 10 //= 7 // GCC wrongly optmize this pattern