Skip to content

Commit

Permalink
Fix for gcc asm syntax on win32
Browse files Browse the repository at this point in the history
  • Loading branch information
hyc committed Sep 25, 2019
1 parent a3d8300 commit 3e1ec98
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/instructions_portable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ void rx_set_rounding_mode(uint32_t mode) {

#ifdef RANDOMX_USE_X87

#ifdef _M_IX86
#if defined( _M_IX86) && !defined(__GNUC__)

void rx_set_double_precision() {
_control87(_PC_53, _MCW_PC);
Expand Down
7 changes: 7 additions & 0 deletions src/intrin_portable.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,17 @@ constexpr int RoundToZero = 3;
#if !defined(__SSE2__)
#if defined(_M_IX86)
inline double __cdecl rx_sqrt(double x) {
#ifdef __GNUC__
__asm__ ("fld %0\n"
"fsqrt\n"
:
: "m"(x));
#else
__asm {
fld x
fsqrt
}
#endif
}
#define rx_sqrt rx_sqrt

Expand Down

0 comments on commit 3e1ec98

Please sign in to comment.