diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2024-04-17 17:48:38 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-17 21:48:38 +0000 |
commit | 8b8130153625d551dddc1e1ff28de67ba3830dac (patch) | |
tree | e5521a99653b2e7eeb9348cb069a6118599e45e8 /test/ripper/dummyparser.rb | |
parent | 48846d6b8dad554bda6eded4ef6696c358a2d60b (diff) |
YJIT: A64: Use CBZ/CBNZ to check for zero
* YJIT: A64: Add CBZ and CBNZ encoding functions
* YJIT: A64: Use CBZ/CBNZ to check for zero
Instead of emitting `cmp x0, #0` plus `b.z #target`, A64 offers Compare
and Branch on Zero for us to just do `cbz x0, #target`. This commit
utilizes that and the related CBNZ instruction when appropriate.
We check for zero most commonly in interrupt checks:
```diff
# Insn: 0003 leave (stack_size: 1)
# RUBY_VM_CHECK_INTS(ec)
ldur w11, [x20, #0x20]
-tst w11, w11
-b.ne #0x109002164
+cbnz w11, #0x1049021d0
```
* fix copy paste error
Co-authored-by: Randy Stauner <randy@r4s6.net>
---------
Co-authored-by: Randy Stauner <randy@r4s6.net>
Diffstat (limited to 'test/ripper/dummyparser.rb')
0 files changed, 0 insertions, 0 deletions