[Bug target/91533] New: abs pattern generates MMX instructions but fails to call EMMS
kretz at kde dot org
gcc-bugzilla@gcc.gnu.org
Fri Aug 23 19:41:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91533
Bug ID: 91533
Summary: abs pattern generates MMX instructions but fails to
call EMMS
Product: gcc
Version: 9.2.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: kretz at kde dot org
Target Milestone: ---
Target: x86_64-*-*, i?86-*-*
Test case (cf. https://godbolt.org/z/IfL1mF):
using V [[gnu::vector_size(8)]] = int;
V f(V a, long double& x) {
a = a < 0 ? -a : a;
x += 1;
return a;
}
Compile with e.g. `-O2 -march=skylake`. This generates a call to `PABSD mm1,
mm2/m64` but fails to call `EMMS`. It even interleaves the FPU instructions
with the MMX instructions. GCC 10 has a fix, it simply calls `PABSD xmm1,
xmm2/m128`.
More information about the Gcc-bugs
mailing list