public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/54065] New: [SH] Prefer @(R0,Rn) addressing for floating-point load/store
@ 2012-07-22  1:25 olegendo at gcc dot gnu.org
  2012-08-23 23:09 ` [Bug target/54065] " olegendo at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-07-22  1:25 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54065

             Bug #: 54065
           Summary: [SH] Prefer @(R0,Rn) addressing for floating-point
                    load/store
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: olegendo@gcc.gnu.org
            Target: sh*-*-*


The following function

float test00 (float* x)
{
  return x[10] + x[1] + x[20] + x[30];
}

compiled with e.g. '-O2 -m4-single -ml' results in:

        mov     r4,r2
        mov     r4,r1
        add     #40,r2
        add     #4,r1
        fmov.s  @r2,fr0
        fmov.s  @r1,fr1
        add     #76,r1
        add     #120,r4
        fadd    fr1,fr0
        fmov.s  @r1,fr1
        fadd    fr1,fr0
        fmov.s  @r4,fr1
        rts
        fadd    fr1,fr0

which would be better as:

    mov    #40,r0
    fmov.s    @(r0,r2),fr0
    mov    #4,r0
    fmov.s    @(r0,r1),fr1
    mov    #80,r0
    fadd    fr1,fr0
    fmov.s    @(r0,r1),fr1
    mov    #120,r0    
    fadd    fr1,fr0
    fmov.s    @(r0,r4),fr1
    rts
    fadd    fr1,fr0

In sh.md (around line 11724) there are some old peephole patterns that were
supposed to handle this case, I guess.  However, they seem to be defunct.


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

end of thread, other threads:[~2012-08-23 23:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-22  1:25 [Bug target/54065] New: [SH] Prefer @(R0,Rn) addressing for floating-point load/store olegendo at gcc dot gnu.org
2012-08-23 23:09 ` [Bug target/54065] " olegendo 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).