[php-src] PR #15312: Support SHA256_Transform_shani() with MSVC
| From: | cmb69 | Date: | Fri, 09 Aug 2024 13:25:02 +0000 |
| Subject: | [php-src] PR #15312: Support SHA256_Transform_shani() with MSVC | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-27780@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/15312
Author: cmb69
This requires https://github.com/php/php-src/issues/15292
to be fixed; I've used the same macro guards as proposed by https://github.com/php/php-src/pull/15301.
I've only did most minimal cleanup; given that the implementation apparently does not rely on
HAVE_FUNC_ATTRIBUTE_TARGET, I've removed the forward declaration and changed the
guard.
As is, this does not support compile time __SHA__ detection, because that macro is
apparently never defined on Windows. We would need to work around that in confutils.js like with
other non standard MSVC macros:
https://github.com/php/php-src/blob/bd77462c7c71c096843c624f3f2ad9f589299ecf/win32/build/confutils.js#L3341-L3346
However, I wouldn't know where to insert __SHA__; likely this is
"non-linear", and as such the whole --enable-native-intrinsics might need to
be changed, or an extra configure option be introduced. Probably low priority, since official builds
only use SSE(2) anyway.
Note also that the current implementation appears to be suboptimal since there is neither proper
support for HAVE_FUNC_ATTRIBUTE_TARGET (which is not available with MSVC anyway), nor
for ZEND_INTRIN_*_FUNC_PTR style which is likely supported everywhere.
@TimWolla might want to have a look at this, although for now it's just a draft.