public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "luoxhu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/89310] Poor code generation returning float field from a struct Date: Sun, 28 Jun 2020 09:56:36 +0000 [thread overview] Message-ID: <bug-89310-4-ZkcC7P5Xz0@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-89310-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89310 --- Comment #5 from luoxhu at gcc dot gnu.org --- Thanks. I copied the code from movsf_from_si to make a define_insn_and_split for "movsf_from_si2", but we don't have define_insn for rldicr, so I use gen_anddi3 instead, any comment? foo: .LFB0: .cfi_startproc rldicr 3,3,0,31 mtvsrd 1,3 xscvspdpn 1,1 blr diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 4fcd6a94022..92c237edfad 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -7593,6 +7593,48 @@ (define_insn_and_split "movsf_from_si" "*, *, p9v, p8v, *, *, p8v, p8v, p8v, *")]) +(define_insn_and_split "movsf_from_si2" + [(set (match_operand:SF 0 "nonimmediate_operand" + "=!r, f, v, wa, m, Z, + Z, wa, ?r, !r") + (unspec:SF [ + (subreg:SI (ashiftrt:DI + (match_operand:DI 1 "input_operand" + "m, m, wY, Z, r, f, + wa, r, wa, r") + (const_int 32)) 0)] + UNSPEC_SF_FROM_SI)) + (clobber (match_scratch:DI 2 + "=X, X, X, X, X, X, + X, r, X, X"))] + "TARGET_NO_SF_SUBREG + && (register_operand (operands[0], SFmode) + || register_operand (operands[1], SImode))" + "#" + "&& !reload_completed + && vsx_reg_sfsubreg_ok (operands[0], SFmode)" + [(const_int 0)] +{ + rtx op0 = operands[0]; + rtx op1 = operands[1]; + rtx tmp = gen_reg_rtx (DImode); + + emit_insn (gen_anddi3 (tmp, op1, GEN_INT(0xFFFFFFFF00000000ULL))); + emit_insn (gen_p8_mtvsrd_sf (op0, tmp)); + emit_insn (gen_vsx_xscvspdpn_directmove (op0, op0)); + DONE; +}) +
next prev parent reply other threads:[~2020-06-28 9:56 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-89310-4@http.gcc.gnu.org/bugzilla/> 2020-06-23 1:29 ` luoxhu at gcc dot gnu.org 2020-06-24 18:12 ` segher at gcc dot gnu.org 2020-06-28 9:56 ` luoxhu at gcc dot gnu.org [this message] 2020-06-29 17:46 ` segher at gcc dot gnu.org 2020-07-02 23:12 ` segher at gcc dot gnu.org 2020-07-21 3:37 ` cvs-commit at gcc dot gnu.org 2020-07-22 1:34 ` luoxhu at gcc dot gnu.org
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-89310-4-ZkcC7P5Xz0@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).