Adding LLVM front-end support to two intrinsics dealing with bit scan: _bit_scan_forward and _bit_scan_reverse. Their functionality is as described in Intel intrinsics guide: https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_bit_scan_forward&expand=371,370 https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_bit_scan_reverse&expand=371,370 Furthermore, adding clang front-end support to these conversion intrinsics: _mm256_cvtsd_f64, _mm256_cvtsi256_si32 and _mm256_cvtss_f32. Finally, adding tests to all of the above, as well as to the state reading intrinsics _rdpmc and _rdtsc. Their functionality is also specified in the Intel intrinsics guide. Commit on behalf of Omer Paparo Bivas llvm-svn: 271387
18 lines
478 B
C
18 lines
478 B
C
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s
|
|
|
|
// Don't include mm_malloc.h, it's system specific.
|
|
#define __MM_MALLOC_H
|
|
#include <immintrin.h>
|
|
|
|
int test_bit_scan_forward(int a) {
|
|
return _bit_scan_forward(a);
|
|
// CHECK: @test_bit_scan_forward
|
|
// CHECK: call i32 @llvm.x86.bit.scan.forward
|
|
}
|
|
|
|
int test_bit_scan_reverse(int a) {
|
|
return _bit_scan_reverse(a);
|
|
// CHECK: @test_bit_scan_reverse
|
|
// CHECK: call i32 @llvm.x86.bit.scan.reverse
|
|
}
|