[LLVMbugs] [Bug 19431] New: BMI intrinsic not recognized?

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Apr 14 18:25:02 PDT 2014


            Bug ID: 19431
           Summary: BMI intrinsic not recognized?
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Headers
          Assignee: unassignedclangbugs at nondot.org
          Reporter: sanjay3.0.0.0 at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

$ ./clang -v
clang version 3.5.0 (trunk 206222) (llvm/trunk 206220)
Target: x86_64-apple-darwin13.1.0
Thread model: posix

I tried to generate an x86 bit manipulation instruction (BMI) via its C
$ cat bmi.c 
#include <x86intrin.h>
int foo(int a) { return _blsmsk_u32(a); }

$ ./clang bmi.c -mbmi -S -o -
bmi.c:2:25: warning: implicit declaration of function '_blsmsk_u32' is invalid
in C99 [-Wimplicit-function-declaration]

The generated asm shows:
    callq    __blsmsk_u32

I confirmed the same behavior with clang 3.2 on Ubuntu 13.04. However, gcc
4.8.2 generates the expected instruction from the same source file and compiler
blsmsk %edi, %eax

I also confirmed that a BMI2 instruction is generated using the same kind of C
instrinsic (I tested '_bzhi_u32') and "-mbmi2" with both clang versions and

Is "-mbmi" no longer the correct feature flag for the BMI ISA?

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140415/4b9fbd4e/attachment.html>

More information about the llvm-bugs mailing list