-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Support build ext/standard for Windows arm64 #7703
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
Conversation
here is my simple demo using this method: isar0.zip If anyone have win at arm64, please try this and compare if CP4030 it reported matches your ID_AA64ISAR0_EL1 |
First of all, this registry key is not documented and confirmed by other else, so this pr is draft only yet. I'm not sure if all windows supported cpu have crc32 extension. For which cpus are officially supported at this time, this check is unnecessary. ID_AA64ISAR0_EL1 provides information of some cpu supported isa extensions, crc32 is necessary for ARMv8-1 cpus. Reading this register at EL0 is undefined behavior (although it's always work at my environment). ELF/unix provides auxiliary vectors for coder to detect this, Windows have no such mechanism documented, I just find that this registry always holds same value to mac m1 cpu/qemu emulated cpu haves, It may be a coincidence only. I'm waiting for official Microsoft document / technical support about this, you can try the demo above to test this on you own system. |
I've found IsProcessorFeaturePresent Win32API, seems to be ok with this. |
I don't see any issues, the build failure seems to have been fixed in usage of https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-isprocessorfeaturepresent seems reasonable
|
e955827
to
872910b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was the need to resolve some trivial merge conflicts; I did that and force-pushed to retrigger CI.
Generally, this looks good to me. Thank you!
This is a series of work on building php for windows arm64 (cross compile only yet)
ext/standard/crc32.c try to use arm64 crc32 instructions to calculate crc32
This patch used a dirty, not-confirmed method to check if cpu supports these isa extensions:
HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\x\CP 4030
registry seems always hold identical value to ID_AA64ISAR0_EL1 registerTested in windows 11 arm64 macmini vm, qemu simulator "cortex-a57"/"max" cpu, not sure if this always work
see https://docs.microsoft.com/en-us/answers/questions/645412/get-id-aa64isar0-el1-at-windows-arm64.html