Skip to content

Fix narrow signed atomic min/max operand semantics - #12

Merged
gmh5225 merged 2 commits into
masterfrom
codex/arm64-signed-lse-atomics
Oct 5, 2026
Merged

gmh5225 merged 2 commits into
masterfrom
codex/arm64-signed-lse-atomics

Conversation

@gmh5225

@gmh5225 gmh5225 commented Oct 5, 2026 •

Copy link
Copy Markdown

Narrow ARM64 LDSMAX/LDSMIN operations could store the unsigned comparison result: for example, signed byte max(16, -17) stored -17. The nonparallel TCG fallback reused the result-extension flag to choose operand signedness, although ARM returns the old narrow memory value zero-extended.

Keep operand sign extension separate from the original load/store descriptor and returned value. The shared atomic-operation table explicitly marks signed min/max, preserving the parallel helper path and other atomic operations. Direct Unicorn C API regressions cover 64 min/max encodings, six independent operand vectors and four result-register layouts (1,536 executions), including aliases and XZR.

Validation: the original engine failed 384 memory-result checks; the fixed engine passes all 1,536 executions. Complete ARM64, ARM and x86 unit binaries pass, as do NeverD software-backend checks for 168 LSE encodings. No native ARM64 backend execution is claimed by these host tests.

The ARM64 wheel run also exposed an old invalid-jump regression whose one-instruction budget could stop at the jump before the expected target fetch. It now tests that fetch with a bounded timeout instead of depending on translator-specific stop ordering. The corrected regression passes locally.

@gmh5225
gmh5225 merged commit b2efe64 into master Oct 5, 2026
73 of 83 checks passed
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.

2 participants