------- Comment #2 from ami_stuff at o2 dot pl 2009-08-30 16:57 -------
With -m68060 -O1 -fomit-frame-pointer:
GCC 4.1.2/GCC 4.2.5:
#NO_APP
.text
.even
.globl _MUL64
_MUL64:
movm.l #0x3e00,-(sp)
move.l 28(sp),a1
move.l 24(sp),a0
#APP
| Inlined umul_ppmm
move.l a0,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,d5
#NO_APP
tst.l a0
jbge L2
sub.l a1,d5
L2:
tst.l a1
jbge L4
sub.l a0,d5
L4:
move.l d5,d0
clr.l d1
or.l d6,d1
movm.l (sp)+,#0x7c
rts
GCC 4.3.2:
#NO_APP
.text
.even
.globl _MUL64
_MUL64:
movem.l #16128,-(sp)
move.l 32(sp),d5
move.l 28(sp),a0
#APP
;# 45 "test5.c" 1
| Inlined umul_ppmm
move.l a0,d0
move.l d5,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,d7
add.l d1,d0
move.l d0,a1
#NO_APP
tst.l a0
jge L2
sub.l d5,a1
L2:
tst.l d5
jge L3
sub.l a0,a1
L3:
move.l a1,d1
clr.l d2
or.l d7,d2
move.l d1,d0
move.l d2,d1
movem.l (sp)+,#252
rts
GCC 4.4.2:
#NO_APP
.text
.even
.globl _MUL64
_MUL64:
movem.l #16128,-(sp)
move.l 32(sp),a0
move.l 28(sp),a1
#APP
;# 45 "test5.c" 1
| 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
jge L2
sub.l a0,d5
L2:
tst.l a0
jge L3
sub.l a1,d5
L3:
move.l d5,d0
clr.l d1
move.l d0,d2
move.l d1,d3
or.l d6,d3
move.l d2,d6
move.l d3,d7
move.l d2,d0
move.l d7,d1
movem.l (sp)+,#252
rts
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40977