Skip to content

[aarch64] use NEON to initialize zend_hash #4096

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

sebpop
Copy link
Contributor

@sebpop sebpop commented Apr 30, 2019

On A72, google-benchmark measure before and after the patch:

--------------------------------------------------------------
Benchmark                    Time             CPU   Iterations
--------------------------------------------------------------
BM_hash_init_before       43.6 ns         43.6 ns     16052937
BM_hash_init_after        27.0 ns         27.0 ns     25877296

Patch written by Ali Saidi [email protected]
and Sebastian Pop [email protected]

@nikic
Copy link
Member

nikic commented May 2, 2019

Does AArch64 always have NEON?

@sebpop
Copy link
Contributor Author

sebpop commented May 2, 2019

Does AArch64 always have NEON?

Yes, ARMv8 aka. aarch64 always has NEON. However ARMv7 may or may not have NEON, and needs a runtime check.

On A72, google-benchmark measure before and after the patch:
--------------------------------------------------------------
Benchmark                    Time             CPU   Iterations
--------------------------------------------------------------
BM_hash_init_before       43.6 ns         43.6 ns     16052937
BM_hash_init_after        27.0 ns         27.0 ns     25877296

Patch written by Ali Saidi <[email protected]>
and Sebastian Pop <[email protected]>
@nikic
Copy link
Member

nikic commented May 7, 2019

Merged as 6fad150 into 7.4. Thanks!

@nikic nikic closed this May 7, 2019
shqking added a commit to shqking/php-src that referenced this pull request Jun 17, 2021
As pointed out by MikePall in [1], shifted immediate value is supported.
See [2]. For example, `add x0, x1, php#4096` would be encoded by DynASM
into `add x0, x1, php#1, lsl php#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 php#12 on all the
values from the first range.

Note that this helper works for add/adds/sub/subs/cmp/cmn instructions.

[1] LuaJIT/LuaJIT#718
[2]
https://github.com/LuaJIT/LuaJIT/blob/v2.1/dynasm/dasm_arm64.lua#L342

Change-Id: I4870048b9b8e6c429b73a4803af2a3b2d5ec0fbb
shqking added a commit that referenced this pull request Jun 23, 2021
* JIT/AArch64: Support shifted immediate

As pointed out by MikePall in [1], shifted immediate value is supported.
See [2]. For example, `add x0, x1, #4096` would be encoded by DynASM
into `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.

[1] LuaJIT/LuaJIT#718
[2]
https://github.com/LuaJIT/LuaJIT/blob/v2.1/dynasm/dasm_arm64.lua#L342

Change-Id: I4870048b9b8e6c429b73a4803af2a3b2d5ec0fbb

* Deprecatd CMP_IMM/ADD_SUB_IMM and add test cases

Macros CMP_IMM and ADD_SUB_IMM are deprecated and instead we use
this helper to guard the immediate encoding.

Add two 64-bit only test cases, since 64-bit integers are used
and tested inside.

Change-Id: I0b42d4617b40372e2f4ce5b6ad31a4ddb7d89e49
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