public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110751] RISC-V: Suport undefined value that allows VSETVL PASS use TA/MA Date: Thu, 21 Sep 2023 09:13:15 +0000 [thread overview] Message-ID: <bug-110751-4-Au4GmLTuOV@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-110751-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110751 --- Comment #43 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Lehua Ding <lhtin@gcc.gnu.org>: https://gcc.gnu.org/g:9b5b2c9f95056f97cf95f0e8d970015aa586497b commit r14-4194-g9b5b2c9f95056f97cf95f0e8d970015aa586497b Author: Juzhe-Zhong <juzhe.zhong@rivai.ai> Date: Thu Sep 21 15:19:29 2023 +0800 RISC-V: Enable undefined support for RVV auto-vectorization[PR110751] Now GCC middle-end can support undefined value which is traslated into (scratch:mode). This patch is to enable RISC-V backend undefine value in ELSE value of COND_LEN_xxx/COND_xxx. Consider this following case: __attribute__((noipa)) void vrem_int8_t (int8_t * __restrict dst, int8_t * __restrict a, int8_t * __restrict b, int n) { for (int i = 0; i < n; i++) dst[i] = a[i] % b[i]; } Before this patch: vrem_int8_t: ble a3,zero,.L5 vsetvli a5,zero,e8,m1,ta,ma vmv.v.i v4,0 ---> redundant. .L3: vsetvli a5,a3,e8,m1,tu,ma ---> should be TA. vmv1r.v v1,v4 ---> redudant. vle8.v v3,0(a1) vle8.v v2,0(a2) sub a3,a3,a5 vrem.vv v1,v3,v2 vse8.v v1,0(a0) add a1,a1,a5 add a2,a2,a5 add a0,a0,a5 bne a3,zero,.L3 .L5: ret After this patch: vrem_int8_t: ble a3,zero,.L5 .L3: vsetvli a5,a3,e8,m1,ta,ma vle8.v v1,0(a1) vle8.v v2,0(a2) sub a3,a3,a5 vrem.vv v1,v1,v2 vse8.v v1,0(a0) add a1,a1,a5 add a2,a2,a5 add a0,a0,a5 bne a3,zero,.L3 .L5: ret PR target/110751 gcc/ChangeLog: * config/riscv/autovec.md: Enable scratch rtx in ELSE operand. * config/riscv/predicates.md (autovec_else_operand): New predicate. * config/riscv/riscv-v.cc (get_else_operand): New function. (expand_cond_len_unop): Adapt ELSE value. (expand_cond_len_binop): Ditto. (expand_cond_len_ternop): Ditto. * config/riscv/riscv.cc (riscv_preferred_else_value): New function. (TARGET_PREFERRED_ELSE_VALUE): New targethook. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/binop/vdiv-rv32gcv-nofm.c: Adapt test. * gcc.target/riscv/rvv/autovec/binop/vdiv-rv32gcv.c: Ditto. * gcc.target/riscv/rvv/autovec/binop/vdiv-rv64gcv-nofm.c: Ditto. * gcc.target/riscv/rvv/autovec/binop/vdiv-rv64gcv.c: Ditto. * gcc.target/riscv/rvv/autovec/binop/vrem-rv32gcv.c: Ditto. * gcc.target/riscv/rvv/autovec/binop/vrem-rv64gcv.c: Ditto. * gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-1.c: Ditto. * gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-10.c: Ditto. * gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-11.c: Ditto. * gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-12.c: Ditto. * gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-2.c: Ditto. * gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-3.c: Ditto. * gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-4.c: Ditto. * gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-5.c: Ditto. * gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-6.c: Ditto. * gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-7.c: Ditto. * gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-8.c: Ditto. * gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-9.c: Ditto.
next prev parent reply other threads:[~2023-09-21 9:13 UTC|newest] Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-07-20 9:03 [Bug target/110751] New: " xuli1 at eswincomputing dot com 2023-07-20 9:10 ` [Bug target/110751] " juzhe.zhong at rivai dot ai 2023-07-20 9:30 ` rguenth at gcc dot gnu.org 2023-07-20 9:37 ` rguenth at gcc dot gnu.org 2023-07-20 9:58 ` kito at gcc dot gnu.org 2023-07-20 11:28 ` rguenther at suse dot de 2023-07-20 11:43 ` juzhe.zhong at rivai dot ai 2023-07-20 12:00 ` juzhe.zhong at rivai dot ai 2023-07-20 12:35 ` rguenther at suse dot de 2023-07-20 12:42 ` juzhe.zhong at rivai dot ai 2023-07-20 12:45 ` rguenther at suse dot de 2023-07-20 12:50 ` juzhe.zhong at rivai dot ai 2023-07-20 12:56 ` rguenther at suse dot de 2023-07-20 13:29 ` rsandifo at gcc dot gnu.org 2023-07-20 13:32 ` rguenther at suse dot de 2023-07-20 22:03 ` juzhe.zhong at rivai dot ai 2023-07-21 1:53 ` xuli1 at eswincomputing dot com 2023-07-21 6:17 ` rguenth at gcc dot gnu.org 2023-07-21 12:47 ` rsandifo at gcc dot gnu.org 2023-07-21 12:53 ` rguenth at gcc dot gnu.org 2023-07-21 13:23 ` rsandifo at gcc dot gnu.org 2023-07-24 6:20 ` rguenther at suse dot de 2023-07-25 7:05 ` juzhe.zhong at rivai dot ai 2023-09-12 11:44 ` juzhe.zhong at rivai dot ai 2023-09-12 14:24 ` rsandifo at gcc dot gnu.org 2023-09-12 14:53 ` juzhe.zhong at rivai dot ai 2023-09-12 15:59 ` rsandifo at gcc dot gnu.org 2023-09-12 16:21 ` juzhe.zhong at rivai dot ai 2023-09-12 16:27 ` juzhe.zhong at rivai dot ai 2023-09-12 16:31 ` juzhe.zhong at rivai dot ai 2023-09-12 22:44 ` juzhe.zhong at rivai dot ai 2023-09-13 7:56 ` rguenth at gcc dot gnu.org 2023-09-13 8:34 ` juzhe.zhong at rivai dot ai 2023-09-13 8:39 ` juzhe.zhong at rivai dot ai 2023-09-13 9:38 ` rguenth at gcc dot gnu.org 2023-09-13 9:39 ` rguenth at gcc dot gnu.org 2023-09-13 9:48 ` juzhe.zhong at rivai dot ai 2023-09-13 9:48 ` juzhe.zhong at rivai dot ai 2023-09-13 10:15 ` rguenther at suse dot de 2023-09-13 22:39 ` rsandifo at gcc dot gnu.org 2023-09-14 8:53 ` juzhe.zhong at rivai dot ai 2023-09-14 9:15 ` richard.sandiford at arm dot com 2023-09-20 16:27 ` cvs-commit at gcc dot gnu.org 2023-09-21 9:13 ` cvs-commit at gcc dot gnu.org [this message] 2023-09-21 9:28 ` juzhe.zhong at rivai dot ai 2023-09-22 7:31 ` xuli1 at eswincomputing dot com 2023-09-22 7:33 ` xuli1 at eswincomputing dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-110751-4-Au4GmLTuOV@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).