https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98962
Bug ID: 98962 Summary: Perform bitops on floats directly with SSE Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: glisse at gcc dot gnu.org Target Milestone: --- Target: x86_64-*-* (from https://stackoverflow.com/q/66023408/1918193 ) float f(float a){ unsigned ai; __builtin_memcpy(&ai, &a, 4); unsigned ri = ai ^ (1U << 31); float r; __builtin_memcpy(&r, &ri, 4); return r; } results in movd %xmm0, %eax addl $-2147483648, %eax movd %eax, %xmm0 while llvm simplifies it to xorps .LCPI0_0(%rip), %xmm0