[LLVMbugs] [Bug 11937] New: Codegen fails on the llvm.x86.mmx.pmovmskb intrinsic if the target does not support SSE

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Feb 6 12:48:08 PST 2012


http://llvm.org/bugs/show_bug.cgi?id=11937

             Bug #: 11937
           Summary: Codegen fails on the llvm.x86.mmx.pmovmskb intrinsic
                    if the target does not support SSE
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: baldrick at free.fr
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


When targeting i386, codegen rejects the llvm.x86.mmx.pmovmskb with
  LLVM ERROR: Cannot select: intrinsic %llvm.x86.mmx.pmovmskb
Why is this a problem?  The testcase was reduced from real code that defines
several different versions of a function: an MMX version, an SSE2 version, a
vanilla version etc.  It selects the right version at runtime by querying the
cpu for what it supports.  The program is of course compiled for the lowest
common denominator, i386: since it may have to run on i386, it is essential
that the compiler not spontaneously introduce SSE instructions on its own;
this is why i386 is targetted.  The problem is that because i386 is targeted,
the compiler rejects the use of this MMX intrinsic in the MMX specific routine
(which will never be run if the program executes on an i386 processor that
doesn't support MMX).

To reproduce:

$ llc pmovmskb.ll -mcpu=i386
LLVM ERROR: Cannot select: intrinsic %llvm.x86.mmx.pmovmskb

The testcase:

target datalayout =
"e-p:32:32:32-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f16:16:16-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-f128:128:128-n8:16:32"
target triple = "i386-pc-linux-gnu"

declare i32 @llvm.x86.mmx.pmovmskb(x86_mmx) nounwind readnone

define i32 @search_line_mmx(x86_mmx %x) {
  %r = tail call i32 @llvm.x86.mmx.pmovmskb(x86_mmx %x) nounwind readnone
  ret i32 %r
}

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list