diff --git a/gen/gen_code.cpp b/gen/gen_code.cpp index c638752..ce7dff6 100644 --- a/gen/gen_code.cpp +++ b/gen/gen_code.cpp @@ -801,12 +801,13 @@ void put() { 0x0F, B10101110, 3, "stmxcsr" }, { 0x0F, B10101110, 7, "clflush" }, // 0x80 is bug of nasm ? { 0xD9, NONE, 5, "fldcw" }, - { 0x9B, 0xD9, 7, "fstcw" }, +// { 0x9B, 0xD9, 7, "fstcw" }, // not correct order for fstcw [eax] on 64bit OS }; for (int i = 0; i < NUM_OF_ARRAY(tbl); i++) { const Tbl *p = &tbl[i]; printf("void %s(const Address& addr) { opModM(addr, Reg32(%d), 0x%02X, 0x%02X); }\n", p->name, p->ext, p->code1, p->code2); } + printf("void fstcw(const Address& addr) { db(0x9B); opModM(addr, Reg32(7), 0xD9, NONE); }\n"); } { const struct Tbl { diff --git a/sample/calc.cpp b/sample/calc.cpp index 68e01a3..d93bc95 100644 --- a/sample/calc.cpp +++ b/sample/calc.cpp @@ -11,7 +11,7 @@ #include #include #include "xbyak/xbyak.h" -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4127) // for boost(constant condition) #pragma warning(disable : 4512) // for boost #endif diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h index e309293..54400dd 100644 --- a/xbyak/xbyak.h +++ b/xbyak/xbyak.h @@ -28,7 +28,7 @@ #include #endif -#ifdef __x86_64__ +#if defined(__x86_64__) && !defined(__MINGW64__) #define XBYAK64_GCC #elif defined(_WIN64) #define XBYAK64_WIN diff --git a/xbyak/xbyak_mnemonic.h b/xbyak/xbyak_mnemonic.h index 9df79ee..ca25225 100644 --- a/xbyak/xbyak_mnemonic.h +++ b/xbyak/xbyak_mnemonic.h @@ -489,7 +489,7 @@ void ldmxcsr(const Address& addr) { opModM(addr, Reg32(2), 0x0F, 0xAE); } void stmxcsr(const Address& addr) { opModM(addr, Reg32(3), 0x0F, 0xAE); } void clflush(const Address& addr) { opModM(addr, Reg32(7), 0x0F, 0xAE); } void fldcw(const Address& addr) { opModM(addr, Reg32(5), 0xD9, 0x100); } -void fstcw(const Address& addr) { opModM(addr, Reg32(7), 0x9B, 0xD9); } +void fstcw(const Address& addr) { db(0x9B); opModM(addr, Reg32(7), 0xD9, NONE); } void movntpd(const Address& addr, const Xmm& reg) { opModM(addr, Reg16(reg.getIdx()), 0x0F, 0x2B); } void movntdq(const Address& addr, const Xmm& reg) { opModM(addr, Reg16(reg.getIdx()), 0x0F, 0xE7); } void movsx(const Reg& reg, const Operand& op) { opMovxx(reg, op, 0xBE); }