Improving on std:count_if()'s auto-vectorization
1–10 of 51 posts
Re: Improving on std:count_if()'s auto-vectorization
#2But the overly specific constraint means this is not a general count_if algorithm.
For this to be useful I have to: - know there are only 255 true values - but have a large dataset so it’s worth optimizing - not want to stop early when some threshold is met
This is so specialized it’s not even worth having a generic predicate argument for.
Re: Improving on std:count_if()'s auto-vectorization
#3Re: Improving on std:count_if()'s auto-vectorization
#4Re: Improving on std:count_if()'s auto-vectorization
#5Re: Improving on std:count_if()'s auto-vectorization
#6another solution is to just cast the result to an uint8_t; with this, clang 19.1.0 gives the same assembly: https://gcc.godbolt.org/z/E5oTW5eKe
Re: Improving on std:count_if()'s auto-vectorization
#7Soon I am wondering if rather than rely on finicky auto-vectorization we’ll just have LLMs help “hand-optimize” more routines. Just like how memcmp and memcpy are optimized by hand today maybe like 20% of the program could just be LLM-assisted assembly. @ffmpeg on X thinks maybe they are starting to get it [1] and I had some success having an LLM generate working WebAssembly [2] https://x.com/ffmpeg/status/1898408922…
Re: Improving on std:count_if()'s auto-vectorization
#8another solution is to just cast the result to an uint8_t; with this, clang 19.1.0 gives the same assembly: https://gcc.godbolt.org/z/E5oTW5eKe
Which is discussed in the post and doesn’t work in GCC.