Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win64 microsoft calling convention for assembly #68

Open
dis2 opened this issue Mar 10, 2018 · 1 comment
Open

win64 microsoft calling convention for assembly #68

dis2 opened this issue Mar 10, 2018 · 1 comment

Comments

@dis2
Copy link

dis2 commented Mar 10, 2018

As far I can't tell, it's not possible to convince mingw to call the asm routines with SYSV. Thus one having to fall back to gmp or easy for field arithmetic (in case of EC).

Would something to the effect of:

#ifndef __MINGW64__
// Everyone else
#define RDI %rdi
#define RSI %rsi
#define RDX %rdx
#define RCX %rcx
#define R8 %r8
#define R9 %r9
#define WINPUSH
#define WINPOP
#else
// Microsoft
#define RDI %rcx
#define RSI %rdx
#define RDX %r8
#define RCX %r9
#define R8 %rax // Make sure rax isn't used
#define R9 %rdi
#define WINPUSH push %rdi
#define WINPOP pop %rdi
#endif

Make sense, or would it be simpler to just stick SYSV->MS register shuffle in front of each asm _low. Slight overhead, but far less invasive than making all the registers conditional. Of course if somebody knows how to convince mingw to talk to both worlds via some attribute, that would be nice, but never found a such a thing on my own.

@dfaranha
Copy link
Contributor

dfaranha commented Apr 4, 2021

Hi, did you make any progress on this in the past few years? :)

I have finally included MINGW builds as part of GH Actions and feel in better shape of trying to convert the ASM to its calling conventions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants