Difficult, because BMX converts the code into C(C++?) code and then calls the gcc I think. BMX itself is just a LANGUAGE->C/C++ "compiler" and I don't know how to get the ASM output of gcc
Funny thing is: I did a intfloat-mixedmode test with C/C++, too. I didn't save the sourcefile, but gcc (I used DevCpp) was slightly faster than PureBasic, so I wonder why BlitzMax loses that much speed :roll:
If anyone's interested: Here's the original INTonly sieve test with Blitz3D, BlitzMax, Purebasic and C/C++:
Just took a look at the files in the .bmx folder and found a "sieve.bmx.BLABLABLA.s" file. This is what the file contains:
Code: Select all
format MS COFF
extrn ___bb_blitz_blitz_
extrn ___bb_standardio_standardio_
extrn ___bb_system_system_
extrn _bbArrayNew1D
extrn _bbEnd
extrn _bbFloatToInt
extrn _bbGCCollect
extrn _bbGCSetMode
extrn _bbStringClass
extrn _bbStringConcat
extrn _bbStringFromFloat
extrn _brl_standardio_Input
extrn _brl_standardio_Print
extrn _brl_system_MilliSecs
public __bb_main
public _bb_t
section "code" code
__bb_main:
push ebp
mov ebp,esp
sub esp,12
push ebx
push esi
push edi
cmp dword [_40],0
je _41
mov eax,0
pop edi
pop esi
pop ebx
mov esp,ebp
pop ebp
ret
_41:
mov dword [_40],1
fld dword [_42]
fstp dword [ebp-8]
call ___bb_blitz_blitz_
call ___bb_system_system_
call ___bb_standardio_standardio_
push 2
call _bbGCSetMode
add esp,4
push _25
call _brl_standardio_Print
add esp,4
mov eax,dword [_26]
and eax,1
cmp eax,0
jne _27
call _brl_system_MilliSecs
mov dword [ebp+-12],eax
fild dword [ebp+-12]
fstp dword [_bb_t]
or dword [_26],1
_27:
mov edi,1
jmp _29
_7:
fld dword [_44]
fstp dword [ebp-8]
push 8191
push _32
call _bbArrayNew1D
add esp,8
mov esi,eax
mov ebx,0
jmp _36
_10:
fld1
fstp dword [esi+ebx*4+24]
_8:
add ebx,1
_36:
cmp ebx,8190
jle _10
_9:
mov ebx,0
jmp _37
_13:
fld dword [esi+ebx*4+24]
fld1
fxch st1
fucompp
fnstsw ax
sahf
setnz al
movzx eax,al
cmp eax,0
jne _38
mov eax,ebx
shl eax,1
mov dword [ebp+-12],eax
fild dword [ebp+-12]
fstp dword [ebp-4]
fld dword [ebp-4]
fadd dword [_46]
fstp dword [ebp-4]
mov dword [ebp+-12],ebx
fild dword [ebp+-12]
fadd dword [ebp-4]
sub esp,8
fstp qword [esp]
call _bbFloatToInt
add esp,8
jmp _14
_16:
fldz
fstp dword [esi+eax*4+24]
mov dword [ebp+-12],eax
fild dword [ebp+-12]
fadd dword [ebp-4]
sub esp,8
fstp qword [esp]
call _bbFloatToInt
add esp,8
_14:
cmp eax,8190
jle _16
_15:
fld dword [ebp-8]
fadd dword [_47]
fstp dword [ebp-8]
_38:
_11:
add ebx,1
_37:
cmp ebx,8190
jle _13
_12:
call _bbGCCollect
_5:
add edi,1
_29:
cmp edi,50000
jle _7
_6:
call _brl_system_MilliSecs
mov dword [ebp+-12],eax
fild dword [ebp+-12]
fsub dword [_bb_t]
fstp dword [_bb_t]
push _18
push dword [_bb_t]
call _bbStringFromFloat
add esp,4
push eax
push _39
call _bbStringConcat
add esp,8
push eax
call _bbStringConcat
add esp,8
push eax
call _brl_standardio_Print
add esp,4
push dword [ebp-8]
call _bbStringFromFloat
add esp,4
push eax
push _19
call _bbStringConcat
add esp,8
push eax
call _brl_standardio_Print
add esp,4
push _20
call _brl_standardio_Input
add esp,4
call _bbEnd
mov eax,0
jmp _21
_21:
pop edi
pop esi
pop ebx
mov esp,ebp
pop ebp
ret
section "data" data writeable align 8
align 4
_40:
dd 0
align 4
_42:
dd 0x0
align 4
_25:
dd _bbStringClass
dd 2147483647
dd 40
dw 83,73,69,86,69,32,79,70
dw 32,69,82,65,84,79,83,84
dw 72,69,78,69,83,32,45,32
dw 53,48,48,48,48,32,105,116
dw 101,114,97,116,105,111,110,115
align 4
_26:
dd 0
align 4
_bb_t:
dd 0x0
align 4
_44:
dd 0x0
_32:
db "f",0
align 4
_46:
dd 0x40400000
align 4
_47:
dd 0x3f800000
align 4
_18:
dd _bbStringClass
dd 2147483647
dd 8
dw 32,109,47,115,101,99,115,46
align 4
_39:
dd _bbStringClass
dd 2147483647
dd 22
dw 53,48,48,48,48,32,105,116
dw 101,114,97,116,105,111,110,115
dw 32,116,111,111,107,32
align 4
_19:
dd _bbStringClass
dd 2147483647
dd 8
dw 80,114,105,109,101,115,58,32
align 4
_20:
dd _bbStringClass
dd 2147483647
dd 17
dw 82,101,116,117,114,110,32,116
dw 111,32,101,110,100,32,46,46
dw 46
Mark seems to use FASM now and that means Fred should be able to kick BMXs' ass