fix fstcw for 64-bit; support mingw64

This commit is contained in:
MITSUNARI Shigeo 2012-11-05 14:25:33 +09:00
parent 8cb9480e50
commit e38b389398
4 changed files with 5 additions and 4 deletions

View file

@ -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 {

View file

@ -11,7 +11,7 @@
#include <sstream>
#include <map>
#include "xbyak/xbyak.h"
#ifdef _WIN32
#ifdef _MSC_VER
#pragma warning(disable : 4127) // for boost(constant condition)
#pragma warning(disable : 4512) // for boost
#endif

View file

@ -28,7 +28,7 @@
#include <stdlib.h>
#endif
#ifdef __x86_64__
#if defined(__x86_64__) && !defined(__MINGW64__)
#define XBYAK64_GCC
#elif defined(_WIN64)
#define XBYAK64_WIN

View file

@ -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); }