https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119922
Bug ID: 119922
Summary: V4SI & {-1, -1, 0, 0} should produce movq
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Take:
```
typedef float V __attribute__((vector_size(16)));
typedef int VI __attribute__((vector_size(16)));
V
foo (V x)
{
return __builtin_shufflevector (x, (V) { 0, 0, 0, 0 }, 0, 1, 4, 5);
}
V
foo1 (V x)
{
VI y = {-1,-1,0x0,0x0};
return (V)(((VI)x) & y);
}
```
These 2 should both produce movq.
This was noticed while reading the review of a patch:
https://gcc.gnu.org/pipermail/gcc-patches/2025-February/676292.html