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`.

Reply via email to