public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/61195] New: single precision fmov does not need to switch mode
@ 2014-05-15 13:55 chrbr at gcc dot gnu.org
  2014-05-15 14:22 ` [Bug target/61195] " chrbr at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: chrbr at gcc dot gnu.org @ 2014-05-15 13:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61195

            Bug ID: 61195
           Summary: single precision fmov does not need to switch mode
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chrbr at gcc dot gnu.org

for SH4/SH2A the compiler forces a PR mode switch for the floating point moves:

so

float
foo(float f)
{
        return f;
}

compiles as:

        mov.l   .L2,r1
        lds.l   @r1+,fpscr
        add     #-4,r1
        fmov    fr4,fr0
        add     #4,r1
        rts
        lds.l   @r1+,fpscr
.L3:
        .align 2
.L2:
        .long   ___fpscr_values

This is not necessary, since the prevailing mode for PR=0 is single precision
(double precision would be set with SZ=1)

so the function can be just be compiled as

_foo:
        rts
        fmov    fr4,fr0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-05-20 10:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-15 13:55 [Bug target/61195] New: single precision fmov does not need to switch mode chrbr at gcc dot gnu.org
2014-05-15 14:22 ` [Bug target/61195] " chrbr at gcc dot gnu.org
2014-05-19  8:05 ` chrbr at gcc dot gnu.org
2014-05-20 10:29 ` chrbr at gcc dot gnu.org

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).