Skip to content

Bump XSSE version from 1.0.0 to 1.4.0 #18570

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

SakiTakamachi
Copy link
Member

XSSE now supports SSE2, SSE3, SSSE3, SSE4.1, and SSE4.2, so will update to the latest version.

https://github.com/SakiTakamachi/xsse/releases/tag/xsse-1.4.0

@SakiTakamachi SakiTakamachi marked this pull request as ready for review May 16, 2025 08:47
@SakiTakamachi
Copy link
Member Author

cc: @dstogov

@nielsdos
Copy link
Member

I was fine with it when you only hand-rolled a few functions, because then we don't need to import a huge third party library. However, now you implement a lot of functionality anyway.
So if we want to do this, rather than rolling our own library code, why not use something established that is well-tested?

@SakiTakamachi
Copy link
Member Author

SakiTakamachi commented May 19, 2025

@nielsdos

I agree that the scale has grown unexpectedly.
This was done so that it could also be used with Jakub’s jso library.

The two well-known libraries I’m aware of are sse2neon and SIMDe.
However, sse2neon uses its own function names, so using it would require a major rewrite of the code.
SIMDe includes support for not just NEON but also architectures like RISC-V, making it even larger.

Also, one thing both libraries have in common is that they do not implement SSE4.2’s _mm_cmpestr* and _mm_cmpistr* functions.
There are two places in php-src where _mm_cmpestrc is used, so those cannot be replaced using these libraries.

Do you have any good ideas?

By the way, XSSE might also support AVX and AVX2 for use with jso.

@bukka
Copy link
Member

bukka commented May 19, 2025

For my use case (jso), it really doesn't matter what's in the core as I would bundle it in the library (jso) that might be bundled to the core (depending if JsonSchema is accepted for the json extension) so I wouldn't use what's in Zend because the lib is independent. If it's probably that this might get too big, I wouldn't mind bundling alternatives.

Just to give a context I thought that it could be nice to later use something like this for possible future json and utf8 decoding simd improvements so I thought that such library could be useful. But I would integrate it independently...

So maybe it makes sense to have some slim version that is in zend that would contain only what's actually used in PHP (or what is likely to be useful)

@nielsdos
Copy link
Member

Okay sure, I don't object then, but please make sure this vectorized translation layer is well-tested as the results could be disastrous if something is wrong there

@SakiTakamachi
Copy link
Member Author

Thank you both.

For now, I’ve decided not to upgrade the version here. The SSE2 API alone is sufficient to meet my current needs.

If the time comes when I need additional features, I’ll consider upgrading the version then.

@SakiTakamachi SakiTakamachi deleted the bump_xsse_version branch May 19, 2025 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants