Re: [PATCH] RISC-V: Add autovec sign/zero extension and truncation.

2023-05-26 Thread Jeff Law via Gcc-patches
On 5/25/23 03:03, Robin Dapp wrote: Hi, this patch implements the autovec expanders for sign and zero extension patterns as well as the accompanying truncations. In order to use them additional mode_attr iterators as well as vectorizer hooks are required. Using these hooks we can e.g.

Re: [PATCH] RISC-V: Add autovec sign/zero extension and truncation.

2023-05-26 Thread Robin Dapp via Gcc-patches
> I realize that both TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES and > TARGET_VECTORIZE_RELATED_MODE will partially enable some > auto-vectorization even preferred_simd_mode does not enable > auto-vectorization when we don't specify > --param=riscv-autovec-preference. > > So plz add

Re: [PATCH] RISC-V: Add autovec sign/zero extension and truncation.

2023-05-25 Thread juzhe.zh...@rivai.ai
I realize that both TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES and TARGET_VECTORIZE_RELATED_MODE will partially enable some auto-vectorization even preferred_simd_mode does not enable auto-vectorization when we don't specify --param=riscv-autovec-preference. So plz add autovec_use_vlmax_p into

RE: [PATCH] RISC-V: Add autovec sign/zero extension and truncation.

2023-05-25 Thread Li, Pan2 via Gcc-patches
...@rivai.ai; jeffreyalaw Subject: RE: [PATCH] RISC-V: Add autovec sign/zero extension and truncation. The zero-scratch-regs-3.c comes from below PATCH. https://gcc.gnu.org/pipermail/gcc-patches/2023-April/615494.html Hi Yanzhang, Could you please help to double check the issue reported by Robin? Aka

RE: [PATCH] RISC-V: Add autovec sign/zero extension and truncation.

2023-05-25 Thread Li, Pan2 via Gcc-patches
The zero-scratch-regs-3.c comes from below PATCH. https://gcc.gnu.org/pipermail/gcc-patches/2023-April/615494.html Hi Yanzhang, Could you please help to double check the issue reported by Robin? Aka: " zero-scratch-regs-3.c seems to FAIL in vcondu but that already happens on trunk." Thanks

Re: [PATCH] RISC-V: Add autovec sign/zero extension and truncation.

2023-05-25 Thread Robin Dapp via Gcc-patches
Hi Juzhe, > use riscv_v_ext_vector_mode_p  instead since riscv_v_ext_mode_p includes > tuple modes. > You should not use tuple modes in related_mode. Tuple modes will be used in > array mode target hook and > used by vec_load_lanes/vec_store_lanes. Ah, thanks for catching this. Yes,

Re: [PATCH] RISC-V: Add autovec sign/zero extension and truncation.

2023-05-25 Thread juzhe.zh...@rivai.ai
Hi, Robin. >>+extern bool riscv_v_ext_mode_p (machine_mode mode); No, we don't need it as global extern. >> + if (riscv_v_ext_mode_p (vector_mode) >>+ && multiple_p (BYTES_PER_RISCV_VECTOR * ((int) riscv_autovec_lmul), >>+ GET_MODE_SIZE (element_mode), _units)) use