Skip to content

Conversation

@marxin
Copy link
Contributor

@marxin marxin commented Sep 17, 2025

For the purpose of the upcoming RISC-V support (#5711), I would like to merge the location_cmp/emit_relaxed_cmp and jmp_on_$condition into a single function. Mainly motivated by the fact the RISC-V architecture does not profile the FLAGS register used for the jump instruction. On the other hand, it provides direct compare and jump instructions that, with register operations, directly map to the newly introduced jmp_on_condition. Right now, the RISC-V PR contains unnecessary changes where a new temporary register is first used for comparison, and then jmp_on_true/false function do the actual jump.

Note the currently used approach might be seen tricky as the codegen is responsible that no other FLAGS-modifying instructions sneaks in between the CMP and the consequent JUMP instruction.

@marxin marxin requested a review from syrusakbary as a code owner September 17, 2025 16:13
@syrusakbary
Copy link
Member

This looks good, but I'd like to merge after the 6.1.0 final release

@syrusakbary syrusakbary merged commit ff6bb12 into wasmerio:main Oct 8, 2025
87 of 92 checks passed
@marxin marxin deleted the singlepass-jmp_on_condition branch October 8, 2025 08:04
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