Skip to content

fix: preserve x0 for AOT unsigned loads#2854

Open
Kuhai9801 wants to merge 2 commits into
openvm-org:mainfrom
Kuhai9801:rv32im-aot-loads-x0
Open

fix: preserve x0 for AOT unsigned loads#2854
Kuhai9801 wants to merge 2 commits into
openvm-org:mainfrom
Kuhai9801:rv32im-aot-loads-x0

Conversation

@Kuhai9801

@Kuhai9801 Kuhai9801 commented Jun 7, 2026

Copy link
Copy Markdown

Fixes #2853.

Summary

AOT unsigned loads targeting x0 now still perform the memory read but skip the register write. This matches interpreter behavior and RV32IM x0 semantics: the destination register remains zero, but load side effects still occur.

Testing

  • OPENVM_FAST_TEST=1 OPENVM_SKIP_DEBUG=1 cargo test -p openvm-rv32im-circuit --features aot disabled_unsigned_loads_still_emit_memory_read_without_register_write
  • cargo +nightly fmt --all -- --check
  • cargo clippy -p openvm-rv32im-circuit --features aot --all-targets -- -D warnings

@Kuhai9801 Kuhai9801 marked this pull request as ready for review June 8, 2026 13:45

@GunaDD GunaDD left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks for this!

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.

RV32IM AOT unsigned loads write into x0

2 participants