This is the mail archive of the gcc-patches@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]

Re: [RFC, 4.9 patch] Reload alternative weighting vs. wrong class regs


On Thu, Feb 7, 2013 at 4:09 AM, Alan Modra wrote:
> After fixing PR54009 (again), I thought I'd take a look at why reload
> is generating the following correct but poor code
>
>  stw 10,8(1)
>  stw 11 12(1)
>  ...
>  lfd 0,8(1)
>  stfd 0,x+32764@l(9)
>
> rather than
>
>  addi 9,x+32764@l(9)
>  ...
>  stw 10,0(9)
>  stw 11 4(9)

FWIW, left trunk vs. LRA right (with PR54009 patch on rs6000.c):

r:                              r:
        stwu 1,-160(1)                  stwu 1,-160(1)
        lis 9,x+32764@ha                lis 9,x+32764@ha
        la 9,x+32764@l(9)     |         la 8,x+32764@l(9)
        lwz 10,0(9)           <
        lwz 11,4(9)           <
        lis 9,y@ha                      lis 9,y@ha
                              >         lwz 10,0(8)
                              >         lwz 11,4(8)
        stfd ...
        ...
        lfd ...
        ...
        stw 10,y@l(9)                   stw 10,y@l(9)
        stw 11,y+4@l(9)                 stw 11,y+4@l(9)
        addi 1,1,160                    addi 1,1,160
        blr                             blr

w:                              w:
        stwu 1,-160(1)                  stwu 1,-160(1)
        lis 9,y@ha                      lis 9,y@ha
        la 10,y@l(9)                    la 10,y@l(9)
                              >         lis 9,x+32764@ha
        lwz 11,4(10)                    lwz 11,4(10)
        lwz 10,0(10)                    lwz 10,0(10)
        lis 9,x+32764@ha      |         la 8,x+32764@l(9)
        stfd ...
        ...
        lfd ...
        ...
        lfd 31,152(1)                   lfd 31,152(1)
        lfd 0,8(1)            |         stw 10,0(8)
        stfd 0,x+32764@l(9)   |         stw 11,4(8)
        addi 1,1,160                    addi 1,1,160
        blr                             blr

I don't speak POWER but perhaps you can make sense of it :-)

Ciao!
Steven


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