Skip to content
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

Enable SSE 4.2 builds (image.tostring) #2227

Open
illume opened this issue Oct 22, 2020 · 4 comments
Open

Enable SSE 4.2 builds (image.tostring) #2227

illume opened this issue Oct 22, 2020 · 4 comments
Labels
C code Involves changing C code Performance Related to the speed or resource usage of the project

Comments

@illume
Copy link
Member

illume commented Oct 22, 2020

Need to figure out how to build this with runtime detection.
Otherwise using SSE2 could be an option.

@nthykier
Copy link
Contributor

Had a look at this and as I understand it, the root issue is that we unconditionally passed -msse4.2 to the compiler - allegedly to appease some ancient version of CentOS per #1905 (8894fb2). The #ifdefs were not the issue.

I propose that we bump the gcc version requirements to perform the SSE4.2 build so it excludes the old CentOS compiler but happens with more modern versions.

@illume: Do you remember the version of gcc used or the CentOS version?

@nthykier
Copy link
Contributor

MIght need a bit of #pragma massage before including the instrintics.

https://stackoverflow.com/questions/46165752/does-clang-have-something-like-pragma-gcc-target

@robertpfeiffer
Copy link
Contributor

robertpfeiffer commented Oct 18, 2021

MIght need a bit of #pragma massage before including the instrintics.

https://stackoverflow.com/questions/46165752/does-clang-have-something-like-pragma-gcc-target

Last time I checked, this does not work with MSVC. As far as I can tell, there is no simple way to do this that works in GCC, clang, and MSVC, and that works for ARM and X86 without additional ifdefs.

@ankith26 ankith26 added C code Involves changing C code Performance Related to the speed or resource usage of the project labels Jan 15, 2022
@illume
Copy link
Member Author

illume commented Jan 26, 2022

We've dropped support for SDL1 and older manylinux since this issue was started. So now maybe it will work.

A couple of years ago it was 97%, now SSE 4.2 is at 98.53% on the steam survey. https://store.steampowered.com/hwsurvey Also, it does seem more things require SSE 4.2 now compared to 2020, so probably we can just enable it by default without much damage. For example dosbox requires it since 2021.

I think we can just enable SSE 4.2, and be able to use the nice image.tostring function that @nthykier wrote, and possibly allow @MyreMylar to use SSE 4.2 in blitters.

SSE 4.2 could do 4 pixels at once? Similar to #1715 ? https://en.wikipedia.org/wiki/SSE4#SSE4.2

"several new instructions that perform character searches and comparison on two operands of 16 bytes at a time."

@illume illume changed the title SSE 4.2 builds (image.tostring) Enable SSE 4.2 builds (image.tostring) Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C code Involves changing C code Performance Related to the speed or resource usage of the project
Projects
None yet
Development

No branches or pull requests

4 participants