https://bugs.llvm.org/show_bug.cgi?id=38960

            Bug ID: 38960
           Summary: [X86] Poor codegen for comieq/comine intrinsics
                    feeding a branch
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

#include <x86intrin.h>

void foo();

void test_mm_comieq_ss(__m128 A, __m128 B) {
  if (_mm_comieq_ss(A, B))
    foo();
}

Produces

test_mm_comieq_ss(float __vector(4), float __vector(4)):           #
@test_mm_comieq_ss(float __vector(4), float __vector(4))
        vcomiss %xmm1, %xmm0
        setnp   %al
        sete    %cl
        andb    %al, %cl
        movzbl  %cl, %eax
        testl   %eax, %eax
        je      .LBB0_1
        jmp     foo()                 # TAILCALL
.LBB0_1:
        retq

Ideally we should only produce a vcomiss and two conditional jumps.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to