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

Make GetIndexBounds friendlier to autovectorization. Works on x86 at least. #18219

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

hrydgard
Copy link
Owner

@hrydgard hrydgard commented Sep 24, 2023

Not all games use indexed draws at all, but should be a small boost for those that do and draw a lot of geometry.

Although I noticed I was getting pmaxuw instructions on my machine, which are SSE4.1. Should the compiler really generate those? Weird! (MSVC)

@hrydgard hrydgard added this to the v1.17.0 milestone Sep 24, 2023
@fp64
Copy link
Contributor

fp64 commented Sep 24, 2023

Should the compiler really generate those?

Is it MSVC? Concerning either way.

@fp64
Copy link
Contributor

fp64 commented Sep 24, 2023

Ok, I can reproduce MSVC getting pmaxuw without SSE4: https://godbolt.org/z/KshjqTGGx, but it seems to be doing run-time detection, so it may be fine?

@hrydgard
Copy link
Owner Author

Oh, I didn't read the disassembly very carefully (I just breakpointed and "show disassembly" in MSVC itself, which produces rather hard-to-read output). If it's runtime detected it's good.

@hrydgard hrydgard marked this pull request as ready for review September 24, 2023 22:45
@hrydgard hrydgard merged commit cf48532 into master Sep 29, 2023
18 checks passed
@hrydgard hrydgard deleted the get-index-bounds-autovec branch September 29, 2023 09:31
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.

3 participants