Skip to content

[aarch64] Enable Always and Never Branch patching for TBZ/TBNZ and CBZ/CBNZ - #7281

Merged
ElykDeer merged 1 commit into
devfrom
test_aarch64_enable_always_never_branch_patch_tbz_cbz
Sep 8, 2025
Merged

[aarch64] Enable Always and Never Branch patching for TBZ/TBNZ and CBZ/CBNZ#7281
ElykDeer merged 1 commit into
devfrom
test_aarch64_enable_always_never_branch_patch_tbz_cbz

Conversation

@galenbwill

Copy link
Copy Markdown
Contributor

Addresses #7280

This PR implements the fix, but someone should sign off on this with respect to the following concern:

while i can fix always branch (by forcing it to be a TBZ/CBZ and changing the tested register to the zero XZR/WZR so the branch always happens), its’s not clear to me that it’s “ok”, in the sense that it changes the data dependency of the instruction, from the tested register to the zero register.

@galenbwill galenbwill added Component: Architecture Issue needs changes to an architecture plugin Arch: ARM64 Issues with the AArch64 architecture plugin Impact: Low Issue is a papercut or has a good, supported workaround Effort: Trivial Issues require < 1 day of work labels Aug 15, 2025
@ElykDeer

ElykDeer commented Aug 19, 2025

Copy link
Copy Markdown
Member

I'm okay with the data-flow caveat; x86 will completely nop things out for some branches, and destroys register references in others as well. These changes look fine to me....but would there be any benefit to using a nop in some cases? Unless someone can think of a reason I think it's fine as-is.

@plafosse plafosse added this to the Io milestone Sep 8, 2025
@ElykDeer
ElykDeer merged commit 8a3dc01 into dev Sep 8, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: ARM64 Issues with the AArch64 architecture plugin Component: Architecture Issue needs changes to an architecture plugin Effort: Trivial Issues require < 1 day of work Impact: Low Issue is a papercut or has a good, supported workaround

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants