As pointed out by MikePall in , shifted immediate value is supported.
See . For example,
add x0, x1, #4096 would be encoded by DynASM
add x0, x1, #1, lsl #12 directly.
In this patch, a helper is added to check whether an immediate value is
in the two allowed ranges: (1) 0 to 4095, and (2)
LSL #12 on all the
values from the first range.
Note that this helper works for add/adds/sub/subs/cmp/cmn instructions.
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.