hello
I am trying to get acquainted with O2, so am testing with silly problems
I made a dll of libmingwex and am successful in calling some of the functions in the dll
in 32-bit mode, the following works
extern lib "mingwex32.dll"
! mingw_atan2l Alias "atan2l" (Byval x As extended, Byval y As extended) As extended
end extern
but same declaration for the 64-bit dll won't work
! mingw_atan2l Alias "atan2l" (Byref x As extended, Byref y As extended) As extended
I was successful with single argument functions using asm
function mingw_sinl(x As extended) As extended
extended z
lea rcx, z
lea rdx, x
call sinl
function=z
end function
but the similarly defined function for atan2l won't work, if the values 1, 2 are passed for the x and y arguments, the result is Pi/4
however, straight asm works, but not if inside a function as above
lea rcx, z
lea rdx, x
lea r8, y
call atan2l
so I am wondering whether the registers inside a function are substituted for other registers.
[edit]
#show revealed the generated code, functions with the asm will not work, a macro works ok.