Skip to content

fix(compiler): add large-offset 64-bit address path to handleStoreImpl#426

Open
cmgCr wants to merge 2 commits intoDTVMStack:mainfrom
cmgCr:cmgCr/fix_issuse421
Open

fix(compiler): add large-offset 64-bit address path to handleStoreImpl#426
cmgCr wants to merge 2 commits intoDTVMStack:mainfrom
cmgCr:cmgCr/fix_issuse421

Conversation

@cmgCr
Copy link
Copy Markdown
Contributor

@cmgCr cmgCr commented Mar 20, 2026

1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):

2. What is the scope of this PR (e.g. component or file name):

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

  • Affects user behaviors
  • Contains CI/CD configuration changes
  • Contains documentation changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

6. Release note

None

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 20, 2026

⚡ Performance Regression Check Results

✅ Performance Check Passed (interpreter)

Performance Benchmark Results (threshold: 25%)

Benchmark Baseline (us) Current (us) Change Status
total/main/blake2b_huff/8415nulls 1.49 1.50 +0.7% PASS
total/main/blake2b_huff/empty 0.02 0.02 +1.1% PASS
total/main/blake2b_shifts/8415nulls 11.60 11.63 +0.3% PASS
total/main/sha1_divs/5311 5.10 5.08 -0.3% PASS
total/main/sha1_divs/empty 0.06 0.06 -0.0% PASS
total/main/sha1_shifts/5311 2.83 2.83 +0.1% PASS
total/main/sha1_shifts/empty 0.04 0.03 -3.1% PASS
total/main/snailtracer/benchmark 52.38 52.83 +0.9% PASS
total/main/structarray_alloc/nfts_rank 1.04 1.03 -0.0% PASS
total/main/swap_math/insufficient_liquidity 0.00 0.00 +0.7% PASS
total/main/swap_math/received 0.01 0.01 +0.6% PASS
total/main/swap_math/spent 0.00 0.00 +1.6% PASS
total/main/weierstrudel/1 0.29 0.29 -0.3% PASS
total/main/weierstrudel/15 3.17 3.16 -0.2% PASS
total/micro/JUMPDEST_n0/empty 1.67 2.12 +27.0% PASS
total/micro/jump_around/empty 0.09 0.10 +5.9% PASS
total/micro/loop_with_many_jumpdests/empty 28.10 32.05 +14.1% PASS
total/micro/memory_grow_mload/by1 0.09 0.09 +1.5% PASS
total/micro/memory_grow_mload/by16 0.10 0.10 +5.1% PASS
total/micro/memory_grow_mload/by32 0.11 0.11 +0.5% PASS
total/micro/memory_grow_mload/nogrow 0.09 0.09 -0.0% PASS
total/micro/memory_grow_mstore/by1 0.09 0.09 +1.3% PASS
total/micro/memory_grow_mstore/by16 0.11 0.11 +0.5% PASS
total/micro/memory_grow_mstore/by32 0.12 0.12 +0.3% PASS
total/micro/memory_grow_mstore/nogrow 0.09 0.09 +3.9% PASS
total/micro/signextend/one 0.24 0.24 +1.4% PASS
total/micro/signextend/zero 0.24 0.24 +1.3% PASS
total/synth/ADD/b0 3.52 3.48 -1.3% PASS
total/synth/ADD/b1 2.00 2.00 +0.2% PASS
total/synth/ADDRESS/a0 4.82 4.83 +0.0% PASS
total/synth/ADDRESS/a1 5.27 5.29 +0.3% PASS
total/synth/AND/b0 1.64 1.64 -0.1% PASS
total/synth/AND/b1 1.70 1.70 +0.1% PASS
total/synth/BYTE/b0 6.04 6.02 -0.3% PASS
total/synth/BYTE/b1 4.73 4.79 +1.3% PASS
total/synth/CALLDATASIZE/a0 3.19 3.20 +0.3% PASS
total/synth/CALLDATASIZE/a1 4.04 4.05 +0.2% PASS
total/synth/CALLER/a0 4.83 4.83 -0.0% PASS
total/synth/CALLER/a1 5.37 5.38 +0.3% PASS
total/synth/CALLVALUE/a0 3.02 3.03 +0.2% PASS
total/synth/CALLVALUE/a1 3.36 3.36 +0.3% PASS
total/synth/CODESIZE/a0 3.43 3.43 +0.0% PASS
total/synth/CODESIZE/a1 3.76 3.77 +0.3% PASS
total/synth/DUP1/d0 1.06 1.07 +0.2% PASS
total/synth/DUP1/d1 1.23 1.23 -0.0% PASS
total/synth/DUP10/d0 0.83 1.07 +29.2% PASS
total/synth/DUP10/d1 1.15 1.16 +0.4% PASS
total/synth/DUP11/d0 1.07 1.07 +0.2% PASS
total/synth/DUP11/d1 1.15 1.16 +0.3% PASS
total/synth/DUP12/d0 0.83 1.07 +28.6% PASS
total/synth/DUP12/d1 0.96 1.16 +20.9% PASS
total/synth/DUP13/d0 1.07 0.83 -22.4% PASS
total/synth/DUP13/d1 1.15 1.16 +0.3% PASS
total/synth/DUP14/d0 1.07 1.07 -0.1% PASS
total/synth/DUP14/d1 0.97 1.16 +19.6% PASS
total/synth/DUP15/d0 1.07 0.83 -22.3% PASS
total/synth/DUP15/d1 0.94 1.16 +22.8% PASS
total/synth/DUP16/d0 1.07 0.83 -22.3% PASS
total/synth/DUP16/d1 0.97 1.16 +19.3% PASS
total/synth/DUP2/d0 1.07 1.06 -0.3% PASS
total/synth/DUP2/d1 0.95 1.16 +22.4% PASS
total/synth/DUP3/d0 1.07 1.07 +0.1% PASS
total/synth/DUP3/d1 0.95 1.16 +21.4% PASS
total/synth/DUP4/d0 1.07 1.07 +0.1% PASS
total/synth/DUP4/d1 0.96 1.16 +19.9% PASS
total/synth/DUP5/d0 1.07 1.07 -0.0% PASS
total/synth/DUP5/d1 1.15 1.16 +0.2% PASS
total/synth/DUP6/d0 0.83 0.83 -0.2% PASS
total/synth/DUP6/d1 0.96 1.16 +20.3% PASS
total/synth/DUP7/d0 1.06 0.83 -22.3% PASS
total/synth/DUP7/d1 0.97 1.16 +19.7% PASS
total/synth/DUP8/d0 1.07 1.07 -0.1% PASS
total/synth/DUP8/d1 1.15 1.16 +0.2% PASS
total/synth/DUP9/d0 1.07 1.07 +0.2% PASS
total/synth/DUP9/d1 1.15 1.16 +0.2% PASS
total/synth/EQ/b0 2.73 2.73 -0.0% PASS
total/synth/EQ/b1 1.39 1.39 +0.2% PASS
total/synth/GAS/a0 3.67 3.67 +0.1% PASS
total/synth/GAS/a1 3.60 3.69 +2.3% PASS
total/synth/GT/b0 2.61 2.61 -0.0% PASS
total/synth/GT/b1 1.39 1.39 +0.2% PASS
total/synth/ISZERO/u0 0.99 0.99 +0.1% PASS
total/synth/JUMPDEST/n0 1.92 1.95 +1.5% PASS
total/synth/LT/b0 2.67 2.67 +0.0% PASS
total/synth/LT/b1 1.39 1.39 +0.1% PASS
total/synth/MSIZE/a0 4.25 4.25 -0.1% PASS
total/synth/MSIZE/a1 4.65 4.66 +0.2% PASS
total/synth/MUL/b0 5.30 5.30 +0.0% PASS
total/synth/MUL/b1 5.29 5.29 +0.0% PASS
total/synth/NOT/u0 1.68 1.68 -0.4% PASS
total/synth/OR/b0 1.63 1.63 +0.0% PASS
total/synth/OR/b1 1.71 1.71 +0.0% PASS
total/synth/PC/a0 3.18 3.18 -0.1% PASS
total/synth/PC/a1 4.03 4.03 +0.1% PASS
total/synth/PUSH1/p0 0.83 0.83 -0.6% PASS
total/synth/PUSH1/p1 1.13 1.14 +0.3% PASS
total/synth/PUSH10/p0 0.83 0.85 +2.5% PASS
total/synth/PUSH10/p1 1.23 1.21 -1.6% PASS
total/synth/PUSH11/p0 0.84 0.85 +0.4% PASS
total/synth/PUSH11/p1 1.21 1.21 -0.0% PASS
total/synth/PUSH12/p0 0.85 0.83 -1.9% PASS
total/synth/PUSH12/p1 1.23 1.22 -0.8% PASS
total/synth/PUSH13/p0 0.85 0.85 +0.1% PASS
total/synth/PUSH13/p1 1.21 1.19 -1.2% PASS
total/synth/PUSH14/p0 0.90 0.92 +2.9% PASS
total/synth/PUSH14/p1 1.23 1.23 +0.0% PASS
total/synth/PUSH15/p0 0.85 0.83 -1.9% PASS
total/synth/PUSH15/p1 1.29 1.31 +2.0% PASS
total/synth/PUSH16/p0 0.83 0.83 +0.4% PASS
total/synth/PUSH16/p1 1.23 1.23 +0.3% PASS
total/synth/PUSH17/p0 0.85 0.80 -5.0% PASS
total/synth/PUSH17/p1 1.21 1.21 -0.0% PASS
total/synth/PUSH18/p0 0.83 0.85 +2.0% PASS
total/synth/PUSH18/p1 1.23 1.23 +0.1% PASS
total/synth/PUSH19/p0 0.84 0.85 +1.0% PASS
total/synth/PUSH19/p1 1.22 1.21 -1.0% PASS
total/synth/PUSH2/p0 0.83 0.84 +0.4% PASS
total/synth/PUSH2/p1 1.15 1.15 -0.3% PASS
total/synth/PUSH20/p0 0.83 0.83 -0.0% PASS
total/synth/PUSH20/p1 1.23 1.21 -1.3% PASS
total/synth/PUSH21/p0 1.07 0.83 -21.9% PASS
total/synth/PUSH21/p1 1.21 1.21 +0.8% PASS
total/synth/PUSH22/p0 0.86 0.84 -2.2% PASS
total/synth/PUSH22/p1 1.23 1.22 -1.2% PASS
total/synth/PUSH23/p0 0.85 0.84 -1.9% PASS
total/synth/PUSH23/p1 1.21 1.24 +2.2% PASS
total/synth/PUSH24/p0 1.07 0.83 -22.3% PASS
total/synth/PUSH24/p1 1.24 1.21 -2.1% PASS
total/synth/PUSH25/p0 0.85 0.85 +0.4% PASS
total/synth/PUSH25/p1 1.21 1.22 +0.2% PASS
total/synth/PUSH26/p0 0.83 0.83 +0.4% PASS
total/synth/PUSH26/p1 1.22 1.24 +2.0% PASS
total/synth/PUSH27/p0 0.85 0.85 -0.1% PASS
total/synth/PUSH27/p1 1.24 1.22 -1.3% PASS
total/synth/PUSH28/p0 0.83 0.83 +0.6% PASS
total/synth/PUSH28/p1 1.24 1.23 -0.7% PASS
total/synth/PUSH29/p0 0.85 0.83 -2.2% PASS
total/synth/PUSH29/p1 1.22 1.22 +0.4% PASS
total/synth/PUSH3/p0 0.84 0.84 +0.1% PASS
total/synth/PUSH3/p1 1.21 1.21 -0.7% PASS
total/synth/PUSH30/p0 0.94 0.97 +3.0% PASS
total/synth/PUSH30/p1 1.23 1.22 -1.1% PASS
total/synth/PUSH31/p0 0.85 0.81 -5.0% PASS
total/synth/PUSH31/p1 1.32 1.31 -0.6% PASS
total/synth/PUSH32/p0 0.83 0.85 +2.3% PASS
total/synth/PUSH32/p1 1.25 1.23 -1.7% PASS
total/synth/PUSH4/p0 0.84 0.82 -2.7% PASS
total/synth/PUSH4/p1 1.20 1.21 +1.0% PASS
total/synth/PUSH5/p0 0.84 1.07 +27.6% PASS
total/synth/PUSH5/p1 1.21 1.21 +0.1% PASS
total/synth/PUSH6/p0 0.85 0.85 -0.6% PASS
total/synth/PUSH6/p1 1.23 1.23 -0.4% PASS
total/synth/PUSH7/p0 0.84 0.83 -1.9% PASS
total/synth/PUSH7/p1 1.23 1.22 -0.9% PASS
total/synth/PUSH8/p0 0.83 1.07 +28.3% PASS
total/synth/PUSH8/p1 1.21 1.23 +1.7% PASS
total/synth/PUSH9/p0 0.85 1.07 +26.5% PASS
total/synth/PUSH9/p1 1.21 1.21 -0.0% PASS
total/synth/RETURNDATASIZE/a0 3.26 3.59 +10.0% PASS
total/synth/RETURNDATASIZE/a1 3.59 3.61 +0.4% PASS
total/synth/SAR/b0 3.77 3.77 -0.0% PASS
total/synth/SAR/b1 4.27 4.27 +0.1% PASS
total/synth/SGT/b0 2.60 2.60 +0.0% PASS
total/synth/SGT/b1 1.63 1.63 +0.0% PASS
total/synth/SHL/b0 3.05 3.05 -0.1% PASS
total/synth/SHL/b1 1.64 1.64 +0.1% PASS
total/synth/SHR/b0 3.10 3.10 +0.0% PASS
total/synth/SHR/b1 1.51 1.52 +0.4% PASS
total/synth/SIGNEXTEND/b0 3.37 3.37 -0.1% PASS
total/synth/SIGNEXTEND/b1 3.53 3.56 +1.0% PASS
total/synth/SLT/b0 2.58 2.58 -0.0% PASS
total/synth/SLT/b1 1.63 1.63 +0.0% PASS
total/synth/SUB/b0 1.94 1.94 -0.0% PASS
total/synth/SUB/b1 1.97 1.98 +0.3% PASS
total/synth/SWAP1/s0 1.49 1.49 -0.0% PASS
total/synth/SWAP10/s0 1.50 1.50 +0.1% PASS
total/synth/SWAP11/s0 1.50 1.50 +0.0% PASS
total/synth/SWAP12/s0 1.51 1.51 +0.2% PASS
total/synth/SWAP13/s0 1.51 1.51 +0.0% PASS
total/synth/SWAP14/s0 1.51 1.51 -0.0% PASS
total/synth/SWAP15/s0 1.52 1.51 -0.4% PASS
total/synth/SWAP16/s0 1.51 1.51 -0.0% PASS
total/synth/SWAP2/s0 1.49 1.49 +0.0% PASS
total/synth/SWAP3/s0 1.49 1.49 +0.0% PASS
total/synth/SWAP4/s0 1.49 1.49 -0.0% PASS
total/synth/SWAP5/s0 1.49 1.49 -0.2% PASS
total/synth/SWAP6/s0 1.49 1.50 +0.0% PASS
total/synth/SWAP7/s0 1.50 1.50 +0.0% PASS
total/synth/SWAP8/s0 1.53 1.50 -1.6% PASS
total/synth/SWAP9/s0 1.50 1.50 -0.1% PASS
total/synth/XOR/b0 1.55 1.55 +0.1% PASS
total/synth/XOR/b1 1.55 1.55 +0.3% PASS
total/synth/loop_v1 4.74 4.98 +5.0% PASS
total/synth/loop_v2 4.74 4.74 +0.0% PASS

Summary: 194 benchmarks, 0 regressions


✅ Performance Check Passed (multipass)

Performance Benchmark Results (threshold: 25%)

Benchmark Baseline (us) Current (us) Change Status
total/main/blake2b_huff/8415nulls 1.52 1.56 +2.4% PASS
total/main/blake2b_huff/empty 0.07 0.07 -0.2% PASS
total/main/blake2b_shifts/8415nulls 5.29 5.27 -0.3% PASS
total/main/sha1_divs/5311 1.90 1.90 -0.0% PASS
total/main/sha1_divs/empty 0.03 0.03 +0.0% PASS
total/main/sha1_shifts/5311 2.77 2.76 -0.0% PASS
total/main/sha1_shifts/empty 0.04 0.04 -0.2% PASS
total/main/snailtracer/benchmark 52.67 52.63 -0.1% PASS
total/main/structarray_alloc/nfts_rank 0.29 0.29 -0.0% PASS
total/main/swap_math/insufficient_liquidity 0.02 0.02 +0.2% PASS
total/main/swap_math/received 0.02 0.02 -0.2% PASS
total/main/swap_math/spent 0.02 0.02 +0.3% PASS
total/main/weierstrudel/1 0.37 0.36 -2.0% PASS
total/main/weierstrudel/15 3.23 3.23 -0.0% PASS
total/micro/JUMPDEST_n0/empty 0.14 0.13 -1.3% PASS
total/micro/jump_around/empty 0.63 0.62 -1.1% PASS
total/micro/loop_with_many_jumpdests/empty 1.95 1.96 +0.2% PASS
total/micro/memory_grow_mload/by1 0.18 0.18 +0.0% PASS
total/micro/memory_grow_mload/by16 0.20 0.19 -0.7% PASS
total/micro/memory_grow_mload/by32 0.21 0.22 +1.7% PASS
total/micro/memory_grow_mload/nogrow 0.18 0.18 -1.1% PASS
total/micro/memory_grow_mstore/by1 0.19 0.19 +0.1% PASS
total/micro/memory_grow_mstore/by16 0.20 0.20 +0.0% PASS
total/micro/memory_grow_mstore/by32 0.22 0.22 +0.1% PASS
total/micro/memory_grow_mstore/nogrow 0.18 0.18 +0.0% PASS
total/micro/signextend/one 0.35 0.35 +0.2% PASS
total/micro/signextend/zero 0.35 0.35 +0.3% PASS
total/synth/ADD/b0 0.01 0.01 -0.2% PASS
total/synth/ADD/b1 0.01 0.01 +0.0% PASS
total/synth/ADDRESS/a0 0.16 0.16 +0.2% PASS
total/synth/ADDRESS/a1 0.16 0.16 -0.0% PASS
total/synth/AND/b0 0.01 0.01 -0.2% PASS
total/synth/AND/b1 0.01 0.01 +0.1% PASS
total/synth/BYTE/b0 1.95 1.95 -0.0% PASS
total/synth/BYTE/b1 2.35 2.35 +0.2% PASS
total/synth/CALLDATASIZE/a0 0.08 0.08 -2.8% PASS
total/synth/CALLDATASIZE/a1 0.08 0.08 -2.4% PASS
total/synth/CALLER/a0 0.16 0.16 +0.0% PASS
total/synth/CALLER/a1 0.16 0.16 -0.0% PASS
total/synth/CALLVALUE/a0 0.27 0.27 +0.0% PASS
total/synth/CALLVALUE/a1 0.28 0.28 -0.2% PASS
total/synth/CODESIZE/a0 0.08 0.08 +0.1% PASS
total/synth/CODESIZE/a1 0.08 0.08 +0.2% PASS
total/synth/DUP1/d0 0.01 0.01 +0.0% PASS
total/synth/DUP1/d1 0.01 0.01 +0.1% PASS
total/synth/DUP10/d0 0.01 0.01 +0.1% PASS
total/synth/DUP10/d1 0.01 0.01 +0.0% PASS
total/synth/DUP11/d0 0.01 0.01 +0.3% PASS
total/synth/DUP11/d1 0.01 0.01 -0.1% PASS
total/synth/DUP12/d0 0.01 0.01 +0.1% PASS
total/synth/DUP12/d1 0.01 0.01 +0.1% PASS
total/synth/DUP13/d0 0.01 0.01 +0.0% PASS
total/synth/DUP13/d1 0.01 0.01 -0.1% PASS
total/synth/DUP14/d0 0.01 0.01 +0.1% PASS
total/synth/DUP14/d1 0.01 0.01 +0.0% PASS
total/synth/DUP15/d0 0.01 0.01 -1.0% PASS
total/synth/DUP15/d1 0.01 0.01 +0.3% PASS
total/synth/DUP16/d0 0.01 0.01 -0.0% PASS
total/synth/DUP16/d1 0.01 0.01 +0.0% PASS
total/synth/DUP2/d0 0.01 0.01 +0.1% PASS
total/synth/DUP2/d1 0.01 0.01 +0.0% PASS
total/synth/DUP3/d0 0.01 0.01 +0.1% PASS
total/synth/DUP3/d1 0.01 0.01 +0.1% PASS
total/synth/DUP4/d0 0.01 0.01 -0.0% PASS
total/synth/DUP4/d1 0.01 0.01 +0.1% PASS
total/synth/DUP5/d0 0.01 0.01 -0.0% PASS
total/synth/DUP5/d1 0.01 0.01 +0.2% PASS
total/synth/DUP6/d0 0.01 0.01 +0.0% PASS
total/synth/DUP6/d1 0.01 0.01 -0.0% PASS
total/synth/DUP7/d0 0.01 0.01 -0.6% PASS
total/synth/DUP7/d1 0.01 0.01 +0.2% PASS
total/synth/DUP8/d0 0.01 0.01 +0.1% PASS
total/synth/DUP8/d1 0.01 0.01 +0.1% PASS
total/synth/DUP9/d0 0.01 0.01 -0.1% PASS
total/synth/DUP9/d1 0.01 0.01 +0.1% PASS
total/synth/EQ/b0 0.01 0.01 +0.5% PASS
total/synth/EQ/b1 0.01 0.01 +0.0% PASS
total/synth/GAS/a0 0.80 0.80 +0.0% PASS
total/synth/GAS/a1 0.77 0.77 -0.1% PASS
total/synth/GT/b0 0.01 0.01 +0.0% PASS
total/synth/GT/b1 0.01 0.01 +0.0% PASS
total/synth/ISZERO/u0 0.01 0.01 +0.1% PASS
total/synth/JUMPDEST/n0 0.14 0.13 -1.1% PASS
total/synth/LT/b0 0.01 0.01 +0.0% PASS
total/synth/LT/b1 0.01 0.01 +0.0% PASS
total/synth/MSIZE/a0 0.01 0.01 +0.1% PASS
total/synth/MSIZE/a1 0.01 0.01 +0.1% PASS
total/synth/MUL/b0 0.01 0.01 +0.0% PASS
total/synth/MUL/b1 0.01 0.01 +0.1% PASS
total/synth/NOT/u0 0.01 0.01 +0.1% PASS
total/synth/OR/b0 0.01 0.01 +0.0% PASS
total/synth/OR/b1 0.01 0.01 +0.1% PASS
total/synth/PC/a0 0.01 0.01 +0.1% PASS
total/synth/PC/a1 0.01 0.01 +0.0% PASS
total/synth/PUSH1/p0 0.01 0.01 +0.0% PASS
total/synth/PUSH1/p1 0.01 0.01 +0.1% PASS
total/synth/PUSH10/p0 0.01 0.01 +0.4% PASS
total/synth/PUSH10/p1 0.01 0.01 +0.0% PASS
total/synth/PUSH11/p0 0.01 0.01 +0.0% PASS
total/synth/PUSH11/p1 0.01 0.01 -0.0% PASS
total/synth/PUSH12/p0 0.01 0.01 -0.0% PASS
total/synth/PUSH12/p1 0.01 0.01 +0.0% PASS
total/synth/PUSH13/p0 0.01 0.01 -0.1% PASS
total/synth/PUSH13/p1 0.01 0.01 +0.0% PASS
total/synth/PUSH14/p0 0.01 0.01 +0.1% PASS
total/synth/PUSH14/p1 0.01 0.01 -0.2% PASS
total/synth/PUSH15/p0 0.01 0.01 -0.9% PASS
total/synth/PUSH15/p1 0.01 0.01 +0.0% PASS
total/synth/PUSH16/p0 0.01 0.01 +0.0% PASS
total/synth/PUSH16/p1 0.01 0.01 +0.1% PASS
total/synth/PUSH17/p0 0.01 0.01 +0.1% PASS
total/synth/PUSH17/p1 0.01 0.01 +0.0% PASS
total/synth/PUSH18/p0 0.01 0.01 -0.1% PASS
total/synth/PUSH18/p1 0.01 0.01 -0.1% PASS
total/synth/PUSH19/p0 0.01 0.01 -0.0% PASS
total/synth/PUSH19/p1 0.01 0.01 -0.0% PASS
total/synth/PUSH2/p0 0.01 0.01 -0.1% PASS
total/synth/PUSH2/p1 0.01 0.01 +0.1% PASS
total/synth/PUSH20/p0 0.01 0.01 +0.1% PASS
total/synth/PUSH20/p1 0.01 0.01 -0.2% PASS
total/synth/PUSH21/p0 0.01 0.01 -0.0% PASS
total/synth/PUSH21/p1 0.01 0.01 +0.0% PASS
total/synth/PUSH22/p0 1.08 1.08 -0.2% PASS
total/synth/PUSH22/p1 1.22 1.25 +2.2% PASS
total/synth/PUSH23/p0 1.08 1.08 -0.1% PASS
total/synth/PUSH23/p1 1.25 1.23 -1.2% PASS
total/synth/PUSH24/p0 1.08 1.08 +0.0% PASS
total/synth/PUSH24/p1 1.25 1.22 -2.5% PASS
total/synth/PUSH25/p0 1.08 1.08 -0.1% PASS
total/synth/PUSH25/p1 1.25 1.22 -2.6% PASS
total/synth/PUSH26/p0 0.85 0.84 -0.9% PASS
total/synth/PUSH26/p1 1.25 1.23 -1.3% PASS
total/synth/PUSH27/p0 1.08 1.08 -0.1% PASS
total/synth/PUSH27/p1 1.26 1.25 -0.5% PASS
total/synth/PUSH28/p0 1.08 1.08 +0.1% PASS
total/synth/PUSH28/p1 1.25 1.25 -0.0% PASS
total/synth/PUSH29/p0 1.08 1.08 -0.0% PASS
total/synth/PUSH29/p1 1.25 1.26 +0.5% PASS
total/synth/PUSH3/p0 0.01 0.01 -0.6% PASS
total/synth/PUSH3/p1 0.01 0.01 +0.1% PASS
total/synth/PUSH30/p0 1.09 1.10 +0.6% PASS
total/synth/PUSH30/p1 1.24 1.27 +2.1% PASS
total/synth/PUSH31/p0 1.08 1.08 -0.1% PASS
total/synth/PUSH31/p1 1.38 1.33 -3.8% PASS
total/synth/PUSH32/p0 1.08 1.08 -0.0% PASS
total/synth/PUSH32/p1 1.24 1.26 +1.6% PASS
total/synth/PUSH4/p0 0.01 0.01 -0.6% PASS
total/synth/PUSH4/p1 0.01 0.01 +0.1% PASS
total/synth/PUSH5/p0 0.01 0.01 -0.0% PASS
total/synth/PUSH5/p1 0.01 0.01 +0.1% PASS
total/synth/PUSH6/p0 0.01 0.01 +0.3% PASS
total/synth/PUSH6/p1 0.01 0.01 -0.0% PASS
total/synth/PUSH7/p0 0.01 0.01 +0.0% PASS
total/synth/PUSH7/p1 0.01 0.01 +0.1% PASS
total/synth/PUSH8/p0 0.01 0.01 -0.1% PASS
total/synth/PUSH8/p1 0.01 0.01 +0.1% PASS
total/synth/PUSH9/p0 0.01 0.01 -0.1% PASS
total/synth/PUSH9/p1 0.01 0.01 -0.1% PASS
total/synth/RETURNDATASIZE/a0 0.53 0.53 +0.1% PASS
total/synth/RETURNDATASIZE/a1 0.49 0.49 -0.1% PASS
total/synth/SAR/b0 3.78 3.78 -0.0% PASS
total/synth/SAR/b1 4.28 4.28 +0.0% PASS
total/synth/SGT/b0 0.01 0.01 -0.0% PASS
total/synth/SGT/b1 0.01 0.01 +0.1% PASS
total/synth/SHL/b0 3.06 3.06 +0.0% PASS
total/synth/SHL/b1 1.64 1.64 +0.3% PASS
total/synth/SHR/b0 3.12 3.12 +0.0% PASS
total/synth/SHR/b1 1.52 1.52 -0.0% PASS
total/synth/SIGNEXTEND/b0 3.40 3.39 -0.3% PASS
total/synth/SIGNEXTEND/b1 3.55 3.55 +0.0% PASS
total/synth/SLT/b0 0.01 0.01 -0.3% PASS
total/synth/SLT/b1 0.01 0.01 +0.1% PASS
total/synth/SUB/b0 0.01 0.01 +0.0% PASS
total/synth/SUB/b1 0.01 0.01 -0.1% PASS
total/synth/SWAP1/s0 0.01 0.01 -0.0% PASS
total/synth/SWAP10/s0 0.01 0.01 +0.0% PASS
total/synth/SWAP11/s0 0.01 0.01 +0.0% PASS
total/synth/SWAP12/s0 0.01 0.01 +0.0% PASS
total/synth/SWAP13/s0 0.01 0.01 +0.1% PASS
total/synth/SWAP14/s0 0.01 0.01 +0.0% PASS
total/synth/SWAP15/s0 0.01 0.01 -0.0% PASS
total/synth/SWAP16/s0 0.01 0.01 -0.0% PASS
total/synth/SWAP2/s0 0.01 0.01 +0.0% PASS
total/synth/SWAP3/s0 0.01 0.01 +0.0% PASS
total/synth/SWAP4/s0 0.01 0.01 -0.0% PASS
total/synth/SWAP5/s0 0.01 0.01 -0.2% PASS
total/synth/SWAP6/s0 0.01 0.01 +0.0% PASS
total/synth/SWAP7/s0 0.01 0.01 +0.0% PASS
total/synth/SWAP8/s0 0.01 0.01 +0.0% PASS
total/synth/SWAP9/s0 0.01 0.01 -0.5% PASS
total/synth/XOR/b0 0.01 0.01 -0.4% PASS
total/synth/XOR/b1 0.01 0.01 -0.0% PASS
total/synth/loop_v1 1.41 1.41 +0.4% PASS
total/synth/loop_v2 1.33 1.33 +0.5% PASS

Summary: 194 benchmarks, 0 regressions


Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a singlepass x86-64 JIT addressing bug for WASM memory ops with very large memarg.offset values (≥ 2GiB) by materializing the full 64-bit effective address instead of relying on disp32 encodings that sign-extend.

Changes:

  • Add an explicit 64-bit effective-address computation path for large offsets in x64 singlepass load/store codegen.
  • Add a new spec-extra WAST regression test covering large-offset in-bounds behavior and a large-offset OOB trap.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
src/singlepass/x64/codegen.h Emits register-based address computation for large offsets to avoid disp32 sign-extension misaddressing.
tests/wast/spec_extra/store_large_offset_false_positive_oob.wast Adds a regression test for large-offset loads/stores near the top of a large memory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1020 to +1028
if (!Base.isImm() && (Offset >= (uint32_t)INT32_MAX)) {
auto MemAddrReg = Layout.getScopedTemp<AddrType, ScopedTempReg2>();
_ mov(X64Reg::getRegRef<X64::I32>(MemAddrReg), Offset);
_ add(X64Reg::getRegRef<X64::I64>(MemAddrReg),
X64Reg::getRegRef<X64::I64>(RegNum));
_ add(X64Reg::getRegRef<X64::I64>(MemAddrReg), ABI.getMemoryBaseReg());
Addr = asmjit::x86::Mem(X64Reg::getRegRef<X64::I64>(MemAddrReg), 0,
getWASMTypeSize<Type>());
}
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like the load path, this large-offset fix only runs when !Base.isImm(). Immediate-base memory ops with offset>=0x80000000 still rely on a disp32 encoding (or the existing INT32_MAX clamping), which can misaddress memory or incorrectly trap on valid accesses. It would be safer to apply the same explicit 64-bit address materialization for the Base.isImm() case too.

Copilot uses AI. Check for mistakes.
Comment on lines +1020 to +1024
if (!Base.isImm() && (Offset >= (uint32_t)INT32_MAX)) {
auto MemAddrReg = Layout.getScopedTemp<AddrType, ScopedTempReg2>();
_ mov(X64Reg::getRegRef<X64::I32>(MemAddrReg), Offset);
_ add(X64Reg::getRegRef<X64::I64>(MemAddrReg),
X64Reg::getRegRef<X64::I64>(RegNum));
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: Offset >= (uint32_t)INT32_MAX triggers the explicit-address slow path one value too early. The disp32 sign bit flips at 0x80000000 (Offset > INT32_MAX), while 0x7fffffff is still a safe positive disp32.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,44 @@
;; Test: f64.store with offset >= INT32_MAX on large memory should NOT trap.
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The opening comment says "offset >= INT32_MAX" but the disp32 sign-extension hazard starts at 0x80000000 (i.e., INT32_MAX + 1). Consider updating the wording to avoid implying that 0x7fffffff is problematic.

Suggested change
;; Test: f64.store with offset >= INT32_MAX on large memory should NOT trap.
;; Test: f64.store with offset >= 0x80000000 (INT32_MAX + 1) on large memory should NOT trap.

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +24
;; dynamic base (memory.size result) + large offset: in-bounds store
(func (export "f64_store_dynamic_base_large_offset")
memory.size
f64.const -5.44203
f64.store offset=4268353288)

;; dynamic base via parameter + large offset: in-bounds store
(func (export "f64_store_param_base_large_offset") (param i32)
local.get 0
f64.const 1.0
f64.store offset=4268353288)
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test exercises large offsets with dynamic bases; to fully cover the disp32 sign-extension regression, consider also adding a case where the base is an immediate constant (e.g., i32.const 0) with an offset>=0x80000000. That hits the Base.isImm() addressing form, which can behave differently in the JIT.

Copilot uses AI. Check for mistakes.
Comment on lines +938 to 946
if (!Base.isImm() && (Offset >= (uint32_t)INT32_MAX)) {
auto MemAddrReg = Layout.getScopedTemp<AddrType, ScopedTempReg2>();
_ mov(X64Reg::getRegRef<X64::I32>(MemAddrReg), Offset);
_ add(X64Reg::getRegRef<X64::I64>(MemAddrReg),
X64Reg::getRegRef<X64::I64>(BaseReg));
_ add(X64Reg::getRegRef<X64::I64>(MemAddrReg), ABI.getMemoryBaseReg());
Addr = asmjit::x86::Mem(X64Reg::getRegRef<X64::I64>(MemAddrReg), 0,
getWASMTypeSize(SrcType));
getWASMTypeSize<SrcType>());
}
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The large-offset handling is gated on !Base.isImm(), but the disp32 sign-extension problem also affects the Base.isImm() addressing form (e.g., i32.const 0; *.load/store offset>=0x80000000). Additionally, the current Base.isImm() path clamps Offset to INT32_MAX, which would miscompile valid in-bounds accesses above 2GiB. Consider extending the 64-bit explicit-address computation to cover immediate bases as well (materialize the full effective address in a GP register and use [reg]), and remove the clamping-as-invalid approach.

Copilot uses AI. Check for mistakes.
Comment on lines +938 to 942
if (!Base.isImm() && (Offset >= (uint32_t)INT32_MAX)) {
auto MemAddrReg = Layout.getScopedTemp<AddrType, ScopedTempReg2>();
_ mov(X64Reg::getRegRef<X64::I32>(MemAddrReg), Offset);
_ add(X64Reg::getRegRef<X64::I64>(MemAddrReg),
X64Reg::getRegRef<X64::I64>(BaseReg));
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Offset >= (uint32_t)INT32_MAX threshold is slightly off for the disp32 sign-extension issue: sign-extension becomes negative starting at 0x80000000 (i.e., Offset > INT32_MAX). Using >= INT32_MAX will unnecessarily take the slower explicit-address path for Offset == 0x7fffffff, which is still representable as a positive disp32.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A bug in singlepass mode

2 participants