This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/61195] New: single precision fmov does not need to switch mode


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]