public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Michael Meissner <meissner@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/meissner/heads/work119)] Fold V4SI sign or zero extension into vsx_extract from memory with constant element. Date: Sat, 22 Apr 2023 00:21:55 +0000 (GMT) [thread overview] Message-ID: <20230422002155.9218E3858D20@sourceware.org> (raw) https://gcc.gnu.org/g:b6ab178f9557cc172f19350b6c68f1b7027abb82 commit b6ab178f9557cc172f19350b6c68f1b7027abb82 Author: Michael Meissner <meissner@linux.ibm.com> Date: Fri Apr 21 20:21:35 2023 -0400 Fold V4SI sign or zero extension into vsx_extract from memory with constant element. This patch folds V4SI vsx_extract from memory where the element number is constant with sign or zero extension to DImode. 2023-04-21 Michael Meissner <meissner@linux.ibm.com> gcc/ * config/rs6000/vsx.md (vsx_extract_v4si_load_to_<su>di): New insn. Diff: --- gcc/config/rs6000/vsx.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md index 9d76217f84c..5fb77e9cc22 100644 --- a/gcc/config/rs6000/vsx.md +++ b/gcc/config/rs6000/vsx.md @@ -3998,6 +3998,27 @@ (set_attr "length" "8") (set_attr "isa" "*,*,<VSX_EX_ISA>,<VSX_EX_ISA>")]) +;; Extract a V4SI element from memory with a constant element number and sign +;; or zero extend it to DImode. +(define_insn_and_split "*vsx_extract_v4si_load_to_<su>di" + [(set (match_operand:DI 0 "register_operand" "=r,r,wa,wa") + (any_extend:DI + (vec_select:SI + (match_operand:V4SI 1 "memory_operand" "m,Q,Z,Q") + (parallel [(match_operand:QI 2 "const_0_to_3_operand" "O,n,O,n")])))) + (clobber (match_scratch:DI 3 "=X,&b,X,&b"))] + "VECTOR_MEM_VSX_P (V4SImode) && TARGET_DIRECT_MOVE_64BIT" + "#" + "&& reload_completed" + [(set (match_dup 0) + (any_extend:DI (match_dup 4)))] +{ + operands[4] = rs6000_adjust_vec_address (operands[0], operands[1], operands[2], + operands[3], SImode); +} + [(set_attr "type" "load,load,fpload,fpload") + (set_attr "length" "8")]) + ;; Variable V16QI/V8HI/V4SI extract from a register (define_insn_and_split "vsx_extract_<mode>_var" [(set (match_operand:<VEC_base> 0 "gpc_reg_operand" "=r,r")
reply other threads:[~2023-04-22 0:21 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20230422002155.9218E3858D20@sourceware.org \ --to=meissner@gcc.gnu.org \ --cc=gcc-cvs@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).