add movbe

This commit is contained in:
MITSUNARI Shigeo 2015-06-16 11:43:09 +09:00
parent 9d5bc03b26
commit 4431caffbb
7 changed files with 13 additions and 4 deletions

View file

@ -1,5 +1,5 @@
Xbyak 4.82 ; JIT assembler for x86(IA32), x64(AMD64, x86-64) by C++
Xbyak 4.83 ; JIT assembler for x86(IA32), x64(AMD64, x86-64) by C++
=============
Abstract
@ -277,6 +277,7 @@ The header files under xbyak/ are independent of cybozulib.
History
-------------
* 2015/Jun/16 ver 4.83 support movbe(thanks to benvanik)
* 2015/May/24 ver 4.82 support detection of F16C
* 2015/Apr/25 ver 4.81 fix the condition to throw exception for setSize(thanks to whyisthisfieldhere)
* 2015/Apr/22 ver 4.80 rip supports label(thanks to whyisthisfieldhere)

View file

@ -1,5 +1,5 @@
C++用x86(IA-32), x64(AMD64, x86-64) JITアセンブラ Xbyak 4.82
C++用x86(IA-32), x64(AMD64, x86-64) JITアセンブラ Xbyak 4.83
-----------------------------------------------------------------------------
◎概要
@ -296,6 +296,7 @@ cybozulibは単体テストでのみ利用されていて、xbyak/ディレク
-----------------------------------------------------------------------------
◎履歴
2015/05/24 ver 4.83 mobveサポート(thanks to benvanik)
2015/05/24 ver 4.82 F16Cが使えるかどうかの判定追加
2015/04/25 ver 4.81 setSizeが例外を投げる条件を修正(thanks to whyisthisfieldhere)
2015/04/22 ver 4.80 rip相対でLabelのサポート(thanks to whyisthisfieldhere)

View file

@ -54,6 +54,7 @@ void putCPUinfo()
{ Cpu::tHLE, "hle" },
{ Cpu::tRTM, "rtm" },
{ Cpu::tF16C, "f16c" },
{ Cpu::tMOVBE, "movbe" },
};
for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) {
if (cpu.has(tbl[i].type)) printf(" %s", tbl[i].str);

View file

@ -973,6 +973,8 @@ class Test {
put(p, REG32e|REG16|REG8|RAX|EAX|AX|AL, MEM|MEM_ONLY_DISP);
put(p, MEM32|MEM16|MEM8, IMM);
put(p, REG64, "0x1234567890abcdefLL", "0x1234567890abcdef");
put("movbe", REG16|REG32e, MEM);
put("movbe", MEM, REG16|REG32e);
#ifdef XBYAK64
put(p, RAX|EAX|AX|AL, "ptr [0x1234567890abcdefLL]", "[qword 0x1234567890abcdef]");
put(p, "ptr [0x1234567890abcdefLL]", "[qword 0x1234567890abcdef]", RAX|EAX|AX|AL);

View file

@ -96,7 +96,7 @@ namespace Xbyak {
enum {
DEFAULT_MAX_CODE_SIZE = 4096,
VERSION = 0x4820 /* 0xABCD = A.BC(D) */
VERSION = 0x4830 /* 0xABCD = A.BC(D) */
};
#ifndef MIE_INTEGER_TYPE_DEFINED
@ -1868,6 +1868,8 @@ public:
mov_imm(reg, dummyAddr);
putL(label);
}
void movbe(const Reg& reg, const Address& addr) { opModM(addr, reg, 0x0F, 0x38, 0xF0); }
void movbe(const Address& addr, const Reg& reg) { opModM(addr, reg, 0x0F, 0x38, 0xF1); }
/*
put address of label to buffer
@note the put size is 4(32-bit), 8(64-bit)

View file

@ -1,4 +1,4 @@
const char *getVersionString() const { return "4.82"; }
const char *getVersionString() const { return "4.83"; }
void packssdw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x6B); }
void packsswb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x63); }
void packuswb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x67); }

View file

@ -163,6 +163,7 @@ public:
static const Type tHLE = uint64(1) << 31; // xacquire, xrelease, xtest
static const Type tRTM = uint64(1) << 32; // xbegin, xend, xabort
static const Type tF16C = uint64(1) << 33; // vcvtph2ps, vcvtps2ph
static const Type tMOVBE = uint64(1) << 34; // mobve
Cpu()
: type_(NONE)
@ -192,6 +193,7 @@ public:
if (data[2] & (1U << 9)) type_ |= tSSSE3;
if (data[2] & (1U << 19)) type_ |= tSSE41;
if (data[2] & (1U << 20)) type_ |= tSSE42;
if (data[2] & (1U << 22)) type_ |= tMOVBE;
if (data[2] & (1U << 23)) type_ |= tPOPCNT;
if (data[2] & (1U << 25)) type_ |= tAESNI;
if (data[2] & (1U << 1)) type_ |= tPCLMULQDQ;