在 2024-04-16 05:57, Pali Rohár 写道:
There is one another thing suspicious here. Function takes two float
arguments, but one argument is passed via floating-point register and
another via stack.

Yes it looks like the case.

 From what I found on internet, it looks like that stdcall calling
convention never use floating-point registers for passing arguments.
So this function cannot be real stdcall.

For x86, floating-point arguments are always passed on stack except with 
`__vectorcall`.

This function looks like kinda modified `__fastcall` ones; it does not look like a public calling convention.

I think it is better to be compatible with MSVC object level behavior
than inventing new/custom object level behavior. Meaning to export it
from def file without @SIZE.

But I think it is not possible to write declaration for this function
into header file. Because __attribute__((stdcall)) annotation cause that
all arguments are passed via stack. I looked at gcc documentation
https://gcc.gnu.org/onlinedocs/gcc/x86-Function-Attributes.html
and there is nothing which can tell to gcc compiler that first floating
point argument is passed in x87 register instead of the stack.
Maybe clang supports something?

If these are functions necessary by the Microsoft compiler (random posts on Google suggest they have been there to work around the Intel division bug) and not meant to be called by users, maybe we just shouldn't provide them.


--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to