From aa69670ca51aac0ff8a72628895ef24bc6b45e18 Mon Sep 17 00:00:00 2001 From: nevergiveupcpp Date: Sun, 15 Mar 2026 16:45:07 +0700 Subject: [PATCH 1/4] chore: add CI workflow with cmake presets --- .github/workflows/ci.yml | 84 ++++++++++++++++++++++++++++++++++++++++ tests/CMakePresets.json | 76 ++++++++++++++++++++++++++---------- 2 files changed, 139 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..34d8046 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,84 @@ +name: CI + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + +jobs: + test: + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + + matrix: + include: + - name: Windows · MSVC x64 + os: windows-latest + preset: msvc-x64 + vcpkg_triplet: x64-windows + + - name: Windows · Clang-CL x64 + os: windows-latest + preset: llvm-x64 + vcpkg_triplet: x64-windows + + - name: Windows · MinGW x64 + os: windows-latest + preset: gcc-mingw-x64 + vcpkg_triplet: x64-mingw-dynamic + + - name: Windows ARM64 · MSVC + os: windows-11-arm + preset: msvc-arm64 + vcpkg_triplet: arm64-windows + + - name: Linux · GCC x64 + os: ubuntu-latest + preset: gcc-linux-x64 + vcpkg_triplet: x64-linux-dynamic + + - name: Linux · Clang x64 + os: ubuntu-latest + preset: clang-linux-x64 + vcpkg_triplet: x64-linux-dynamic + + - name: Linux ARM64 · GCC + os: ubuntu-24.04-arm + preset: gcc-linux-arm64 + vcpkg_triplet: arm64-linux + + - name: macOS ARM64 · Apple Clang + os: macos-latest + preset: apple-clang-macos-arm64 + vcpkg_triplet: arm64-osx + + steps: + - uses: actions/checkout@v4 + + - name: Set VCPKG_ROOT + shell: bash + run: echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV + + - name: Add MinGW to PATH + if: matrix.preset == 'gcc-mingw-x64' + shell: bash + run: echo "C:/msys64/mingw64/bin" >> $GITHUB_PATH + + - name: Install GTest + run: vcpkg install gtest:${{ matrix.vcpkg_triplet }} + + - name: Configure + working-directory: tests/unittest + run: cmake --preset ${{ matrix.preset }} + + - name: Build + working-directory: tests/unittest + run: cmake --build --preset ${{ matrix.preset }} + + - name: Test + working-directory: tests/unittest/build/${{ matrix.preset }} + run: ctest --build-config Release --output-on-failure diff --git a/tests/CMakePresets.json b/tests/CMakePresets.json index 721398b..a5533dc 100644 --- a/tests/CMakePresets.json +++ b/tests/CMakePresets.json @@ -37,6 +37,18 @@ "VCPKG_TARGET_TRIPLET": "x86-windows" } }, + { + "name": "msvc-arm64", + "inherits": "base-release", + "displayName": "MSVC ARM64 Release", + "binaryDir": "${sourceDir}/build/msvc-arm64", + "toolset": "v143", + "architecture": "ARM64", + "cacheVariables": { + "CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreadedDLL", + "VCPKG_TARGET_TRIPLET": "arm64-windows" + } + }, { "name": "llvm-x64", "inherits": "base-release", @@ -84,32 +96,54 @@ "CMAKE_CXX_FLAGS": "-m32 -msse -msse2", "VCPKG_TARGET_TRIPLET": "x86-linux" } - } - ], - "buildPresets": [ - { - "name": "msvc-x64", - "configurePreset": "msvc-x64" - }, - { - "name": "msvc-x86", - "configurePreset": "msvc-x86" }, { - "name": "llvm-x64", - "configurePreset": "llvm-x64" - }, - { - "name": "gcc-mingw-x64", - "configurePreset": "gcc-mingw-x64" + "name": "clang-linux-x64", + "inherits": "base-release", + "displayName": "Clang Linux x64 Release", + "binaryDir": "${sourceDir}/build/clang-linux-x64", + "generator": "Ninja", + "cacheVariables": { + "CMAKE_C_COMPILER": "clang", + "CMAKE_CXX_COMPILER": "clang++", + "VCPKG_TARGET_TRIPLET": "x64-linux-dynamic" + } }, { - "name": "gcc-linux-x64", - "configurePreset": "gcc-linux-x64" + "name": "gcc-linux-arm64", + "inherits": "base-release", + "displayName": "GCC Linux ARM64 Release", + "binaryDir": "${sourceDir}/build/gcc-linux-arm64", + "generator": "Ninja", + "cacheVariables": { + "CMAKE_C_COMPILER": "gcc", + "CMAKE_CXX_COMPILER": "g++", + "VCPKG_TARGET_TRIPLET": "arm64-linux" + } }, { - "name": "gcc-linux-x86", - "configurePreset": "gcc-linux-x86" + "name": "apple-clang-macos-arm64", + "inherits": "base-release", + "displayName": "Apple Clang macOS ARM64 Release", + "binaryDir": "${sourceDir}/build/apple-clang-macos-arm64", + "generator": "Ninja", + "cacheVariables": { + "CMAKE_C_COMPILER": "clang", + "CMAKE_CXX_COMPILER": "clang++", + "VCPKG_TARGET_TRIPLET": "arm64-osx" + } } + ], + "buildPresets": [ + { "name": "msvc-x64", "configurePreset": "msvc-x64" }, + { "name": "msvc-x86", "configurePreset": "msvc-x86" }, + { "name": "msvc-arm64", "configurePreset": "msvc-arm64" }, + { "name": "llvm-x64", "configurePreset": "llvm-x64" }, + { "name": "gcc-mingw-x64", "configurePreset": "gcc-mingw-x64" }, + { "name": "gcc-linux-x64", "configurePreset": "gcc-linux-x64" }, + { "name": "gcc-linux-x86", "configurePreset": "gcc-linux-x86" }, + { "name": "clang-linux-x64", "configurePreset": "clang-linux-x64" }, + { "name": "gcc-linux-arm64", "configurePreset": "gcc-linux-arm64" }, + { "name": "apple-clang-macos-arm64", "configurePreset": "apple-clang-macos-arm64" } ] -} \ No newline at end of file +} From 35c5ee8e85d2310358d8ce4437ed5cdee1f01d6f Mon Sep 17 00:00:00 2001 From: nevergiveupcpp Date: Sun, 15 Mar 2026 17:22:00 +0700 Subject: [PATCH 2/4] chore: remove MinGW from CI --- .github/workflows/ci.yml | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34d8046..8529fd6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: CI +name: ci on: push: @@ -16,42 +16,37 @@ jobs: matrix: include: - - name: Windows · MSVC x64 + - name: Windows (MSVC x64) os: windows-latest preset: msvc-x64 vcpkg_triplet: x64-windows - - name: Windows · Clang-CL x64 + - name: Windows (Clang x64) os: windows-latest preset: llvm-x64 vcpkg_triplet: x64-windows - - name: Windows · MinGW x64 - os: windows-latest - preset: gcc-mingw-x64 - vcpkg_triplet: x64-mingw-dynamic - - - name: Windows ARM64 · MSVC + - name: Windows ARM64 (MSVC) os: windows-11-arm preset: msvc-arm64 vcpkg_triplet: arm64-windows - - name: Linux · GCC x64 + - name: Linux (GCC x64) os: ubuntu-latest preset: gcc-linux-x64 vcpkg_triplet: x64-linux-dynamic - - name: Linux · Clang x64 + - name: Linux (Clang x64) os: ubuntu-latest preset: clang-linux-x64 vcpkg_triplet: x64-linux-dynamic - - name: Linux ARM64 · GCC + - name: Linux ARM64 (GCC) os: ubuntu-24.04-arm preset: gcc-linux-arm64 vcpkg_triplet: arm64-linux - - name: macOS ARM64 · Apple Clang + - name: macOS ARM64 (Clang) os: macos-latest preset: apple-clang-macos-arm64 vcpkg_triplet: arm64-osx @@ -63,10 +58,12 @@ jobs: shell: bash run: echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV - - name: Add MinGW to PATH - if: matrix.preset == 'gcc-mingw-x64' - shell: bash - run: echo "C:/msys64/mingw64/bin" >> $GITHUB_PATH + - name: Install Clang 18 + if: matrix.preset == 'clang-linux-x64' + run: | + sudo apt-get install -y clang-18 + sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100 + sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100 - name: Install GTest run: vcpkg install gtest:${{ matrix.vcpkg_triplet }} @@ -77,7 +74,7 @@ jobs: - name: Build working-directory: tests/unittest - run: cmake --build --preset ${{ matrix.preset }} + run: cmake --build --preset ${{ matrix.preset }} --config Release - name: Test working-directory: tests/unittest/build/${{ matrix.preset }} From 57f250dec87b2714254f45228824c59ab11107cb Mon Sep 17 00:00:00 2001 From: nevergiveupcpp Date: Sun, 15 Mar 2026 17:36:55 +0700 Subject: [PATCH 3/4] fix(macro_assembler): replace insn_seq alias with instruction_sequence for Clang CTAD compatibility --- .github/workflows/ci.yml | 23 ++++-------- include/pvm/codegen/macro_assembler.h | 54 +++++++++++++-------------- 2 files changed, 35 insertions(+), 42 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8529fd6..0b36790 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: ci +name: CI on: push: @@ -16,37 +16,37 @@ jobs: matrix: include: - - name: Windows (MSVC x64) + - name: Windows x64 / MSVC os: windows-latest preset: msvc-x64 vcpkg_triplet: x64-windows - - name: Windows (Clang x64) + - name: Windows x64 / Clang os: windows-latest preset: llvm-x64 vcpkg_triplet: x64-windows - - name: Windows ARM64 (MSVC) + - name: Windows ARM64 / MSVC os: windows-11-arm preset: msvc-arm64 vcpkg_triplet: arm64-windows - - name: Linux (GCC x64) + - name: Linux x64 / GCC os: ubuntu-latest preset: gcc-linux-x64 vcpkg_triplet: x64-linux-dynamic - - name: Linux (Clang x64) + - name: Linux x64 / Clang os: ubuntu-latest preset: clang-linux-x64 vcpkg_triplet: x64-linux-dynamic - - name: Linux ARM64 (GCC) + - name: Linux ARM64 / GCC os: ubuntu-24.04-arm preset: gcc-linux-arm64 vcpkg_triplet: arm64-linux - - name: macOS ARM64 (Clang) + - name: macOS ARM64 / AppleClang os: macos-latest preset: apple-clang-macos-arm64 vcpkg_triplet: arm64-osx @@ -58,13 +58,6 @@ jobs: shell: bash run: echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV - - name: Install Clang 18 - if: matrix.preset == 'clang-linux-x64' - run: | - sudo apt-get install -y clang-18 - sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100 - sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100 - - name: Install GTest run: vcpkg install gtest:${{ matrix.vcpkg_triplet }} diff --git a/include/pvm/codegen/macro_assembler.h b/include/pvm/codegen/macro_assembler.h index 7dd399a..6f1e39c 100644 --- a/include/pvm/codegen/macro_assembler.h +++ b/include/pvm/codegen/macro_assembler.h @@ -45,14 +45,14 @@ namespace ngu::pvm { // dst = 0 consteval auto ZERO(const arch::reg dst) const { - return detail::insn_seq{ + return detail::instruction_sequence{ XOR(dst, operand(dst)) }; } // dst = -dst (two's complement) consteval auto NEG(const arch::reg dst) const { - return detail::insn_seq{ + return detail::instruction_sequence{ NOT(dst), ADD(dst, operand(1u)) }; @@ -60,7 +60,7 @@ namespace ngu::pvm { // dst = src (via xor+or) consteval auto MOVC(const arch::reg dst, const arch::reg src) const { - return detail::insn_seq{ + return detail::instruction_sequence{ XOR(dst, operand(dst)), OR(dst, operand(src)) }; @@ -68,7 +68,7 @@ namespace ngu::pvm { // dst = (hi << 32) | lo consteval auto MOV64(const arch::reg dst, std::uint32_t hi, std::uint32_t lo) const { - return detail::insn_seq{ + return detail::instruction_sequence{ MOV(dst, operand(hi)), SHL(dst, operand(32u)), OR(dst, operand(lo)) @@ -77,7 +77,7 @@ namespace ngu::pvm { // swap a, b without temp consteval auto SWAP(const arch::reg a, const arch::reg b) const { - return detail::insn_seq{ + return detail::instruction_sequence{ XOR(a, operand(b)), XOR(b, operand(a)), XOR(a, operand(b)) @@ -86,7 +86,7 @@ namespace ngu::pvm { // dst = |dst| (signed). scratch is clobbered. consteval auto ABS(const arch::reg dst, const arch::reg scratch, std::uint32_t label_id) const { - return detail::insn_seq{ + return detail::instruction_sequence{ MOV(scratch, operand(dst)), SHR(scratch, operand(63u)), // scratch = 1 if negative, 0 if positive/zero CMP(scratch, operand(0u)), @@ -99,7 +99,7 @@ namespace ngu::pvm { // a = min(a, b) unsigned. scratch is clobbered. consteval auto MIN(const arch::reg a, const arch::reg b, const arch::reg scratch, std::uint32_t label_id) const { - return detail::insn_seq{ + return detail::instruction_sequence{ CMP(a, operand(b)), // bit0=EQ, bit1=LT(a> bit) & 1 == 0 consteval auto TEST_BIT(const arch::reg src, const arch::reg scratch, std::uint8_t bit) const { - return detail::insn_seq{ + return detail::instruction_sequence{ MOV(scratch, operand(1u)), SHL(scratch, operand(bit)), AND(scratch, operand(src)), @@ -204,21 +204,21 @@ namespace ngu::pvm { // dst &= (1 << n) - 1 consteval auto MASK_LO(const arch::reg dst, std::uint8_t n) const { - return detail::insn_seq{ + return detail::instruction_sequence{ AND(dst, operand((1ull << n) - 1)) }; } // dst &= ~((1 << n) - 1) consteval auto CLEAR_LO(const arch::reg dst, std::uint8_t n) const { - return detail::insn_seq{ + return detail::instruction_sequence{ AND(dst, operand(~((1ull << n) - 1))) }; } // scratch = (src >> idx*8) & 0xFF consteval auto EXTRACT_BYTE(const arch::reg src, const arch::reg scratch, std::uint8_t idx) const { - return detail::insn_seq{ + return detail::instruction_sequence{ MOV(scratch, operand(src)), SHR(scratch, operand(static_cast(idx * 8u))), AND(scratch, operand(0xFFu)) @@ -227,7 +227,7 @@ namespace ngu::pvm { // dst |= (scratch & 0xFF) << idx*8 consteval auto INSERT_BYTE(const arch::reg dst, const arch::reg scratch, std::uint8_t idx) const { - return detail::insn_seq{ + return detail::instruction_sequence{ AND(scratch, operand(0xFFu)), SHL(scratch, operand(static_cast(idx * 8u))), OR(dst, operand(scratch)) @@ -236,14 +236,14 @@ namespace ngu::pvm { // dst = swap upper/lower 16 bits consteval auto ROT16(const arch::reg dst) const { - return detail::insn_seq{ + return detail::instruction_sequence{ ROL(dst, operand(16u)) }; } // dst = byte-reverse dst consteval auto BSWAP32(const arch::reg dst, const arch::reg s1, const arch::reg s2) const { - return detail::insn_seq{ + return detail::instruction_sequence{ MOV(s1, operand(dst)), AND(s1, operand(0xFFu)), SHL(s1, operand(24u)), @@ -266,7 +266,7 @@ namespace ngu::pvm { // a += b; c ^= a; c <<<= n consteval auto ARX(const arch::reg a, const arch::reg b, const arch::reg c, std::uint8_t rot) const { - return detail::insn_seq{ + return detail::instruction_sequence{ ADD(a, operand(b)), XOR(c, operand(a)), ROL(c, operand(rot)) @@ -275,7 +275,7 @@ namespace ngu::pvm { // a ^= b; a <<<= n consteval auto XR(const arch::reg a, const arch::reg b, std::uint8_t rot) const { - return detail::insn_seq{ + return detail::instruction_sequence{ XOR(a, operand(b)), ROL(a, operand(rot)) }; @@ -283,7 +283,7 @@ namespace ngu::pvm { // a += b; c ^= a consteval auto AX(const arch::reg a, const arch::reg b, const arch::reg c) const { - return detail::insn_seq{ + return detail::instruction_sequence{ ADD(a, operand(b)), XOR(c, operand(a)) }; @@ -292,7 +292,7 @@ namespace ngu::pvm { // scratch = (v << left) ^ (v >> right) consteval auto XS(const arch::reg v, const arch::reg scratch, const arch::reg tmp, std::uint8_t left, std::uint8_t right) const { - return detail::insn_seq{ + return detail::instruction_sequence{ MOV(scratch, operand(v)), SHL(scratch, operand(left)), MOV(tmp, operand(v)), @@ -303,7 +303,7 @@ namespace ngu::pvm { // counter -= 1; jump to body_label if counter != 0 consteval auto LOOP(const arch::reg counter, std::uint32_t body_label) const { - return detail::insn_seq{ + return detail::instruction_sequence{ SUB(counter, operand(1u)), CMP(counter, operand(0u)), JNEL(body_label) From 552659f949d25f67ec6e81837e099c3f0fb33999 Mon Sep 17 00:00:00 2001 From: nevergiveupcpp Date: Sun, 15 Mar 2026 17:41:00 +0700 Subject: [PATCH 4/4] revert: drop Linux Clang x64 from CI (unsupported CTAD behavior) --- .github/workflows/ci.yml | 5 --- include/pvm/codegen/macro_assembler.h | 54 +++++++++++++-------------- 2 files changed, 27 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b36790..300a0a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,11 +36,6 @@ jobs: preset: gcc-linux-x64 vcpkg_triplet: x64-linux-dynamic - - name: Linux x64 / Clang - os: ubuntu-latest - preset: clang-linux-x64 - vcpkg_triplet: x64-linux-dynamic - - name: Linux ARM64 / GCC os: ubuntu-24.04-arm preset: gcc-linux-arm64 diff --git a/include/pvm/codegen/macro_assembler.h b/include/pvm/codegen/macro_assembler.h index 6f1e39c..7dd399a 100644 --- a/include/pvm/codegen/macro_assembler.h +++ b/include/pvm/codegen/macro_assembler.h @@ -45,14 +45,14 @@ namespace ngu::pvm { // dst = 0 consteval auto ZERO(const arch::reg dst) const { - return detail::instruction_sequence{ + return detail::insn_seq{ XOR(dst, operand(dst)) }; } // dst = -dst (two's complement) consteval auto NEG(const arch::reg dst) const { - return detail::instruction_sequence{ + return detail::insn_seq{ NOT(dst), ADD(dst, operand(1u)) }; @@ -60,7 +60,7 @@ namespace ngu::pvm { // dst = src (via xor+or) consteval auto MOVC(const arch::reg dst, const arch::reg src) const { - return detail::instruction_sequence{ + return detail::insn_seq{ XOR(dst, operand(dst)), OR(dst, operand(src)) }; @@ -68,7 +68,7 @@ namespace ngu::pvm { // dst = (hi << 32) | lo consteval auto MOV64(const arch::reg dst, std::uint32_t hi, std::uint32_t lo) const { - return detail::instruction_sequence{ + return detail::insn_seq{ MOV(dst, operand(hi)), SHL(dst, operand(32u)), OR(dst, operand(lo)) @@ -77,7 +77,7 @@ namespace ngu::pvm { // swap a, b without temp consteval auto SWAP(const arch::reg a, const arch::reg b) const { - return detail::instruction_sequence{ + return detail::insn_seq{ XOR(a, operand(b)), XOR(b, operand(a)), XOR(a, operand(b)) @@ -86,7 +86,7 @@ namespace ngu::pvm { // dst = |dst| (signed). scratch is clobbered. consteval auto ABS(const arch::reg dst, const arch::reg scratch, std::uint32_t label_id) const { - return detail::instruction_sequence{ + return detail::insn_seq{ MOV(scratch, operand(dst)), SHR(scratch, operand(63u)), // scratch = 1 if negative, 0 if positive/zero CMP(scratch, operand(0u)), @@ -99,7 +99,7 @@ namespace ngu::pvm { // a = min(a, b) unsigned. scratch is clobbered. consteval auto MIN(const arch::reg a, const arch::reg b, const arch::reg scratch, std::uint32_t label_id) const { - return detail::instruction_sequence{ + return detail::insn_seq{ CMP(a, operand(b)), // bit0=EQ, bit1=LT(a> bit) & 1 == 0 consteval auto TEST_BIT(const arch::reg src, const arch::reg scratch, std::uint8_t bit) const { - return detail::instruction_sequence{ + return detail::insn_seq{ MOV(scratch, operand(1u)), SHL(scratch, operand(bit)), AND(scratch, operand(src)), @@ -204,21 +204,21 @@ namespace ngu::pvm { // dst &= (1 << n) - 1 consteval auto MASK_LO(const arch::reg dst, std::uint8_t n) const { - return detail::instruction_sequence{ + return detail::insn_seq{ AND(dst, operand((1ull << n) - 1)) }; } // dst &= ~((1 << n) - 1) consteval auto CLEAR_LO(const arch::reg dst, std::uint8_t n) const { - return detail::instruction_sequence{ + return detail::insn_seq{ AND(dst, operand(~((1ull << n) - 1))) }; } // scratch = (src >> idx*8) & 0xFF consteval auto EXTRACT_BYTE(const arch::reg src, const arch::reg scratch, std::uint8_t idx) const { - return detail::instruction_sequence{ + return detail::insn_seq{ MOV(scratch, operand(src)), SHR(scratch, operand(static_cast(idx * 8u))), AND(scratch, operand(0xFFu)) @@ -227,7 +227,7 @@ namespace ngu::pvm { // dst |= (scratch & 0xFF) << idx*8 consteval auto INSERT_BYTE(const arch::reg dst, const arch::reg scratch, std::uint8_t idx) const { - return detail::instruction_sequence{ + return detail::insn_seq{ AND(scratch, operand(0xFFu)), SHL(scratch, operand(static_cast(idx * 8u))), OR(dst, operand(scratch)) @@ -236,14 +236,14 @@ namespace ngu::pvm { // dst = swap upper/lower 16 bits consteval auto ROT16(const arch::reg dst) const { - return detail::instruction_sequence{ + return detail::insn_seq{ ROL(dst, operand(16u)) }; } // dst = byte-reverse dst consteval auto BSWAP32(const arch::reg dst, const arch::reg s1, const arch::reg s2) const { - return detail::instruction_sequence{ + return detail::insn_seq{ MOV(s1, operand(dst)), AND(s1, operand(0xFFu)), SHL(s1, operand(24u)), @@ -266,7 +266,7 @@ namespace ngu::pvm { // a += b; c ^= a; c <<<= n consteval auto ARX(const arch::reg a, const arch::reg b, const arch::reg c, std::uint8_t rot) const { - return detail::instruction_sequence{ + return detail::insn_seq{ ADD(a, operand(b)), XOR(c, operand(a)), ROL(c, operand(rot)) @@ -275,7 +275,7 @@ namespace ngu::pvm { // a ^= b; a <<<= n consteval auto XR(const arch::reg a, const arch::reg b, std::uint8_t rot) const { - return detail::instruction_sequence{ + return detail::insn_seq{ XOR(a, operand(b)), ROL(a, operand(rot)) }; @@ -283,7 +283,7 @@ namespace ngu::pvm { // a += b; c ^= a consteval auto AX(const arch::reg a, const arch::reg b, const arch::reg c) const { - return detail::instruction_sequence{ + return detail::insn_seq{ ADD(a, operand(b)), XOR(c, operand(a)) }; @@ -292,7 +292,7 @@ namespace ngu::pvm { // scratch = (v << left) ^ (v >> right) consteval auto XS(const arch::reg v, const arch::reg scratch, const arch::reg tmp, std::uint8_t left, std::uint8_t right) const { - return detail::instruction_sequence{ + return detail::insn_seq{ MOV(scratch, operand(v)), SHL(scratch, operand(left)), MOV(tmp, operand(v)), @@ -303,7 +303,7 @@ namespace ngu::pvm { // counter -= 1; jump to body_label if counter != 0 consteval auto LOOP(const arch::reg counter, std::uint32_t body_label) const { - return detail::instruction_sequence{ + return detail::insn_seq{ SUB(counter, operand(1u)), CMP(counter, operand(0u)), JNEL(body_label)