public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/24209]  New: strange instruction selected for an annuled slot on sparc
@ 2005-10-05  5:12 dann at godzilla dot ics dot uci dot edu
  2005-10-05  5:13 ` [Bug rtl-optimization/24209] " dann at godzilla dot ics dot uci dot edu
  2005-10-05 11:06 ` [Bug rtl-optimization/24209] strange instruction selected for an annuled delay slot ebotcazou at gcc dot gnu dot org
  0 siblings, 2 replies; 4+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2005-10-05  5:12 UTC (permalink / raw)
  To: gcc-bugs

4.1 selects a strange instruction to put in the delay slot of a bl,a
instruction because in the non-taken case the same instruction will be executed
anyway...


-O2 code for 4.1

PointToRowCol:
        save    %sp, -112, %sp
        sethi   %hi(term), %g1
        ld      [%g1+%lo(term)], %l2
        add     %l2, 136, %l1
        ld      [%l1+572], %l3
        ld      [%l1+772], %l0
        sub     %i0, %l3, %o0
        call    .div, 0
         ld     [%l0+20], %o1                 
        sethi   %hi(firstValidRow), %g1
        ld      [%g1+%lo(firstValidRow)], %i0
        cmp     %o0, %i0
        bl,a    .LL118                
         ldsb   [%l2+1823], %g1          ;; this instruction
        sethi   %hi(lastValidRow), %g1
        ld      [%g1+%lo(lastValidRow)], %g1
        cmp     %o0, %g1
        bg      .LL116
         mov    %o0, %i0
.LL105:
        ldsb    [%l2+1823], %g1          ;; this will be executed on the        
                                         ;; non-taken path
.LL118:
        cmp     %g1, 0
        bne     .LL110
         mov    0, %o0
        ld      [%l0+32], %o0
.LL110:
        add     %o0, %l3, %o0
        ld      [%l0+16], %o1
        call    .div, 0
         sub    %i1, %o0, %o0
        cmp     %o0, 0
        bl      .LL113
         mov    0, %g2
        ld      [%l1+888], %g1
        add     %g1, 1, %g1
        cmp     %o0, %g1
        bg      .LL117
         mov    %o0, %g2
.LL113:
        st      %i0, [%i2]
        st      %g2, [%i3]
        jmp     %i7+8
         restore
.LL117:
        st      %i0, [%i2]
        mov     %g1, %g2
        st      %g2, [%i3]
        jmp     %i7+8
         restore
.LL116:
        b       .LL105
         mov    %g1, %i0


The 4.0 code is:
PointToRowCol:
        save    %sp, -112, %sp
        sethi   %hi(term), %g1
        ld      [%g1+%lo(term)], %l2
        add     %l2, 136, %l1
        ld      [%l1+572], %l3
        sub     %i0, %l3, %o0
        ld      [%l1+772], %i0
        call    .div, 0
         ld     [%i0+20], %o1
        sethi   %hi(firstValidRow), %g1
        ld      [%g1+%lo(firstValidRow)], %g1
        cmp     %o0, %g1
        bl      .LL42
         mov    %o0, %l0
        sethi   %hi(lastValidRow), %g1
        ld      [%g1+%lo(lastValidRow)], %g1
        cmp     %o0, %g1
        bg,a    .LL32
         mov    %g1, %l0
.LL32:
        ldsb    [%l2+1823], %g1
        cmp     %g1, 0
        bne     .LL36
         mov    0, %o0
        ld      [%i0+32], %o0
.LL36:
        add     %o0, %l3, %o0
        ld      [%i0+16], %o1
        call    .div, 0
         sub    %i1, %o0, %o0
        cmp     %o0, 0
        bl,a    .LL43
         st     %l0, [%i2]
        ld      [%l1+888], %g1
        add     %g1, 1, %g1
        cmp     %o0, %g1
        bg,a    .LL39
         mov    %g1, %o0
.LL39:
        st      %l0, [%i2]
        st      %o0, [%i3]
        jmp     %i7+8
         restore
.LL42:
        b       .LL32
         mov    %g1, %l0
.LL43:
        mov     0, %o0
        st      %o0, [%i3]
        jmp     %i7+8

(the 4.0 code a few bytes smaller)

I'll attach the preprocessed code.


-- 
           Summary: strange instruction selected for an annuled slot on
                    sparc
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dann at godzilla dot ics dot uci dot edu
GCC target triplet: sparc-sun-solaris2.8


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


^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <bug-24209-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2013-04-18 21:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-05  5:12 [Bug rtl-optimization/24209] New: strange instruction selected for an annuled slot on sparc dann at godzilla dot ics dot uci dot edu
2005-10-05  5:13 ` [Bug rtl-optimization/24209] " dann at godzilla dot ics dot uci dot edu
2005-10-05 11:06 ` [Bug rtl-optimization/24209] strange instruction selected for an annuled delay slot ebotcazou at gcc dot gnu dot org
     [not found] <bug-24209-4@http.gcc.gnu.org/bugzilla/>
2013-04-18 21:06 ` steven 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).