diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 00000000..5f91cab8 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,32 @@ +# Contributing to Xbyak + +Thank you for considering contributing to the Xbyak project. This document provides guidelines on how to contribute. + +## Bug Reports and Feedback + +If you find a bug, have a feature request, or have questions, please open an issue. Include the following information: + +- Detailed description of the problem +- Steps to reproduce +- Expected behavior +- Actual behavior +- Environment details (OS, compiler version, etc.) + +## Creating Pull Requests + +If you want to add features or make fixes, follow these steps to create a pull request: + +1. Fork the repository +2. Create a new branch: `git checkout -b my-feature-branch` +3. Make your changes +4. Run tests and ensure all tests pass +5. Commit your changes: `git commit -am 'Add new feature'` +6. Push the branch: `git push origin my-feature-branch` +7. Create a pull request + +When creating a pull request, clearly describe the changes and include any related issue numbers. + +## License + +Xbyak is released under the BSD-3-Clause License. Any code contributions will be licensed under the same license. + diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0e291ae2..2e72a89c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: container: image: debian:testing steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: apt -y update - run: apt -y install g++-multilib libboost-dev make nasm yasm - run: make test diff --git a/CMakeLists.txt b/CMakeLists.txt index 361a98f5..598836a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.5) -project(xbyak LANGUAGES CXX VERSION 7.06) +project(xbyak LANGUAGES CXX VERSION 7.07) file(GLOB headers xbyak/*.h) diff --git a/doc/changelog.md b/doc/changelog.md index 7461bcaa..b67be4f3 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -1,5 +1,6 @@ # History +* 2024/Jun/11 ver 7.07 support xresldtrk/xsusldtrk * 2024/Mar/07 ver 7.06 Xbyak::util::Cpu supports AMD processor * 2024/Feb/11 ver 7.05.1 fix extractBit() in util::Cpu and align() for autoGrow mode * 2024/Jan/03 ver 7.05 support RAO-INT for APX diff --git a/gen/gen_code.cpp b/gen/gen_code.cpp index 3959cc5e..e43c9b20 100644 --- a/gen/gen_code.cpp +++ b/gen/gen_code.cpp @@ -758,6 +758,8 @@ void put() { "wbinvd", 0x0F, 0x09 }, { "wrmsr", 0x0F, 0x30 }, { "xlatb", 0xD7 }, + { "xresldtrk", 0xF2, 0x0F, 0x01, 0xE9 }, + { "xsusldtrk", 0xF2, 0x0F, 0x01, 0xE8 }, { "xend", 0x0f, 0x01, 0xd5 }, { "popf", 0x9D }, diff --git a/meson.build b/meson.build index f523c158..6a04b923 100644 --- a/meson.build +++ b/meson.build @@ -5,7 +5,7 @@ project( 'xbyak', 'cpp', - version: '7.06', + version: '7.07', license: 'BSD-3-Clause', default_options: 'b_ndebug=if-release' ) diff --git a/readme.md b/readme.md index 2c0f8a18..c93dc071 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,5 @@ -# Xbyak 7.06 [![Badge Build]][Build Status] +# Xbyak 7.07 [![Badge Build]][Build Status] *A C++ JIT assembler for x86 (IA32), x64 (AMD64, x86-64)* @@ -33,6 +33,7 @@ If you want to use them, then specify `-fno-operator-names` option to gcc/clang. ### News +- support xresldtrk/xsusldtrk - support RAO-INT for APX - support AVX10 detection, AESKLE, WIDE_KL, KEYLOCKER, KEYLOCKER_WIDE - support APX except for a few instructions diff --git a/readme.txt b/readme.txt index d8744894..bcc96aaa 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,5 @@ - C++用x86(IA-32), x64(AMD64, x86-64) JITアセンブラ Xbyak 7.06 + C++用x86(IA-32), x64(AMD64, x86-64) JITアセンブラ Xbyak 7.07 ----------------------------------------------------------------------------- ◎概要 @@ -404,6 +404,7 @@ sample/{echo,hello}.bfは http://www.kmonos.net/alang/etc/brainfuck.php から ----------------------------------------------------------------------------- ◎履歴 +2024/06/11 ver 7.07 xresldtrk/xsusldtrkサポート 2024/03/07 ver 7.06 util::Cpuのキャッシュ判定周りがAMD CPU対応 2024/02/11 ver 7.05.1 util::CpuのextractBit()とautoGrowモードでのalign()の修正 2024/01/03 ver 7.05 APX対応RAO-INT diff --git a/sample/cpuid/cpuid.sh b/sample/cpuid/cpuid.sh index c55fd284..ba3bd647 100755 --- a/sample/cpuid/cpuid.sh +++ b/sample/cpuid/cpuid.sh @@ -11,7 +11,7 @@ fi make -C ../ test_util64 -cpus=(p4p mrm pnr nhm wsm snb ivb hsw bdw slt slm glm glp tnt skl cnl icl skx clx cpx icx knl knm tgl adl mtl rpl spr gnr srf grr arl lnl) +cpus=(p4p mrm pnr nhm wsm snb ivb hsw bdw slt slm glm glp tnt skl cnl icl skx clx cpx icx tgl adl mtl rpl spr emr gnr gnr256 srf arl lnl) for cpu in ${cpus[@]} ; do echo $cpu diff --git a/sample/cpuid/emr.txt b/sample/cpuid/emr.txt new file mode 100644 index 00000000..b4a50e97 --- /dev/null +++ b/sample/cpuid/emr.txt @@ -0,0 +1,2 @@ +vendor intel + mmx mmx2 cmov sse sse2 sse3 ssse3 sse41 sse42 popcnt aesni rdtscp xsave(xgetvb) osxsave pclmulqdq avx fma avx2 bmi1 bmi2 lzcnt prefetchw enh_rep rdrand adx rdseed smap sha f16c movbe avx512f avx512dq avx512_ifma avx512cd avx512bw avx512vl avx512_vbmi avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq avx512_bf16 amx(tile) amx(int8) amx(bf16) avx_vnni avx512_fp16 waitpkg clflushopt cldemote clwb movdiri movdir64b uintr serialize diff --git a/sample/cpuid/gnr256.txt b/sample/cpuid/gnr256.txt new file mode 100644 index 00000000..8194f1cc --- /dev/null +++ b/sample/cpuid/gnr256.txt @@ -0,0 +1,2 @@ +vendor intel + mmx mmx2 cmov sse sse2 sse3 ssse3 sse41 sse42 popcnt aesni rdtscp xsave(xgetvb) osxsave pclmulqdq avx fma avx2 bmi1 bmi2 lzcnt prefetchw enh_rep rdrand adx rdseed smap sha f16c movbe gfni vaes vpclmulqdq amx(tile) amx(int8) amx(bf16) avx_vnni waitpkg clflushopt cldemote clwb movdiri movdir64b uintr serialize amx_fp16 prefetchiti avx10 diff --git a/sample/cpuid/grr.txt b/sample/cpuid/grr.txt deleted file mode 100644 index 0fcec69e..00000000 --- a/sample/cpuid/grr.txt +++ /dev/null @@ -1,2 +0,0 @@ -vendor intel - mmx mmx2 cmov sse sse2 sse3 ssse3 sse41 sse42 popcnt aesni rdtscp xsave(xgetvb) osxsave pclmulqdq avx fma avx2 bmi1 bmi2 lzcnt enh_rep rdrand adx rdseed smap sha f16c movbe gfni vaes vpclmulqdq avx_vnni waitpkg clflushopt cldemote clwb movdiri movdir64b uintr serialize avx_vnni_int8 avx_ne_convert avx_ifma rao-int cmpccxadd aeskle wide_kl keylocker keylocker_wide diff --git a/sample/cpuid/knl.txt b/sample/cpuid/knl.txt deleted file mode 100644 index 1c470223..00000000 --- a/sample/cpuid/knl.txt +++ /dev/null @@ -1,2 +0,0 @@ -vendor intel - mmx mmx2 cmov sse sse2 sse3 ssse3 sse41 sse42 popcnt aesni rdtscp xsave(xgetvb) osxsave pclmulqdq avx fma avx2 bmi1 bmi2 lzcnt prefetchw enh_rep rdrand adx rdseed prefetchwt1 f16c movbe avx512f avx512pf avx512er avx512cd diff --git a/sample/cpuid/knm.txt b/sample/cpuid/knm.txt deleted file mode 100644 index 8ca3096c..00000000 --- a/sample/cpuid/knm.txt +++ /dev/null @@ -1,2 +0,0 @@ -vendor intel - mmx mmx2 cmov sse sse2 sse3 ssse3 sse41 sse42 popcnt aesni rdtscp xsave(xgetvb) osxsave pclmulqdq avx fma avx2 bmi1 bmi2 lzcnt prefetchw enh_rep rdrand adx rdseed prefetchwt1 f16c movbe avx512f avx512pf avx512er avx512cd avx512_4vnniw avx512_4fmaps avx512_vpopcntdq diff --git a/sample/cpuid/spr.txt b/sample/cpuid/spr.txt index b4a50e97..c53700dc 100644 --- a/sample/cpuid/spr.txt +++ b/sample/cpuid/spr.txt @@ -1,2 +1,2 @@ vendor intel - mmx mmx2 cmov sse sse2 sse3 ssse3 sse41 sse42 popcnt aesni rdtscp xsave(xgetvb) osxsave pclmulqdq avx fma avx2 bmi1 bmi2 lzcnt prefetchw enh_rep rdrand adx rdseed smap sha f16c movbe avx512f avx512dq avx512_ifma avx512cd avx512bw avx512vl avx512_vbmi avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq avx512_bf16 amx(tile) amx(int8) amx(bf16) avx_vnni avx512_fp16 waitpkg clflushopt cldemote clwb movdiri movdir64b uintr serialize + mmx mmx2 cmov sse sse2 sse3 ssse3 sse41 sse42 popcnt aesni rdtscp xsave(xgetvb) osxsave pclmulqdq avx fma avx2 bmi1 bmi2 lzcnt prefetchw enh_rep rdrand adx rdseed smap sha f16c movbe avx512f avx512dq avx512_ifma avx512cd avx512bw avx512vl avx512_vbmi avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq avx512_bf16 amx(tile) amx(int8) amx(bf16) avx_vnni avx512_fp16 waitpkg clflushopt cldemote clwb movdiri movdir64b uintr serialize tsxldtrk diff --git a/sample/memfd.cpp b/sample/memfd.cpp index 1066c55b..2b6d08b9 100644 --- a/sample/memfd.cpp +++ b/sample/memfd.cpp @@ -1,6 +1,6 @@ /* a sample to use MmapAllocator with an user-defined name - cat /proc/`psidof ./memfd`/maps + cat /proc/`pidof ./memfd`/maps 7fca70b44000-7fca70b4a000 rw-p 00000000 00:00 0 7fca70b67000-7fca70b68000 rwxs 00000000 00:05 19960170 /memfd:xyz (deleted) diff --git a/sample/test_util.cpp b/sample/test_util.cpp index 25d776d5..870e060c 100644 --- a/sample/test_util.cpp +++ b/sample/test_util.cpp @@ -111,6 +111,7 @@ void putCPUinfo(bool onlyCpuidFeature) { Cpu::tWIDE_KL, "wide_kl" }, { Cpu::tKEYLOCKER, "keylocker" }, { Cpu::tKEYLOCKER_WIDE, "keylocker_wide" }, + { Cpu::tTSXLDTRK, "tsxldtrk" }, }; for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) { if (cpu.has(tbl[i].type)) printf(" %s", tbl[i].str); diff --git a/test/misc.cpp b/test/misc.cpp index 64bbffa0..14576919 100644 --- a/test/misc.cpp +++ b/test/misc.cpp @@ -1944,6 +1944,8 @@ CYBOZU_TEST_AUTO(misc) cldemote(ptr[eax+esi*4+0x12]); movdiri(ptr[edx+esi*2+4], eax); movdir64b(eax, ptr[edx]); + xresldtrk(); + xsusldtrk(); #ifdef XBYAK64 cldemote(ptr[rax+rdi*8+0x123]); movdiri(ptr[rax+r12], r9); @@ -1973,6 +1975,8 @@ CYBOZU_TEST_AUTO(misc) 0x67, #endif 0x0f, 0x38, 0xf8, 0x02, // movdir64b + 0xf2, 0x0f, 0x01, 0xe9, // xresldtrk + 0xf2, 0x0f, 0x01, 0xe8, // xsusldtrk #ifdef XBYAK64 0x0f, 0x1c, 0x84, 0xf8, 0x23, 0x01, 0x00, 0x00, // cldemote 0x4e, 0x0f, 0x38, 0xf9, 0x0c, 0x20, // movdiri diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h index 4a8effe6..e7459d30 100644 --- a/xbyak/xbyak.h +++ b/xbyak/xbyak.h @@ -155,7 +155,7 @@ namespace Xbyak { enum { DEFAULT_MAX_CODE_SIZE = 4096, - VERSION = 0x7060 /* 0xABCD = A.BC(.D) */ + VERSION = 0x7070 /* 0xABCD = A.BC(.D) */ }; #ifndef MIE_INTEGER_TYPE_DEFINED diff --git a/xbyak/xbyak_mnemonic.h b/xbyak/xbyak_mnemonic.h index eb5fd7f0..1b57173d 100644 --- a/xbyak/xbyak_mnemonic.h +++ b/xbyak/xbyak_mnemonic.h @@ -1,4 +1,4 @@ -const char *getVersionString() const { return "7.06"; } +const char *getVersionString() const { return "7.07"; } void aadd(const Address& addr, const Reg32e ®) { opMR(addr, reg, T_0F38, 0x0FC, T_APX); } void aand(const Address& addr, const Reg32e ®) { opMR(addr, reg, T_0F38|T_66, 0x0FC, T_APX|T_66); } void adc(const Operand& op, uint32_t imm) { opOI(op, imm, 0x10, 2); } @@ -1612,6 +1612,8 @@ void xor_(const Reg& d, const Operand& op, uint32_t imm) { opROI(d, op, imm, T_N void xor_(const Reg& d, const Operand& op1, const Operand& op2) { opROO(d, op1, op2, T_NF|T_CODE1_IF1, 0x30); } void xorpd(const Xmm& xmm, const Operand& op) { opSSE(xmm, op, T_0F | T_66, 0x57, isXMM_XMMorMEM); } void xorps(const Xmm& xmm, const Operand& op) { opSSE(xmm, op, T_0F, 0x57, isXMM_XMMorMEM); } +void xresldtrk() { db(0xF2); db(0x0F); db(0x01); db(0xE9); } +void xsusldtrk() { db(0xF2); db(0x0F); db(0x01); db(0xE8); } #ifdef XBYAK_ENABLE_OMITTED_OPERAND void vblendpd(const Xmm& x, const Operand& op, uint8_t imm) { vblendpd(x, x, op, imm); } void vblendps(const Xmm& x, const Operand& op, uint8_t imm) { vblendps(x, x, op, imm); } diff --git a/xbyak/xbyak_util.h b/xbyak/xbyak_util.h index dd428797..1f138e3b 100644 --- a/xbyak/xbyak_util.h +++ b/xbyak/xbyak_util.h @@ -547,6 +547,7 @@ class Cpu { XBYAK_DEFINE_TYPE(87, tKEYLOCKER_WIDE); XBYAK_DEFINE_TYPE(88, tSSE4a); XBYAK_DEFINE_TYPE(89, tCLWB); + XBYAK_DEFINE_TYPE(90, tTSXLDTRK); #undef XBYAK_SPLIT_ID #undef XBYAK_DEFINE_TYPE @@ -684,6 +685,7 @@ class Cpu { if (ECX & (1U << 28)) type_ |= tMOVDIR64B; if (EDX & (1U << 5)) type_ |= tUINTR; if (EDX & (1U << 14)) type_ |= tSERIALIZE; + if (EDX & (1U << 16)) type_ |= tTSXLDTRK; if (EDX & (1U << 22)) type_ |= tAMX_BF16; if (EDX & (1U << 24)) type_ |= tAMX_TILE; if (EDX & (1U << 25)) type_ |= tAMX_INT8;