fix amd64 asm syntax for windows

This commit is contained in:
Jameson Nash 2013-03-02 22:50:35 -05:00
parent 1b9b759b48
commit 3c8738e642
3 changed files with 18 additions and 11 deletions

View file

@ -62,8 +62,17 @@
#define _START_ENTRY .text; .p2align 4,0x90 #define _START_ENTRY .text; .p2align 4,0x90
#if defined(__linux__) || defined(__FreeBSD__) || defined(__ELF__)
#define _ENTRY(x) _START_ENTRY; \ #define _ENTRY(x) _START_ENTRY; \
.globl CNAME(x); .type CNAME(x),@function; CNAME(x): .globl CNAME(x); .type CNAME(x),@function; CNAME(x):
#define END(x) .size x, . - x
#elif defined(__WIN32__)
#define _ENTRY(x) _START_ENTRY; \
.globl CNAME(x); .def CNAME(x); .scl 2; .type 32; .endef; CNAME(x):
#define END(x) .end
#endif
#ifdef PROF #ifdef PROF
#define ALTENTRY(x) _ENTRY(x); \ #define ALTENTRY(x) _ENTRY(x); \
@ -81,7 +90,6 @@
#define ENTRY(x) _ENTRY(x) #define ENTRY(x) _ENTRY(x)
#endif #endif
#define END(x) .size x, . - x
#define RCSID(x) .text; .asciz x #define RCSID(x) .text; .asciz x

View file

@ -97,7 +97,7 @@ fegetenv(fenv_t *envp)
int int
feholdexcept(fenv_t *envp) feholdexcept(fenv_t *envp)
{ {
__uint32_t mxcsr; uint32_t mxcsr;
__stmxcsr(&mxcsr); __stmxcsr(&mxcsr);
__fnstenv(&envp->__x87); __fnstenv(&envp->__x87);
@ -114,8 +114,8 @@ extern inline int fesetenv(const fenv_t *__envp);
int int
feupdateenv(const fenv_t *envp) feupdateenv(const fenv_t *envp)
{ {
__uint32_t mxcsr; uint32_t mxcsr;
__uint16_t status; uint16_t status;
__fnstsw(&status); __fnstsw(&status);
__stmxcsr(&mxcsr); __stmxcsr(&mxcsr);
@ -127,8 +127,8 @@ feupdateenv(const fenv_t *envp)
int int
__feenableexcept(int mask) __feenableexcept(int mask)
{ {
__uint32_t mxcsr, omask; uint32_t mxcsr, omask;
__uint16_t control; uint16_t control;
mask &= FE_ALL_EXCEPT; mask &= FE_ALL_EXCEPT;
__fnstcw(&control); __fnstcw(&control);
@ -144,8 +144,8 @@ __feenableexcept(int mask)
int int
__fedisableexcept(int mask) __fedisableexcept(int mask)
{ {
__uint32_t mxcsr, omask; uint32_t mxcsr, omask;
__uint16_t control; uint16_t control;
mask &= FE_ALL_EXCEPT; mask &= FE_ALL_EXCEPT;
__fnstcw(&control); __fnstcw(&control);

View file

@ -81,9 +81,8 @@
#elif defined(__WIN32__) #elif defined(__WIN32__)
#define CNAME(csym) _##csym #define CNAME(csym) _##csym
#define HIDENAME(asmsym) .asmsym #define HIDENAME(asmsym) .asmsym
#define _ENTRY(x) \ #define _ENTRY(x) _START_ENTRY; \
_START_ENTRY; .globl CNAME(x) ; .def CNAME(X);\ .globl CNAME(x); .def CNAME(x); .scl 2; .type 32; .endef; CNAME(x):
.scl 2;.type 32;.endef; CNAME(x):
#define END(x) .end #define END(x) .end
#endif #endif