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. vector

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

2023-05-25 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 autovec_use_v

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

2023-05-25 Thread juzhe.zh...@rivai.ai
e_vlmax_p ()) +{ Doing this just like in riscv_vector::preferred_simd_modes Others let Kito chime in more comments. Thanks. juzhe.zh...@rivai.ai From: Robin Dapp Date: 2023-05-25 17:03 To: gcc-patches; Kito Cheng; palmer; juzhe.zh...@rivai.ai; jeffreyalaw CC: rdapp.gcc Subject: [PATCH] R

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
t; Thanks a lot. Pan -Original Message- From: Gcc-patches On Behalf Of Robin Dapp via Gcc-patches Sent: Thursday, May 25, 2023 5:03 PM To: gcc-patches ; Kito Cheng ; palmer ; juzhe.zh...@rivai.ai; jeffreyalaw Cc: rdapp@gmail.com Subject: [PATCH] RISC-V: Add autovec sign/zero ext

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, vector_mod

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

2023-05-25 Thread juzhe.zh...@rivai.ai
e already. Wait for kito's final approval. Thanks. juzhe.zh...@rivai.ai From: Robin Dapp Date: 2023-05-25 17:03 To: gcc-patches; Kito Cheng; palmer; juzhe.zh...@rivai.ai; jeffreyalaw CC: rdapp.gcc Subject: [PATCH] RISC-V: Add autovec sign/zero extension and truncation. Hi, this patch impl

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

2023-05-25 Thread Robin Dapp via Gcc-patches
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. vectorize with VNx4QImode as base mode and exte