JIT/AArch64: Use 'tbnz/tbz' to check the signedness #7123
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
'tbnz/tbz' instruction can be used to check whether a given W or X
register value is negative or positive.
For example,
tst x0, x0; blt >1
can be optimized as
tbnz x0, #63, >1
It's important to note that the jump range of 'tbnz/tbz' is limited, and
it's better NOT to use 'tbnz/tbz' if the target of 'b.cond' is a label
in section .cold_code or a global label, such as the instruction
sequence
tst RETVALw, RETVALw; blt ->trace_halt
at functionzend_jit_trace_exit_stub(), and the instruction sequence
tst REG0, REG0; blt >7
at function zend_jit_incdec_obj().Minor updates:
Use macros BW_OP_32_WITH_CONST and GC_ADDREF at function
zend_jit_push_call_frame().
Test: all ~4k .phpt test cases under
tests/ Zend/tests/ ext/opcache/tests/jit/
can pass for Linux JIT/arm64.Note that in total 8 JIT variants are tested, covering ZTS/nonZTS, HYBRID/VM, and functional/tracing JIT.
Change-Id: I1597609bdabf55ea2f9d24528e7a037bc3e5c3a1