Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions clang/test/CodeGen/SystemZ/builtins-systemz-zvector.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,31 +636,31 @@ void test_core(void) {
// CHECK-ASM: vlbb

vsc = vec_load_len(cptrsc, idx);
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr %{{.*}})
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr readonly %{{.*}})
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Foo bar baz

// CHECK-ASM: vll
vuc = vec_load_len(cptruc, idx);
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr %{{.*}})
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr readonly %{{.*}})
// CHECK-ASM: vll
vss = vec_load_len(cptrss, idx);
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr %{{.*}})
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr readonly %{{.*}})
// CHECK-ASM: vll
vus = vec_load_len(cptrus, idx);
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr %{{.*}})
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr readonly %{{.*}})
// CHECK-ASM: vll
vsi = vec_load_len(cptrsi, idx);
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr %{{.*}})
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr readonly %{{.*}})
// CHECK-ASM: vll
vui = vec_load_len(cptrui, idx);
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr %{{.*}})
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr readonly %{{.*}})
// CHECK-ASM: vll
vsl = vec_load_len(cptrsl, idx);
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr %{{.*}})
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr readonly %{{.*}})
// CHECK-ASM: vll
vul = vec_load_len(cptrul, idx);
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr %{{.*}})
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr readonly %{{.*}})
// CHECK-ASM: vll
vd = vec_load_len(cptrd, idx);
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr %{{.*}})
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr readonly %{{.*}})
// CHECK-ASM: vll

vec_store_len(vsc, ptrsc, idx);
Expand Down
8 changes: 4 additions & 4 deletions clang/test/CodeGen/SystemZ/builtins-systemz-zvector2.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ void test_core(void) {
// CHECK-ASM: vlbb

vf = vec_load_len(cptrf, idx);
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr %{{.*}})
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr readonly %{{.*}})
// CHECK-ASM: vll
vd = vec_load_len(cptrd, idx);
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr %{{.*}})
// CHECK: call <16 x i8> @llvm.s390.vll(i32 %{{.*}}, ptr readonly %{{.*}})
// CHECK-ASM: vll

vec_store_len(vf, ptrf, idx);
Expand All @@ -221,10 +221,10 @@ void test_core(void) {
// CHECK-ASM: vstl

vuc = vec_load_len_r(cptruc, 0);
// CHECK: call <16 x i8> @llvm.s390.vlrl(i32 0, ptr %{{.*}})
// CHECK: call <16 x i8> @llvm.s390.vlrl(i32 0, ptr readonly %{{.*}})
// CHECK-ASM: vlrl %{{.*}}, 0(%{{.*}}), 0
vuc = vec_load_len_r(cptruc, idx);
// CHECK: call <16 x i8> @llvm.s390.vlrl(i32 %{{.*}}, ptr %{{.*}})
// CHECK: call <16 x i8> @llvm.s390.vlrl(i32 %{{.*}}, ptr readonly %{{.*}})
// CHECK-ASM: vlrlr

vec_store_len_r(vuc, ptruc, 0);
Expand Down
3 changes: 0 additions & 3 deletions clang/test/CodeGen/X86/bitscan-builtins.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// RUN: %clang_cc1 -x c -ffreestanding %s -triple=x86_64-unknown-unknown -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 -x c++ -std=c++11 -ffreestanding %s -triple=x86_64-unknown-unknown -emit-llvm -o - | FileCheck %s

// PR33722
// RUN: %clang_cc1 -x c -ffreestanding %s -triple x86_64-unknown-unknown -fms-extensions -fms-compatibility-version=19.00 -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 -x c++ -ffreestanding %s -triple x86_64-unknown-unknown -fms-extensions -fms-compatibility-version=19.00 -emit-llvm -o - | FileCheck %s

#include <x86intrin.h>

Expand Down
71 changes: 71 additions & 0 deletions clang/test/CodeGen/X86/bitscan-builtins.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// RUN: %clang_cc1 -x c++ -std=c++11 -ffreestanding %s -triple=x86_64-unknown-unknown -emit-llvm -o - | FileCheck %s

// PR33722
// RUN: %clang_cc1 -x c++ -ffreestanding %s -triple x86_64-unknown-unknown -fms-extensions -fms-compatibility-version=19.00 -emit-llvm -o - | FileCheck %s

#include <x86intrin.h>

int test_bit_scan_forward(int a) {
// CHECK-LABEL: test_bit_scan_forward
// CHECK: %[[call:.*]] = call noundef i32 @llvm.cttz.i32(i32 %{{.*}}, i1 true)
// CHECK: ret i32 %[[call]]
return _bit_scan_forward(a);
}

int test_bit_scan_reverse(int a) {
// CHECK-LABEL: test_bit_scan_reverse
// CHECK: %[[call:.*]] = call i32 @llvm.ctlz.i32(i32 %{{.*}}, i1 true)
// CHECK: %[[sub:.*]] = sub nsw i32 31, %[[call]]
// CHECK: ret i32 %[[sub]]
return _bit_scan_reverse(a);
}

int test__bsfd(int X) {
// CHECK-LABEL: test__bsfd
// CHECK: %[[call:.*]] = call noundef i32 @llvm.cttz.i32(i32 %{{.*}}, i1 true)
return __bsfd(X);
}

int test__bsfq(long long X) {
// CHECK-LABEL: test__bsfq
// CHECK: %[[call:.*]] = call i64 @llvm.cttz.i64(i64 %{{.*}}, i1 true)
return __bsfq(X);
}

int test__bsrd(int X) {
// CHECK-LABEL: test__bsrd
// CHECK: %[[call:.*]] = call i32 @llvm.ctlz.i32(i32 %{{.*}}, i1 true)
// CHECK: %[[sub:.*]] = sub nsw i32 31, %[[call]]
return __bsrd(X);
}

int test__bsrq(long long X) {
// CHECK-LABEL: test__bsrq
// CHECK: %[[call:.*]] = call i64 @llvm.ctlz.i64(i64 %{{.*}}, i1 true)
// CHECK: %[[cast:.*]] = trunc i64 %[[call]] to i32
// CHECK: %[[sub:.*]] = sub nsw i32 63, %[[cast]]
return __bsrq(X);
}

// Test constexpr handling.
#if defined(__cplusplus) && (__cplusplus >= 201103L)

char bsf_0[_bit_scan_forward(0x00000001) == 0 ? 1 : -1];
char bsf_1[_bit_scan_forward(0x10000000) == 28 ? 1 : -1];

char bsr_0[_bit_scan_reverse(0x00000001) == 0 ? 1 : -1];
char bsr_1[_bit_scan_reverse(0x01000000) == 24 ? 1 : -1];

char bsfd_0[__bsfd(0x00000008) == 3 ? 1 : -1];
char bsfd_1[__bsfd(0x00010008) == 3 ? 1 : -1];

char bsrd_0[__bsrd(0x00000010) == 4 ? 1 : -1];
char bsrd_1[__bsrd(0x00100100) == 20 ? 1 : -1];

char bsfq_0[__bsfq(0x0000000800000000ULL) == 35 ? 1 : -1];
char bsfq_1[__bsfq(0x0004000000000000ULL) == 50 ? 1 : -1];

char bsrq_0[__bsrq(0x0000100800000000ULL) == 44 ? 1 : -1];
char bsrq_1[__bsrq(0x0004000100000000ULL) == 50 ? 1 : -1];

#endif
2 changes: 0 additions & 2 deletions clang/test/CodeGen/X86/popcnt-builtins.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// RUN: %clang_cc1 -x c -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +popcnt -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-POPCNT
// RUN: %clang_cc1 -x c++ -std=c++11 -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +popcnt -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-POPCNT
// RUN: %clang_cc1 -x c -ffreestanding %s -triple=x86_64-apple-darwin -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 -x c++ -std=c++11 -ffreestanding %s -triple=x86_64-apple-darwin -emit-llvm -o - | FileCheck %s

#include <x86intrin.h>

Expand Down
67 changes: 67 additions & 0 deletions clang/test/CodeGen/X86/popcnt-builtins.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// RUN: %clang_cc1 -x c++ -std=c++11 -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +popcnt -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-POPCNT
// RUN: %clang_cc1 -x c++ -std=c++11 -ffreestanding %s -triple=x86_64-apple-darwin -emit-llvm -o - | FileCheck %s

#include <x86intrin.h>

#ifdef __POPCNT__
int test_mm_popcnt_u32(unsigned int __X) {
//CHECK-POPCNT: call noundef i32 @llvm.ctpop.i32
return _mm_popcnt_u32(__X);
}
#endif

int test_popcnt32(unsigned int __X) {
//CHECK: call noundef i32 @llvm.ctpop.i32
return _popcnt32(__X);
}

int test__popcntd(unsigned int __X) {
//CHECK: call noundef i32 @llvm.ctpop.i32
return __popcntd(__X);
}

#ifdef __x86_64__
#ifdef __POPCNT__
long long test_mm_popcnt_u64(unsigned long long __X) {
//CHECK-POPCNT: call i64 @llvm.ctpop.i64
return _mm_popcnt_u64(__X);
}
#endif

long long test_popcnt64(unsigned long long __X) {
//CHECK: call i64 @llvm.ctpop.i64
return _popcnt64(__X);
}

long long test__popcntq(unsigned long long __X) {
//CHECK: call i64 @llvm.ctpop.i64
return __popcntq(__X);
}
#endif

// Test constexpr handling.
#if defined(__cplusplus) && (__cplusplus >= 201103L)
#if defined(__POPCNT__)
char ctpop32_0[_mm_popcnt_u32(0x00000000) == 0 ? 1 : -1];
char ctpop32_1[_mm_popcnt_u32(0x000000F0) == 4 ? 1 : -1];
#endif

char popcnt32_0[_popcnt32(0x00000000) == 0 ? 1 : -1];
char popcnt32_1[_popcnt32(0x100000F0) == 5 ? 1 : -1];

char popcntd_0[__popcntd(0x00000000) == 0 ? 1 : -1];
char popcntd_1[__popcntd(0x00F000F0) == 8 ? 1 : -1];

#ifdef __x86_64__
#if defined(__POPCNT__)
char ctpop64_0[_mm_popcnt_u64(0x0000000000000000ULL) == 0 ? 1 : -1];
char ctpop64_1[_mm_popcnt_u64(0xF000000000000001ULL) == 5 ? 1 : -1];
#endif

char popcnt64_0[_popcnt64(0x0000000000000000ULL) == 0 ? 1 : -1];
char popcnt64_1[_popcnt64(0xF00000F000000001ULL) == 9 ? 1 : -1];

char popcntq_0[__popcntq(0x0000000000000000ULL) == 0 ? 1 : -1];
char popcntq_1[__popcntq(0xF000010000300001ULL) == 8 ? 1 : -1];
#endif
#endif
7 changes: 0 additions & 7 deletions clang/test/CodeGen/X86/rot-intrinsics.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
// RUN: %clang_cc1 -x c -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 -ffreestanding %s -triple=i686-windows-msvc -target-feature +sse2 -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes CHECK,CHECK-32BIT-LONG
// RUN: %clang_cc1 -x c -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 -ffreestanding %s -triple=x86_64-windows-msvc -target-feature +sse2 -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes CHECK,CHECK-32BIT-LONG

// RUN: %clang_cc1 -x c++ -std=c++11 -ffreestanding -triple i686--linux -emit-llvm %s -o - | FileCheck %s --check-prefixes CHECK,CHECK-32BIT-LONG
// RUN: %clang_cc1 -x c++ -std=c++11 -ffreestanding -triple x86_64--linux -emit-llvm %s -o - | FileCheck %s --check-prefixes CHECK,CHECK-64BIT-LONG
// RUN: %clang_cc1 -x c++ -std=c++11 -fms-extensions -fms-compatibility -ffreestanding %s -triple=i686-windows-msvc -target-feature +sse2 -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes CHECK,CHECK-32BIT-LONG
// RUN: %clang_cc1 -x c++ -std=c++11 -fms-extensions -fms-compatibility -ffreestanding %s -triple=x86_64-windows-msvc -target-feature +sse2 -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes CHECK,CHECK-32BIT-LONG
// RUN: %clang_cc1 -x c++ -std=c++11 -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 -ffreestanding %s -triple=i686-windows-msvc -target-feature +sse2 -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes CHECK,CHECK-32BIT-LONG
// RUN: %clang_cc1 -x c++ -std=c++11 -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 -ffreestanding %s -triple=x86_64-windows-msvc -target-feature +sse2 -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes CHECK,CHECK-32BIT-LONG

#include <x86intrin.h>

unsigned char test__rolb(unsigned char value, int shift) {
Expand Down
Loading