[PATCH] Bug 111071: fix the subr with -1 to not due to the simplify.

2023-08-29 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang gcc/testsuite/ChangeLog: * gcc.target/aarch64/sve/acle/asm/subr_s8.c: Modify subr with -1 to not. Signed-off-by: Yanzhang Wang --- Tested on my local arm environment and passed. Thanks Andrew Pinski's comment the code is the same with that.

[PATCH] RISC-V: Support simplify (-1-x) for vector.

2023-08-16 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang The pattern is enabled for scalar but not for vector. The patch try to make it consistent and will convert below code, shortcut_for_riscv_vrsub_case_1_32: vl1re32.v v1,0(a1) vsetvli zero,a2,e32,m1,ta,ma vrsub.viv1,v1,-1 vs1r.v

[PATCH v2] RISC-V: convert the mulh with 0 to mov 0 to the reg.

2023-07-28 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang This patch will optimize the below mulh example, vint32m1_t shortcut_for_riscv_vmulh_case_0(vint32m1_t v1, size_t vl) { return __riscv_vmulh_vx_i32m1(v1, 0, vl); } from mulh pattern vsetvli zero, a2, e32, m1, ta, ma vmulh.vx v24, v24, zero vs1r.vv24, 0(a0) to

[PATCH v3] RISCV: Add -m(no)-omit-leaf-frame-pointer support.

2023-07-18 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang gcc/ChangeLog: * config/riscv/riscv.cc (riscv_save_reg_p): Save ra for leaf when enabling -mno-omit-leaf-frame-pointer (riscv_option_override): Override omit-frame-pointer. (riscv_frame_pointer_required): Save s0 for non-leaf function

[PATCH] RISCV: Add -m(no)-omit-leaf-frame-pointer support.

2023-07-13 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang gcc/ChangeLog: * config/riscv/riscv.cc (riscv_save_reg_p): Save ra for leaf when enabling -mno-omit-leaf-frame-pointer (riscv_option_override): Override omit-frame-pointer. (riscv_frame_pointer_required): Save s0 for non-leaf function

[PATCH] RISC-V: convert the mulh with 0 to mov 0 to the reg.

2023-06-21 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang This patch will optimize the below mulh example, vint32m1_t shortcut_for_riscv_vmulh_case_0(vint32m1_t v1, size_t vl) { return __riscv_vmulh_vx_i32m1(v1, 0, vl); } from mulh pattern vsetvli zero, a2, e32, m1, ta, ma vmulh.vx v24, v24, zero vs1r.vv24, 0(a0) to

[PATCH v6] RISC-V: Add vector psabi checking.

2023-06-12 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang This patch adds support to check function's argument or return is vector type and throw warning if yes. There're two exceptions, - The vector_size attribute. - The intrinsic functions. Some cases that need to add -Wno-psabi to ignore the warning. gcc/ChangeLog:

[PATCH v5] RISC-V: Add vector psabi checking.

2023-06-12 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang This patch adds support to check function's argument or return is vector type and throw warning if yes. There're two exceptions, - The vector_size attribute. - The intrinsic functions. gcc/ChangeLog: * config/riscv/riscv-protos.h (riscv_init_cumulative_args):

[PATCH v4] RISC-V: Add vector psabi checking.

2023-06-09 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang This patch adds support to check function's argument or return is vector type and throw warning if yes. There're two exceptions, - The vector_size attribute. - The intrinsic functions. gcc/ChangeLog: * config/riscv/riscv-protos.h (riscv_init_cumulative_args):

[PATCH] RISCV: Add -m(no)-omit-leaf-frame-pointer support.

2023-06-02 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang gcc/ChangeLog: * config/riscv/riscv.cc (riscv_save_reg_p): Save ra for leaf when enabling -mno-omit-leaf-frame-pointer (riscv_option_override): Override omit-frame-pointer. (riscv_frame_pointer_required): Save s0 for non-leaf function

[PATCH v3] RISCV: Add vector psabi checking.

2023-04-26 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang This patch adds support to check function's argument or return is vector type and throw warning if yes. gcc/ChangeLog: * config/riscv/riscv.cc: (riscv_scalable_vector_type_p): Determine whether the type is scalable vector. (riscv_arg_has_vector):

[PATCH v2] RISCV: Add vector psabi checking.

2023-04-26 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang This patch adds support to check function's argument or return is vector type and throw warning if yes. gcc/ChangeLog: * config/riscv/riscv.cc: (riscv_scalable_vector_type_p): Determine whether the type is scalable vector. (riscv_arg_has_vector):

[PATCH v2] RISC-V: ICE for vlmul_ext_v intrinsic API

2023-04-26 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang PR 109617 gcc/ChangeLog: * config/riscv/vector-iterators.md: Support VNx2HI and VNX4DI when MIN_VLEN >= 128. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/vlmul_ext-1.c: New test. Signed-off-by: Yanzhang Wang Co-authored-by: Pan Li ---

[PATCH] RISCV: Add vector psabi checking.

2023-04-26 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang This patch adds support to check function's argument or return is vector type and throw warning if yes. gcc/ChangeLog: * config/riscv/riscv.cc (riscv_scalable_vector_type_p): (riscv_arg_has_vector): (riscv_pass_in_vector_p):

[PATCH] RISC-V: ICE for vlmul_ext_v intrinsic API

2023-04-26 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang PR 109617 gcc/ChangeLog: * config/riscv/vector-iterators.md: gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/vlmul_ext-1.c: New test. Signed-off-by: Yanzhang Wang Co-authored-by: Pan Li --- gcc/config/riscv/vector-iterators.md

[PATCH v5] RISC-V: Fix regression of -fzero-call-used-regs=all

2023-04-11 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang This patch registers a riscv specific function to TARGET_ZERO_CALL_USED_REGS instead of default in targhooks.cc. It will clean gpr and vector relevant registers. PR 109104 gcc/ChangeLog: * config/riscv/riscv-protos.h (emit_hard_vlmax_vsetvl): *

[PATCH v4] RISC-V: Fix regression of -fzero-call-used-regs=all

2023-04-09 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang This patch registers a riscv specific function to TARGET_ZERO_CALL_USED_REGS instead of default in targhooks.cc. It will clean gpr and vector relevant registers. PR 109104 gcc/ChangeLog: * config/riscv/riscv-protos.h (emit_hard_vlmax_vsetvl): *

[PATCH v3] RISC-V: Fix regression of -fzero-call-used-regs=all

2023-04-07 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang This patch registers a riscv specific function to TARGET_ZERO_CALL_USED_REGS instead of default in targhooks.cc. It will clean gpr and vector relevant registers. PR 109104 gcc/ChangeLog: * config/riscv/riscv-protos.h (emit_hard_vlmax_vsetvl): *

[PATCH v2] RISC-V: Fix regression of -fzero-call-used-regs=all

2023-04-07 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang This patch registers a riscv specific function to TARGET_ZERO_CALL_USED_REGS instead of default in targhooks.cc. It will clean gpr and vector relevant registers. PR 109104 gcc/ChangeLog: * config/riscv/riscv-protos.h (GCC_RISCV_PROTOS_H):

[PATCH] RISC-V: Fix regression of -fzero-call-used-regs=all

2023-04-06 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang This patch registers a riscv specific function to TARGET_ZERO_CALL_USED_REGS instead of default in targhooks.cc. It will clean gpr and vector relevant registers. PR 109104 gcc/ChangeLog: * config/riscv/riscv-v.cc (default_zero_call_used_regs):