https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92492
Tamar Christina <tnfchris at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target|i386, x86-64, aarch64 |i386, x86-64 Status|ASSIGNED |NEW Assignee|anton.youdkevitch@bell-sw.c |unassigned at gcc dot gnu.org |om | Summary|Missed optimization in |AVX512: Missed |detecting unneeded widening |vectorization opportunity |conversions. | --- Comment #6 from Tamar Christina <tnfchris at gcc dot gnu.org> --- > (In reply to Anton Youdkevitch from comment #5) > This is not just about type promotion/demotion. > The results of (-x)>>7 done in unsigned char and in int are different. > You're right, in that the version given here can't be optimized when the input value is an unsigned char. The actual one in SPEC2017 can, because it's actually just doing clipping. However that one GCC already generates the most efficient form for these simple test cases. For the actual testcase there's a lot of inefficiency depending on the ISA, but that's an ISA specific issue not a mid-end one. The reported vectorization issue does indeed seem to be AVX512 specific.