------- Comment #1 from ami_stuff at o2 dot pl  2009-08-22 00:43 -------
Here is asm output from GCC 4.2.5 (-m68060 -fomit-frame-pointer -O3):

#NO_APP
        .text
        .even
        .globl  _MUL64
_MUL64:
        movm.l #0x3e00,-(sp)
        move.l 24(sp),a1
        move.l 28(sp),a0
#APP
        | Inlined umul_ppmm
    move.l a1,d0
    move.l a0,d1
    move.l d0,d2
    swap    d0
    move.l d1,d3
    swap    d1
    move.w d2,d4
    mulu    d3,d4
    mulu    d1,d2
    mulu    d0,d3
    mulu    d0,d1
    move.l d4,d0
    eor.w  d0,d0
    swap    d0
    add.l  d0,d2
    add.l  d3,d2
    jcc     1f
    add.l  #65536,d1
1:  swap    d2
    moveq   #0,d0
    move.w d2,d0
    move.w d4,d2
    move.l d2,d6
    add.l  d1,d0
    move.l d0,d5
#NO_APP
        tst.l a1
        jblt L8
L2:
        tst.l a0
        jbge L4
        sub.l a1,d5
        jbra L4
L8:
        sub.l a0,d5
        jbra L2
L4:
        move.l d5,d0
        clr.l d1
        or.l d6,d1
        movm.l (sp)+,#0x7c
        rts


GCC 4.3.2 asm output looks worse:

#NO_APP
        .text
        .even
        .globl  _MUL64
_MUL64:
        movem.l #15872,-(sp)
        move.l 24(sp),d5
        move.l 28(sp),a1
#APP
;# 45 "test2.c" 1
        | Inlined umul_ppmm
    move.l d5,d0
    move.l a1,d1
    move.l d0,d2
    swap    d0
    move.l d1,d3
    swap    d1
    move.w d2,d4
    mulu    d3,d4
    mulu    d1,d2
    mulu    d0,d3
    mulu    d0,d1
    move.l d4,d0
    eor.w  d0,d0
    swap    d0
    add.l  d0,d2
    add.l  d3,d2
    jcc     1f
    add.l  #65536,d1
1:  swap    d2
    moveq   #0,d0
    move.w d2,d0
    move.w d4,d2
    move.l d2,d6
    add.l  d1,d0
    move.l d0,a0
#NO_APP
        tst.l d5
        jlt L6
        tst.l a1
        jlt L7
L3:
        move.l a0,d1
        clr.l d2
        or.l d6,d2
        move.l d1,d0
        move.l d2,d1
        movem.l (sp)+,#124
        rts
L7:
        sub.l d5,a0
        move.l a0,d1
        clr.l d2
        or.l d6,d2
        move.l d1,d0
        move.l d2,d1
        movem.l (sp)+,#124
        rts
L6:
        sub.l a1,a0
        tst.l a1
        jge L3
        jra L7


-- 


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

Reply via email to