Merge pull request #160 from herumi/dev

v6.62
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index a2a8c7f..1e53b98 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -8,6 +8,8 @@
     steps:
     - uses: actions/checkout@v2
     - run: sudo apt update
-    - run: sudo apt install nasm yasm g++-multilib tcsh
+    - run: sudo apt install yasm g++-multilib tcsh
+    - run: wget https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.gz
+    - run: tar xvfz nasm-2.15.05.tar.gz && cd nasm-2.15.05 && ./configure && make && sudo make install && cd ..
     - run: make test
     - run: make -C sample CXXFLAGS="-DXBYAK_NO_EXCEPTION"
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 59f7792..bb4fbe1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6...3.0.2)
 
-project(xbyak LANGUAGES CXX VERSION 6.61.2)
+project(xbyak LANGUAGES CXX VERSION 6.62)
 
 file(GLOB headers xbyak/*.h)
 
diff --git a/doc/changelog.md b/doc/changelog.md
index f59117b..c8890f6 100644
--- a/doc/changelog.md
+++ b/doc/changelog.md
@@ -1,5 +1,6 @@
 # History
 
+* 2022/Aug/15 ver 6.02 add serialize instruction
 * 2022/Aug/02 ver 6.61.1 noexcept is supported by Visual Studio 2015 or later
 * 2022/Jul/29 ver 6.61 fix exception of movzx eax, ah in 64-bit mode
 * 2022/Jun/16 ver 6.60.2 fix detection of GFNI, VAES, and VPCLMULQDQ
diff --git a/doc/install.md b/doc/install.md
index ddc1a10..bbec93d 100644
--- a/doc/install.md
+++ b/doc/install.md
@@ -12,3 +12,15 @@
 ```
 
 These files are copied into `/usr/local/include/xbyak`.
+
+# Building xbyak - Using vcpkg
+
+You can download and install xbyak using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:
+
+    git clone https://github.com/Microsoft/vcpkg.git
+    cd vcpkg
+    ./bootstrap-vcpkg.sh
+    ./vcpkg integrate install
+    ./vcpkg install xbyak
+
+The xbyak port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
diff --git a/gen/gen_code.cpp b/gen/gen_code.cpp
index a8b169e..9e2b808 100644
--- a/gen/gen_code.cpp
+++ b/gen/gen_code.cpp
@@ -693,6 +693,7 @@
 			{ "lock", 0xF0 },
 
 			{ "sahf", 0x9E },
+			{ "serialize", 0x0F, 0x01, 0xE8 },
 			{ "stc", 0xF9 },
 			{ "std", 0xFD },
 			{ "sti", 0xFB },
diff --git a/meson.build b/meson.build
index e1bdd9a..c708887 100644
--- a/meson.build
+++ b/meson.build
@@ -5,7 +5,7 @@
 project(
 	'xbyak',
 	'cpp',
-	version: '6.61.2',
+	version: '6.62',
 	license: 'BSD-3-Clause',
 	default_options: 'b_ndebug=if-release'
 )
diff --git a/readme.md b/readme.md
index 0503aba..a497791 100644
--- a/readme.md
+++ b/readme.md
@@ -1,5 +1,5 @@
 
-# Xbyak 6.61.2 [![Badge Build]][Build Status]
+# Xbyak 6.62 [![Badge Build]][Build Status]
 
 *A C++ JIT assembler for x86 (IA32), x64 (AMD64, x86-64)*
 
diff --git a/readme.txt b/readme.txt
index 53dc249..712b6a1 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1,5 +1,5 @@
 

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

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

 

 -----------------------------------------------------------------------------

 ◎概要

@@ -400,6 +400,7 @@
 -----------------------------------------------------------------------------

 ◎履歴

 

+2022/09/15 ver 6.62 serialize追加

 2022/08/02 ver 6.61.1 noexceptはVisual Studio 2015以降対応

 2022/07/29 ver 6.61 movzx eax, ahがエラーになるのを修正

 2022/06/16 ver 6.60.2 GFNI, VAES, VPCLMULQDQの判定修正

diff --git a/test/make_nm.cpp b/test/make_nm.cpp
index 801ffe0..60a9fa7 100644
--- a/test/make_nm.cpp
+++ b/test/make_nm.cpp
@@ -533,6 +533,7 @@
 			"nop",
 
 			"sahf",
+			"serialize",
 			"stc",
 			"std",
 			"sti",
diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h
index 358ebd3..d7955bf 100644
--- a/xbyak/xbyak.h
+++ b/xbyak/xbyak.h
@@ -144,11 +144,18 @@
 	#pragma warning(disable : 4127) /* constant expresison */
 #endif
 
+// disable -Warray-bounds because it may be a bug of gcc. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104603
+#if defined(__GNUC__) && !defined(__clang__)
+	#define XBYAK_DISABLE_WARNING_ARRAY_BOUNDS
+	#pragma GCC diagnostic push
+	#pragma GCC diagnostic ignored "-Warray-bounds"
+#endif
+
 namespace Xbyak {
 
 enum {
 	DEFAULT_MAX_CODE_SIZE = 4096,
-	VERSION = 0x6612 /* 0xABCD = A.BC(.D) */
+	VERSION = 0x6620 /* 0xABCD = A.BC(.D) */
 };
 
 #ifndef MIE_INTEGER_TYPE_DEFINED
@@ -2927,6 +2934,10 @@
 	#pragma warning(pop)
 #endif
 
+#if defined(__GNUC__) && !defined(__clang__)
+	#pragma GCC diagnostic pop
+#endif
+
 } // end of namespace
 
 #endif // XBYAK_XBYAK_H_
diff --git a/xbyak/xbyak_mnemonic.h b/xbyak/xbyak_mnemonic.h
index 74ceb53..c63ca2b 100644
--- a/xbyak/xbyak_mnemonic.h
+++ b/xbyak/xbyak_mnemonic.h
@@ -1,4 +1,4 @@
-const char *getVersionString() const { return "6.61.2"; }
+const char *getVersionString() const { return "6.62"; }
 void adc(const Operand& op, uint32_t imm) { opRM_I(op, imm, 0x10, 2); }
 void adc(const Operand& op1, const Operand& op2) { opRM_RM(op1, op2, 0x10); }
 void adcx(const Reg32e& reg, const Operand& op) { opGen(reg, op, 0xF6, 0x66, isREG32_REG32orMEM, NONE, 0x38); }
@@ -747,6 +747,7 @@
 void scasb() { db(0xAE); }
 void scasd() { db(0xAF); }
 void scasw() { db(0x66); db(0xAF); }
+void serialize() { db(0x0F); db(0x01); db(0xE8); }
 void seta(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, 0x90 | 7); }//-V524
 void setae(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, 0x90 | 3); }//-V524
 void setb(const Operand& op) { opR_ModM(op, 8, 0, 0x0F, 0x90 | 2); }//-V524