brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.1 KiB · 3a1e8fc Raw
141 lines · c
1// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +sse4.2 -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK,X642// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +sse4.2 -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK,X643// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +sse4.2 -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK4// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +sse4.2 -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK5// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +sse4.2 -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK,X646// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +sse4.2 -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK,X647// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +sse4.2 -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK8// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +sse4.2 -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK9 10// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +sse4.2 -emit-llvm -o - -Wall -Werror  -fexperimental-new-constant-interpreter | FileCheck %s --check-prefixes=CHECK,X6411// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +sse4.2 -fno-signed-char -emit-llvm -o - -Wall -Werror  -fexperimental-new-constant-interpreter | FileCheck %s --check-prefixes=CHECK,X6412// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +sse4.2 -emit-llvm -o - -Wall -Werror  -fexperimental-new-constant-interpreter | FileCheck %s --check-prefixes=CHECK13// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +sse4.2 -fno-signed-char -emit-llvm -o - -Wall -Werror  -fexperimental-new-constant-interpreter | FileCheck %s --check-prefixes=CHECK14// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +sse4.2 -emit-llvm -o - -Wall -Werror  -fexperimental-new-constant-interpreter | FileCheck %s --check-prefixes=CHECK,X6415// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +sse4.2 -fno-signed-char -emit-llvm -o - -Wall -Werror  -fexperimental-new-constant-interpreter | FileCheck %s --check-prefixes=CHECK,X6416// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +sse4.2 -emit-llvm -o - -Wall -Werror  -fexperimental-new-constant-interpreter | FileCheck %s --check-prefixes=CHECK17// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +sse4.2 -fno-signed-char -emit-llvm -o - -Wall -Werror  -fexperimental-new-constant-interpreter | FileCheck %s --check-prefixes=CHECK18 19 20#include <immintrin.h>21#include "builtin_test_helpers.h"22 23// NOTE: This should match the tests in llvm/test/CodeGen/X86/sse42-intrinsics-fast-isel.ll24 25int test_mm_cmpestra(__m128i A, int LA, __m128i B, int LB) {26  // CHECK-LABEL: test_mm_cmpestra27  // CHECK: call {{.*}}i32 @llvm.x86.sse42.pcmpestria128(<16 x i8> %{{.*}}, i32 %{{.*}}, <16 x i8> %{{.*}}, i32 %{{.*}}, i8 7)28  return _mm_cmpestra(A, LA, B, LB, 7);29}30 31int test_mm_cmpestrc(__m128i A, int LA, __m128i B, int LB) {32  // CHECK-LABEL: test_mm_cmpestrc33  // CHECK: call {{.*}}i32 @llvm.x86.sse42.pcmpestric128(<16 x i8> %{{.*}}, i32 %{{.*}}, <16 x i8> %{{.*}}, i32 %{{.*}}, i8 7)34  return _mm_cmpestrc(A, LA, B, LB, 7);35}36 37int test_mm_cmpestri(__m128i A, int LA, __m128i B, int LB) {38  // CHECK-LABEL: test_mm_cmpestri39  // CHECK: call {{.*}}i32 @llvm.x86.sse42.pcmpestri128(<16 x i8> %{{.*}}, i32 %{{.*}}, <16 x i8> %{{.*}}, i32 %{{.*}}, i8 7)40  return _mm_cmpestri(A, LA, B, LB, 7);41}42 43__m128i test_mm_cmpestrm(__m128i A, int LA, __m128i B, int LB) {44  // CHECK-LABEL: test_mm_cmpestrm45  // CHECK: call <16 x i8> @llvm.x86.sse42.pcmpestrm128(<16 x i8> %{{.*}}, i32 %{{.*}}, <16 x i8> %{{.*}}, i32 %{{.*}}, i8 7)46  return _mm_cmpestrm(A, LA, B, LB, 7);47}48 49int test_mm_cmpestro(__m128i A, int LA, __m128i B, int LB) {50  // CHECK-LABEL: test_mm_cmpestro51  // CHECK: call {{.*}}i32 @llvm.x86.sse42.pcmpestrio128(<16 x i8> %{{.*}}, i32 %{{.*}}, <16 x i8> %{{.*}}, i32 %{{.*}}, i8 7)52  return _mm_cmpestro(A, LA, B, LB, 7);53}54 55int test_mm_cmpestrs(__m128i A, int LA, __m128i B, int LB) {56  // CHECK-LABEL: test_mm_cmpestrs57  // CHECK: call {{.*}}i32 @llvm.x86.sse42.pcmpestris128(<16 x i8> %{{.*}}, i32 %{{.*}}, <16 x i8> %{{.*}}, i32 %{{.*}}, i8 7)58  return _mm_cmpestrs(A, LA, B, LB, 7);59}60 61int test_mm_cmpestrz(__m128i A, int LA, __m128i B, int LB) {62  // CHECK-LABEL: test_mm_cmpestrz63  // CHECK: call {{.*}}i32 @llvm.x86.sse42.pcmpestriz128(<16 x i8> %{{.*}}, i32 %{{.*}}, <16 x i8> %{{.*}}, i32 %{{.*}}, i8 7)64  return _mm_cmpestrz(A, LA, B, LB, 7);65}66 67__m128i test_mm_cmpgt_epi64(__m128i A, __m128i B) {68  // CHECK-LABEL: test_mm_cmpgt_epi6469  // CHECK: icmp sgt <2 x i64>70  return _mm_cmpgt_epi64(A, B);71}72TEST_CONSTEXPR(match_v2di(_mm_cmpgt_epi64((__m128i)(__v2di){+1, -8}, (__m128i)(__v2di){-10, -8}), -1, 0));73 74int test_mm_cmpistra(__m128i A, __m128i B) {75  // CHECK-LABEL: test_mm_cmpistra76  // CHECK: call {{.*}}i32 @llvm.x86.sse42.pcmpistria128(<16 x i8> %{{.*}}, <16 x i8> %{{.*}}, i8 7)77  return _mm_cmpistra(A, B, 7);78}79 80int test_mm_cmpistrc(__m128i A, __m128i B) {81  // CHECK-LABEL: test_mm_cmpistrc82  // CHECK: call {{.*}}i32 @llvm.x86.sse42.pcmpistric128(<16 x i8> %{{.*}}, <16 x i8> %{{.*}}, i8 7)83  return _mm_cmpistrc(A, B, 7);84}85 86int test_mm_cmpistri(__m128i A, __m128i B) {87  // CHECK-LABEL: test_mm_cmpistri88  // CHECK: call {{.*}}i32 @llvm.x86.sse42.pcmpistri128(<16 x i8> %{{.*}}, <16 x i8> %{{.*}}, i8 7)89  return _mm_cmpistri(A, B, 7);90}91 92__m128i test_mm_cmpistrm(__m128i A, __m128i B) {93  // CHECK-LABEL: test_mm_cmpistrm94  // CHECK: call <16 x i8> @llvm.x86.sse42.pcmpistrm128(<16 x i8> %{{.*}}, <16 x i8> %{{.*}}, i8 7)95  return _mm_cmpistrm(A, B, 7);96}97 98int test_mm_cmpistro(__m128i A, __m128i B) {99  // CHECK-LABEL: test_mm_cmpistro100  // CHECK: call {{.*}}i32 @llvm.x86.sse42.pcmpistrio128(<16 x i8> %{{.*}}, <16 x i8> %{{.*}}, i8 7)101  return _mm_cmpistro(A, B, 7);102}103 104int test_mm_cmpistrs(__m128i A, __m128i B) {105  // CHECK-LABEL: test_mm_cmpistrs106  // CHECK: call {{.*}}i32 @llvm.x86.sse42.pcmpistris128(<16 x i8> %{{.*}}, <16 x i8> %{{.*}}, i8 7)107  return _mm_cmpistrs(A, B, 7);108}109 110int test_mm_cmpistrz(__m128i A, __m128i B) {111  // CHECK-LABEL: test_mm_cmpistrz112  // CHECK: call {{.*}}i32 @llvm.x86.sse42.pcmpistriz128(<16 x i8> %{{.*}}, <16 x i8> %{{.*}}, i8 7)113  return _mm_cmpistrz(A, B, 7);114}115 116unsigned int test_mm_crc32_u8(unsigned int CRC, unsigned char V) {117  // CHECK-LABEL: test_mm_crc32_u8118  // CHECK: call {{.*}}i32 @llvm.x86.sse42.crc32.32.8(i32 %{{.*}}, i8 %{{.*}})119  return _mm_crc32_u8(CRC, V);120}121 122unsigned int test_mm_crc32_u16(unsigned int CRC, unsigned short V) {123  // CHECK-LABEL: test_mm_crc32_u16124  // CHECK: call {{.*}}i32 @llvm.x86.sse42.crc32.32.16(i32 %{{.*}}, i16 %{{.*}})125  return _mm_crc32_u16(CRC, V);126}127 128unsigned int test_mm_crc32_u32(unsigned int CRC, unsigned int V) {129  // CHECK-LABEL: test_mm_crc32_u32130  // CHECK: call {{.*}}i32 @llvm.x86.sse42.crc32.32.32(i32 %{{.*}}, i32 %{{.*}})131  return _mm_crc32_u32(CRC, V);132}133 134#ifdef __x86_64__135unsigned long long test_mm_crc32_u64(unsigned long long CRC, unsigned long long V) {136  // X64-LABEL: test_mm_crc32_u64137  // X64: call {{.*}}i64 @llvm.x86.sse42.crc32.64.64(i64 %{{.*}}, i64 %{{.*}})138  return _mm_crc32_u64(CRC, V);139}140#endif141