public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "spatel at rotateright dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/62054] New: fabsf uses constant pool and andps (x86-64) - use pabsd instead? Date: Thu, 07 Aug 2014 18:55:00 -0000 [thread overview] Message-ID: <bug-62054-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62054 Bug ID: 62054 Summary: fabsf uses constant pool and andps (x86-64) - use pabsd instead? Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: spatel at rotateright dot com $ cat fabs.c #include <math.h> float foo(float a) { return fabsf(a); } $ gcc49 -O1 fabs.c -S -o - .text .globl _foo _foo: LFB19: movss LC0(%rip), %xmm1 andps %xmm1, %xmm0 ret LFE19: .literal16 .align 4 LC0: .long 2147483647 .long 0 .long 0 .long 0 ---------------------------------------------------- I think we can save 16-bytes of constant pool data and a load instruction by generating: pabsd %xmm0, %xmm0 If this was part of a larger floating point chain of ops and depending on CPU, there may be some speed penalty for intermingling integer and FP ops on data in an xmm reg, but the size savings should outweigh that?
next reply other threads:[~2014-08-07 18:55 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-08-07 18:55 spatel at rotateright dot com [this message] 2014-08-07 19:18 ` [Bug target/62054] " glisse at gcc dot gnu.org 2014-08-07 19:23 ` spatel at rotateright 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-62054-4@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).