Skip to content

Commit

Permalink
fix amd64 asm syntax for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Mar 3, 2013
1 parent 1b9b759 commit 3c8738e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
10 changes: 9 additions & 1 deletion amd64/bsd_asm.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,17 @@

#define _START_ENTRY .text; .p2align 4,0x90

#if defined(__linux__) || defined(__FreeBSD__) || defined(__ELF__)
#define _ENTRY(x) _START_ENTRY; \
.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
#define ALTENTRY(x) _ENTRY(x); \
Expand All @@ -81,7 +90,6 @@
#define ENTRY(x) _ENTRY(x)
#endif

#define END(x) .size x, . - x

#define RCSID(x) .text; .asciz x

Expand Down
14 changes: 7 additions & 7 deletions amd64/fenv.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ fegetenv(fenv_t *envp)
int
feholdexcept(fenv_t *envp)
{
__uint32_t mxcsr;
uint32_t mxcsr;

__stmxcsr(&mxcsr);
__fnstenv(&envp->__x87);
Expand All @@ -114,8 +114,8 @@ extern inline int fesetenv(const fenv_t *__envp);
int
feupdateenv(const fenv_t *envp)
{
__uint32_t mxcsr;
__uint16_t status;
uint32_t mxcsr;
uint16_t status;

__fnstsw(&status);
__stmxcsr(&mxcsr);
Expand All @@ -127,8 +127,8 @@ feupdateenv(const fenv_t *envp)
int
__feenableexcept(int mask)
{
__uint32_t mxcsr, omask;
__uint16_t control;
uint32_t mxcsr, omask;
uint16_t control;

mask &= FE_ALL_EXCEPT;
__fnstcw(&control);
Expand All @@ -144,8 +144,8 @@ __feenableexcept(int mask)
int
__fedisableexcept(int mask)
{
__uint32_t mxcsr, omask;
__uint16_t control;
uint32_t mxcsr, omask;
uint16_t control;

mask &= FE_ALL_EXCEPT;
__fnstcw(&control);
Expand Down
5 changes: 2 additions & 3 deletions i387/bsd_asm.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@
#elif defined(__WIN32__)
#define CNAME(csym) _##csym
#define HIDENAME(asmsym) .asmsym
#define _ENTRY(x) \
_START_ENTRY; .globl CNAME(x) ; .def CNAME(X);\
.scl 2;.type 32;.endef; CNAME(x):
#define _ENTRY(x) _START_ENTRY; \
.globl CNAME(x); .def CNAME(x); .scl 2; .type 32; .endef; CNAME(x):
#define END(x) .end
#endif

Expand Down

0 comments on commit 3c8738e

Please sign in to comment.