Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
herumi committed Aug 2, 2023
2 parents 0924ff4 + 322665e commit 3255d60
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 2.6...3.0.2)

project(xbyak LANGUAGES CXX VERSION 6.71)
project(xbyak LANGUAGES CXX VERSION 6.72)

file(GLOB headers xbyak/*.h)

Expand Down
1 change: 1 addition & 0 deletions doc/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# History

* 2023/Aug/02 ver 6.72 add xbegin/xabort/xend
* 2023/Jul/27 ver 6.71 Allocator supports huge page
* 2023/Jul/05 ver 6.70 add alias of vclmulqdq, correct alias of pclmulqdq
* 2023/Jun/27 ver 6.69.2 add constexpr to `TypeT operator|` (thanks to Wunkolo)
Expand Down
3 changes: 3 additions & 0 deletions gen/gen_code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@ void put()
{ "wbinvd", 0x0F, 0x09 },
{ "wrmsr", 0x0F, 0x30 },
{ "xlatb", 0xD7 },
{ "xend", 0x0f, 0x01, 0xd5 },

{ "popf", 0x9D },
{ "pushf", 0x9C },
Expand Down Expand Up @@ -1113,6 +1114,8 @@ void put()
puts("void umwait(const Reg32& r) { int idx = r.getIdx(); if (idx > 7) XBYAK_THROW(ERR_BAD_PARAMETER) db(0xF2); db(0x0F); db(0xAE); setModRM(3, 6, idx); }");
puts("void clwb(const Address& addr) { db(0x66); opMIB(addr, esi, 0x0F, 0xAE); }");
puts("void cldemote(const Address& addr) { opMIB(addr, eax, 0x0F, 0x1C); }");
puts("void xabort(uint8_t imm) { db(0xC6); db(0xF8); db(imm); }");
puts("void xbegin(uint32_t rel) { db(0xC7); db(0xF8); dd(rel); }");
}
{
const struct Tbl {
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
project(
'xbyak',
'cpp',
version: '6.71',
version: '6.72',
license: 'BSD-3-Clause',
default_options: 'b_ndebug=if-release'
)
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Xbyak 6.71 [![Badge Build]][Build Status]
# Xbyak 6.72 [![Badge Build]][Build Status]

*A C++ JIT assembler for x86 (IA32), x64 (AMD64, x86-64)*

Expand Down
3 changes: 2 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

C++用x86(IA-32), x64(AMD64, x86-64) JITアセンブラ Xbyak 6.71
C++用x86(IA-32), x64(AMD64, x86-64) JITアセンブラ Xbyak 6.72

-----------------------------------------------------------------------------
◎概要
Expand Down Expand Up @@ -402,6 +402,7 @@ sample/{echo,hello}.bfは http://www.kmonos.net/alang/etc/brainfuck.php から
-----------------------------------------------------------------------------
◎履歴

2023/08/02 ver 6.72 xabort, xbegin, xend追加
2023/07/27 ver 6.71 Allocatorでhuge pageを考慮する。
2023/07/05 ver 6.70 vpclmulqdqのailas追加
2023/06/27 ver 6.69.2 `TypeT operator|`にconstexpr追加(thanks to Wunkolo)
Expand Down
1 change: 1 addition & 0 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,4 @@ lib_run: lib_test.cpp lib_run.cpp lib.h
$(CXX) $(CFLAGS) lib_run.cpp lib_test.cpp -o lib_run
make_nm: make_nm.cpp $(XBYAK_INC)

.PHONY: test
3 changes: 3 additions & 0 deletions test/make_nm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ class Test {
"wbinvd",
"wrmsr",
"xlatb",
"xend",

"popf",
"pushf",
Expand Down Expand Up @@ -1333,6 +1334,7 @@ class Test {
#ifdef XBYAK64
put("cmpxchg16b", MEM);
put("fxrstor64", MEM);
put("xbegin", "0x12345678");
#endif
{
const char tbl[][8] = {
Expand All @@ -1355,6 +1357,7 @@ class Test {
put("xchg", EAX|REG32, EAX|REG32|MEM);
put("xchg", MEM, EAX|REG32);
put("xchg", REG64, REG64|MEM);
put("xabort", IMM8);
}
void putShift() const
{
Expand Down
15 changes: 13 additions & 2 deletions test/normalize_prefix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,25 @@

typedef unsigned char uint8_t;

std::string normalize(const std::string& line)
std::string normalize(std::string line)
{
size_t pos = line.find('(');
/* nasm generates byte codes containing () for xbegin, so remove it. */
if (pos != std::string::npos) {
line.erase(pos, 1);
pos = line.find(')');
if (pos == std::string::npos) {
fprintf(stderr, "line error {%s}\n", line.c_str());
return "";
}
line.erase(pos, 1);
}
static const char tbl[][3] = { "66", "67", "F2", "F3" };
size_t tblNum = sizeof(tbl) / sizeof(tbl[0]);
typedef std::set<std::string> StringSet;
StringSet suf;

size_t pos = 0;
pos = 0;
for (; pos < line.size(); pos += 2) {
bool found = false;
for (size_t i = 0; i < tblNum; i++) {
Expand Down
2 changes: 1 addition & 1 deletion xbyak/xbyak.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ namespace Xbyak {

enum {
DEFAULT_MAX_CODE_SIZE = 4096,
VERSION = 0x6710 /* 0xABCD = A.BC(.D) */
VERSION = 0x6720 /* 0xABCD = A.BC(.D) */
};

#ifndef MIE_INTEGER_TYPE_DEFINED
Expand Down
5 changes: 4 additions & 1 deletion xbyak/xbyak_mnemonic.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const char *getVersionString() const { return "6.71"; }
const char *getVersionString() const { return "6.72"; }
void aadd(const Address& addr, const Reg32e &reg) { opModM(addr, reg, 0x0F, 0x38, 0x0FC); }
void aand(const Address& addr, const Reg32e &reg) { db(0x66); opModM(addr, reg, 0x0F, 0x38, 0x0FC); }
void adc(const Operand& op, uint32_t imm) { opRM_I(op, imm, 0x10, 2); }
Expand Down Expand Up @@ -1374,7 +1374,10 @@ void vzeroupper() { db(0xC5); db(0xF8); db(0x77); }
void wait() { db(0x9B); }
void wbinvd() { db(0x0F); db(0x09); }
void wrmsr() { db(0x0F); db(0x30); }
void xabort(uint8_t imm) { db(0xC6); db(0xF8); db(imm); }
void xadd(const Operand& op, const Reg& reg) { opModRM(reg, op, (op.isREG() && reg.isREG() && op.getBit() == reg.getBit()), op.isMEM(), 0x0F, 0xC0 | (reg.isBit(8) ? 0 : 1)); }
void xbegin(uint32_t rel) { db(0xC7); db(0xF8); dd(rel); }
void xend() { db(0x0F); db(0x01); db(0xD5); }
void xgetbv() { db(0x0F); db(0x01); db(0xD0); }
void xlatb() { db(0xD7); }
void xor_(const Operand& op, uint32_t imm) { opRM_I(op, imm, 0x30, 6); }
Expand Down

0 comments on commit 3255d60

Please sign in to comment.