Skip to content

[RV64_DYNAREC] Fixed ANDNPS/ANDNPD/PANDN register reuse conflict in vector path#3883

Merged
ptitSeb merged 1 commit into
ptitSeb:mainfrom
1362525207:bugfix-for-sse-andn
May 22, 2026
Merged

[RV64_DYNAREC] Fixed ANDNPS/ANDNPD/PANDN register reuse conflict in vector path#3883
ptitSeb merged 1 commit into
ptitSeb:mainfrom
1362525207:bugfix-for-sse-andn

Conversation

@1362525207
Copy link
Copy Markdown
Contributor

Fix register reuse conflict in SSE ANDNPS/ANDNPD/PANDN for RV64 vector dynarec.

When Gx and Ex refer to the same register, VXOR_VI clobbers the source value while computing the NOT, causing VAND_VV to operate on incorrect data.

This patch detects the aliasing case and copies the source to a scratch register before applying NOT.

Affected instructions:

  • ANDNPS in dynarec_rv64_0f_vector.c
  • ANDNPD in dynarec_rv64_660f_vector.c
  • PANDN in dynarec_rv64_660f_vector.c

Validation:

  • ctest: 34/34 passed on RV64 hardware.

Comment thread src/dynarec/rv64/dynarec_rv64_0f_vector.c
@ptitSeb ptitSeb merged commit 8b5cc08 into ptitSeb:main May 22, 2026
28 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.

3 participants