aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gen/gen_code.cpp17
-rw-r--r--readme.md3
-rw-r--r--readme.txt3
-rw-r--r--test/make_nm.cpp17
-rw-r--r--xbyak/xbyak.h2
-rw-r--r--xbyak/xbyak_mnemonic.h10
6 files changed, 48 insertions, 4 deletions
diff --git a/gen/gen_code.cpp b/gen/gen_code.cpp
index 41c24c8..60325a6 100644
--- a/gen/gen_code.cpp
+++ b/gen/gen_code.cpp
@@ -640,6 +640,23 @@ void put()
uint8 ext;
const char *name;
} tbl[] = {
+ { 0xa3, 4, "bt" },
+ { 0xab, 5, "bts" },
+ { 0xb3, 6, "btr" },
+ { 0xbb, 7, "btc" },
+ };
+ for (int i = 0; i < NUM_OF_ARRAY(tbl); i++) {
+ const Tbl *p = &tbl[i];
+ printf("void %s(const Operand& op, const Reg& reg) { opModRM(reg, op, op.isREG(16|32|64) && op.getBit() == reg.getBit(), op.isMEM(), 0x0f, 0x%02x); }\n", p->name, p->code);
+ printf("void %s(const Operand& op, uint8 imm) { opR_ModM(op, 16|32|64, %d, 0x0f, 0xba); db(imm); }\n", p->name, p->ext);
+ }
+ }
+ {
+ const struct Tbl {
+ uint8 code;
+ uint8 ext;
+ const char *name;
+ } tbl[] = {
{ B11110110, 6, "div" },
{ B11110110, 7, "idiv" },
{ B11110110, 5, "imul" },
diff --git a/readme.md b/readme.md
index 78617c5..d363a8c 100644
--- a/readme.md
+++ b/readme.md
@@ -1,5 +1,5 @@
-Xbyak 4.60 ; JIT assembler for x86(IA32), x64(AMD64, x86-64) by C++
+Xbyak 4.61 ; JIT assembler for x86(IA32), x64(AMD64, x86-64) by C++
=============
Abstract
@@ -269,6 +269,7 @@ The header files under xbyak/ are independent of cybozulib.
History
-------------
+* 2014/May/30 ver 4.61 support bt, bts, btr, btc
* 2014/May/28 ver 4.60 support vcvtph2ps, vcvtps2ph
* 2014/Apr/11 ver 4.52 add detection of rdrand
* 2014/Mar/25 ver 4.51 remove state information of unreferenced labels
diff --git a/readme.txt b/readme.txt
index 07851c9..d2f9318 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1,5 +1,5 @@
- C++用x86(IA-32), x64(AMD64, x86-64) JITアセンブラ Xbyak 4.60
+ C++用x86(IA-32), x64(AMD64, x86-64) JITアセンブラ Xbyak 4.61
-----------------------------------------------------------------------------
◎概要
@@ -285,6 +285,7 @@ cybozulibは単体テストでのみ利用されていて、xbyak/ディレク�
-----------------------------------------------------------------------------
◎履歴
+2014/05/30 ver 4.61 bt, bts, btr, btcのサポート
2014/05/28 ver 4.60 vcvtph2ps, vcvtps2phのサポート
2014/04/11 ver 4.52 rdrandの判定追加
2014/03/25 ver 4.51 参照されなくなったラベルの状態を削除する
diff --git a/test/make_nm.cpp b/test/make_nm.cpp
index 2152f29..5b968dd 100644
--- a/test/make_nm.cpp
+++ b/test/make_nm.cpp
@@ -829,6 +829,22 @@ class Test {
put(p, REG8|REG8_3|AL, IMM|NEG8);
}
}
+ void putBt() const
+ {
+ static const char tbl[][16] = {
+ "bt",
+ "bts",
+ "btr",
+ "btc",
+ };
+ for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) {
+ const char *p = tbl[i];
+ put(p, MEM|REG16, REG16);
+ put(p, MEM|REG32, REG32);
+ put(p, MEM|REG64, REG64);
+ put(p, MEM16|REG16, IMM);
+ }
+ }
void putRorM() const
{
static const char tbl[][16] = {
@@ -2121,6 +2137,7 @@ public:
#else
putSIMPLE();
putReg1();
+ putBt();
putRorM();
separateFunc();
putPushPop();
diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h
index 1947a27..3635bf6 100644
--- a/xbyak/xbyak.h
+++ b/xbyak/xbyak.h
@@ -91,7 +91,7 @@ namespace Xbyak {
enum {
DEFAULT_MAX_CODE_SIZE = 4096,
- VERSION = 0x4600 /* 0xABCD = A.BC(D) */
+ VERSION = 0x4610 /* 0xABCD = A.BC(D) */
};
#ifndef MIE_INTEGER_TYPE_DEFINED
diff --git a/xbyak/xbyak_mnemonic.h b/xbyak/xbyak_mnemonic.h
index f8ba5a5..8748102 100644
--- a/xbyak/xbyak_mnemonic.h
+++ b/xbyak/xbyak_mnemonic.h
@@ -1,4 +1,4 @@
-const char *getVersionString() const { return "4.60"; }
+const char *getVersionString() const { return "4.61"; }
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); }
@@ -441,6 +441,14 @@ void xor(const Operand& op, uint32 imm) { opRM_I(op, imm, 0x30, 6); }
#endif
void dec(const Operand& op) { opIncDec(op, 0x48, 1); }
void inc(const Operand& op) { opIncDec(op, 0x40, 0); }
+void bt(const Operand& op, const Reg& reg) { opModRM(reg, op, op.isREG(16|32|64) && op.getBit() == reg.getBit(), op.isMEM(), 0x0f, 0xa3); }
+void bt(const Operand& op, uint8 imm) { opR_ModM(op, 16|32|64, 4, 0x0f, 0xba); db(imm); }
+void bts(const Operand& op, const Reg& reg) { opModRM(reg, op, op.isREG(16|32|64) && op.getBit() == reg.getBit(), op.isMEM(), 0x0f, 0xab); }
+void bts(const Operand& op, uint8 imm) { opR_ModM(op, 16|32|64, 5, 0x0f, 0xba); db(imm); }
+void btr(const Operand& op, const Reg& reg) { opModRM(reg, op, op.isREG(16|32|64) && op.getBit() == reg.getBit(), op.isMEM(), 0x0f, 0xb3); }
+void btr(const Operand& op, uint8 imm) { opR_ModM(op, 16|32|64, 6, 0x0f, 0xba); db(imm); }
+void btc(const Operand& op, const Reg& reg) { opModRM(reg, op, op.isREG(16|32|64) && op.getBit() == reg.getBit(), op.isMEM(), 0x0f, 0xbb); }
+void btc(const Operand& op, uint8 imm) { opR_ModM(op, 16|32|64, 7, 0x0f, 0xba); db(imm); }
void div(const Operand& op) { opR_ModM(op, 0, 6, 0xF6); }
void idiv(const Operand& op) { opR_ModM(op, 0, 7, 0xF6); }
void imul(const Operand& op) { opR_ModM(op, 0, 5, 0xF6); }