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

Minor improvement for loongarch #1281

Closed
wants to merge 2 commits into from

Conversation

jinboson
Copy link
Contributor

No description provided.

On loongarch, for example simde_mm_srai_epi16, GCC will generate
a vsrai.h instruction for '>>' operator if the imm8 is a real
immediate const value, otherwise it will generate two instructions
vsral.h and vreplgr2vr.h. But for clang it always generates two
instructions. So don't use intrinsics directly, instead let the
compiler itself to generate instructions based on imm8, which will
save one instruction for GCC at least.

Same for below:
simde_mm_srai_epi32
simde_mm_slli_epi[16/32/64]
simde_mm_srli_epi[16/32/64]
simde_mm256_slli_epi[16/32/64]
simde_mm256_srai_epi[16/32]
simde_mm256_srli_epi[16/32/64]
@mr-c
Copy link
Collaborator

mr-c commented Feb 14, 2025

Thanks. I'm going to manually merge this when the final tests pass, because I need to amend the commit messages to mention that this is loongarch specific in the first line.

@jinboson
Copy link
Contributor Author

jinboson commented Feb 14, 2025

Sorry, it's my fault. I can re-push it again to fix this if you don't mind .

@mr-c
Copy link
Collaborator

mr-c commented Feb 14, 2025

@jinboson No worries, I merged 9462b0a 😄

(FYI, you might find it more convenient if you made a branch from master before beginning new work; then you can have multiple branches open at one time. And choosing a descriptive branch name helps maintainers too. It wasn't a problem yet here, but I thought you might like to know )

@mr-c mr-c closed this Feb 14, 2025
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.

2 participants