RE: [PATCH v1] RISC-V: Bugfix for scalar move with merged operand

2023-09-18 Thread Li, Pan2 via Gcc-patches
Committed, thanks Jeff and Robin. Pan -Original Message- From: Jeff Law Sent: Tuesday, September 19, 2023 1:44 AM To: Robin Dapp ; Li, Pan2 ; gcc-patches@gcc.gnu.org Cc: juzhe.zh...@rivai.ai; Wang, Yanzhang ; kito.ch...@gmail.com Subject: Re: [PATCH v1] RISC-V: Bugfix for scalar move

Re: [PATCH v1] RISC-V: Bugfix for scalar move with merged operand

2023-09-18 Thread Jeff Law via Gcc-patches
On 9/18/23 04:00, Robin Dapp wrote: I must be missing something. Doesn't insn 10 broadcast the immediate 0x2 to both elements of r142?!? What am I missing? It is indeed a bit misleading. The difference is in the mask which is not displayed in the short form. So we actually use a vec_dup f

RE: [PATCH v1] RISC-V: Bugfix for scalar move with merged operand

2023-09-18 Thread Li, Pan2 via Gcc-patches
ubject: Re: [PATCH v1] RISC-V: Bugfix for scalar move with merged operand > I must be missing something. Doesn't insn 10 broadcast the immediate > 0x2 to both elements of r142?!? What am I missing? It is indeed a bit misleading. The difference is in the mask which is not displayed in t

Re: [PATCH v1] RISC-V: Bugfix for scalar move with merged operand

2023-09-18 Thread Robin Dapp via Gcc-patches
> I must be missing something. Doesn't insn 10 broadcast the immediate > 0x2 to both elements of r142?!? What am I missing? It is indeed a bit misleading. The difference is in the mask which is not displayed in the short form. So we actually use a vec_dup for a single-element move, essentially

RE: [PATCH v1] RISC-V: Bugfix for scalar move with merged operand

2023-09-17 Thread Li, Pan2 via Gcc-patches
eptember 17, 2023 11:53 PM To: Li, Pan2 ; gcc-patches@gcc.gnu.org Cc: juzhe.zh...@rivai.ai; Wang, Yanzhang ; kito.ch...@gmail.com; rdapp@gmail.com Subject: Re: [PATCH v1] RISC-V: Bugfix for scalar move with merged operand On 9/17/23 01:42, Pan Li via Gcc-patches wrote: > From: Pan Li &g

Re: [PATCH v1] RISC-V: Bugfix for scalar move with merged operand

2023-09-17 Thread Jeff Law via Gcc-patches
On 9/17/23 01:42, Pan Li via Gcc-patches wrote: From: Pan Li Given below example for VLS mode void test (vl_t *u) { vl_t t; long long *p = (long long *)&t; p[0] = p[1] = 2; *u = t; } The vec_set will simplify the insn to vmv.s.x when index is 0, without merged operand. That

[PATCH v1] RISC-V: Bugfix for scalar move with merged operand

2023-09-17 Thread Pan Li via Gcc-patches
From: Pan Li Given below example for VLS mode void test (vl_t *u) { vl_t t; long long *p = (long long *)&t; p[0] = p[1] = 2; *u = t; } The vec_set will simplify the insn to vmv.s.x when index is 0, without merged operand. That will result in some problems in DCE, aka: 1: 137[DI] = a