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

Compress to the upper lanes #2283

Open
alantudyk opened this issue Jul 26, 2024 · 1 comment
Open

Compress to the upper lanes #2283

alantudyk opened this issue Jul 26, 2024 · 1 comment

Comments

@alantudyk
Copy link

LUT-less AVX2 (pseudo-)code for i32:

const uint32_t mask = _mm256_movemask_epi8(v_reg),
                cnt = __builtin_popcount(mask),
     left_compacted = _pext_u32(0x76543210, mask),
    right_compacted = left_compacted << (32 - cnt);
@jan-wassenberg
Copy link
Member

Hi, are you proposing adding a new op? One concern is that pext is super slow on older AMDs, hence we have been avoiding it.

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

No branches or pull requests

2 participants