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

            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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Using:
$ ./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
intrinsic:
$ 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
flags:
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
gcc.

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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to