teapotd opened PR #1783 from bitselect-blend to master:
This PR fixes #1187 and adds:
- encoding of
vselecton x86 usingBLEND*instructions- legalization of
vselecttobitselect- simple_preopt transformation that replaces
bitselectwithvselectif possibler? @abrown
teapotd updated PR #1783 from bitselect-blend to master:
This PR fixes #1187 and adds:
- encoding of
vselecton x86 usingBLEND*instructions- legalization of
vselecttobitselect- simple_preopt transformation that replaces
bitselectwithvselectif possibler? @abrown
abrown submitted PR Review.
abrown submitted PR Review.
abrown created PR Review Comment:
This and below can now use better syntax:
v4 = vselect v1, v2, v3 return v4 } ; run: %vselect_i8x16() == [200 101 202 103 204 105 106 107 108 109 210 211 212 213 214 215]And, even better, could pass in the vectors in the run statement:
; run: %vselect_i8x16([...], [...], [...]) == [...] ~~~
abrown created PR Review Comment:
nit: we might want to note here that using
bitselectworks because the entire lane is filled with 1s or 0s
abrown created PR Review Comment:
It might be good to use a couple of run tests as well just to make CI assure us that the optimization is running as expected.
abrown created PR Review Comment:
I was puzzling over this for a while and I do understand now why this works; since
bitcastwas selecting at the bit level, we can safely select at the byte level in this optimization. In this code path we are going to bitcast our way tovselect(B8x16, *8x16, *8x16)every time, right?
teapotd submitted PR Review.
teapotd created PR Review Comment:
That's right, I'll add a comment with explanation to make it more clear.
teapotd updated PR #1783 from bitselect-blend to master:
This PR fixes #1187 and adds:
- encoding of
vselecton x86 usingBLEND*instructions- legalization of
vselecttobitselect- simple_preopt transformation that replaces
bitselectwithvselectif possibler? @abrown
teapotd updated PR #1783 from bitselect-blend to master:
This PR fixes #1187 and adds:
- encoding of
vselecton x86 usingBLEND*instructions- legalization of
vselecttobitselect- simple_preopt transformation that replaces
bitselectwithvselectif possibler? @abrown
teapotd requested abrown for a review on PR #1783.
abrown submitted PR Review.
abrown merged PR #1783.
Last updated: Dec 06 2025 at 06:05 UTC