public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "uros at kss-loka dot si" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/19398] New: Non-optimal code with cvttss2si Date: Wed, 12 Jan 2005 13:34:00 -0000 [thread overview] Message-ID: <20050112133406.19398.uros@kss-loka.si> (raw) The testcase: int test (float a) { return (a*a); } produces non-optimal asm code, when compiled with '-O2 -msse -mfpmath=387': test: pushl %ebp movl %esp, %ebp subl $4, %esp flds 8(%ebp) fmul %st(0), %st fstps -4(%ebp) (*) movss -4(%ebp), %xmm0 (*) cvttss2si %xmm0, %eax leave ret A cvttss2si insn could use memory input operand, so movss to %xmm0 is not needed. Following RTL sequence is generated in ._.23.greg: (insn 31 11 32 0 (set (mem:SF (plus:SI (reg/f:SI 6 bp) (const_int -4 [0xfffffffc])) [0 S4 A8]) (reg/v:SF 8 st [orig:59 a ] [59])) 61 {*movsf_1} (nil) (nil)) (insn 32 31 12 0 (set (reg:SF 21 xmm0) (mem:SF (plus:SI (reg/f:SI 6 bp) (const_int -4 [0xfffffffc])) [0 S4 A8])) 61 {*movsf_1} (nil) (nil)) (insn:HI 12 32 16 0 (set (reg:SI 0 ax [60]) (fix:SI (reg:SF 21 xmm0))) 112 {fix_truncsfsi_sse} (insn_list:REG_DEP_TRUE 11 (nil)) (nil)) It looks like gcc does not take into account the fact that cvttss2si can use memory input operand. -- Summary: Non-optimal code with cvttss2si Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: uros at kss-loka dot si CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19398
next reply other threads:[~2005-01-12 13:34 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2005-01-12 13:34 uros at kss-loka dot si [this message] 2005-01-12 15:56 ` [Bug target/19398] " pinskia at gcc dot gnu dot org 2005-01-14 23:21 ` pinskia at gcc dot gnu dot org 2005-01-18 11:20 ` [Bug rtl-optimization/19398] secondary reloads don't consider "m" alternatives rth at gcc dot gnu dot org 2005-01-18 12:22 ` uros at kss-loka dot si 2005-03-15 10:10 ` giovannibajo at libero dot it 2005-03-15 11:44 ` bernds_cb1 at t-online dot de 2005-03-15 12:23 ` giovannibajo at libero dot it 2005-03-15 12:35 ` uros at kss-loka dot si 2005-08-01 18:46 ` dalej at gcc dot gnu dot org 2005-08-08 9:58 ` bonzini at gcc dot gnu dot org 2005-08-08 10:17 ` bonzini at gcc dot gnu dot 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=20050112133406.19398.uros@kss-loka.si \ --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).