[mlir] Improve error message when number of operands and types differ (#118488)
[llvm-project.git] / clang / test / CodeGen / X86 / sse.c
blob017bdd7846fa3966ff0c2ca8db22dda805693719
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5
2 // RUN: %clang_cc1 -ffreestanding -triple x86_64-- -target-feature +sse4.1 -disable-O0-optnone -emit-llvm %s -o - | opt -S -passes=mem2reg | FileCheck %s
5 #include <emmintrin.h>
7 // Byte-shifts look reversed due to xmm register layout
8 // CHECK-LABEL: define dso_local <2 x i64> @test_mm_slli_si128(
9 // CHECK-SAME: <2 x i64> noundef [[A:%.*]]) #[[ATTR0:[0-9]+]] {
10 // CHECK-NEXT: [[ENTRY:.*:]]
11 // CHECK-NEXT: [[CAST:%.*]] = bitcast <2 x i64> [[A]] to <16 x i8>
12 // CHECK-NEXT: [[PSLLDQ:%.*]] = shufflevector <16 x i8> zeroinitializer, <16 x i8> [[CAST]], <16 x i32> <i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26>
13 // CHECK-NEXT: [[CAST1:%.*]] = bitcast <16 x i8> [[PSLLDQ]] to <2 x i64>
14 // CHECK-NEXT: ret <2 x i64> [[CAST1]]
16 __m128i test_mm_slli_si128(__m128i a) {
17 return _mm_slli_si128(a, 5);
20 // CHECK-LABEL: define dso_local <2 x i64> @test_mm_slli_si128_0(
21 // CHECK-SAME: <2 x i64> noundef [[A:%.*]]) #[[ATTR0]] {
22 // CHECK-NEXT: [[ENTRY:.*:]]
23 // CHECK-NEXT: [[CAST:%.*]] = bitcast <2 x i64> [[A]] to <16 x i8>
24 // CHECK-NEXT: [[PSLLDQ:%.*]] = shufflevector <16 x i8> zeroinitializer, <16 x i8> [[CAST]], <16 x i32> <i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
25 // CHECK-NEXT: [[CAST1:%.*]] = bitcast <16 x i8> [[PSLLDQ]] to <2 x i64>
26 // CHECK-NEXT: ret <2 x i64> [[CAST1]]
28 __m128i test_mm_slli_si128_0(__m128i a) {
29 return _mm_slli_si128(a, 0);
32 // CHECK-LABEL: define dso_local <2 x i64> @test_mm_slli_si128_16(
33 // CHECK-SAME: <2 x i64> noundef [[A:%.*]]) #[[ATTR0]] {
34 // CHECK-NEXT: [[ENTRY:.*:]]
35 // CHECK-NEXT: ret <2 x i64> zeroinitializer
37 __m128i test_mm_slli_si128_16(__m128i a) {
38 return _mm_slli_si128(a, 16);
41 // CHECK-LABEL: define dso_local <2 x i64> @test_mm_srli_si128(
42 // CHECK-SAME: <2 x i64> noundef [[A:%.*]]) #[[ATTR0]] {
43 // CHECK-NEXT: [[ENTRY:.*:]]
44 // CHECK-NEXT: [[CAST:%.*]] = bitcast <2 x i64> [[A]] to <16 x i8>
45 // CHECK-NEXT: [[PSRLDQ:%.*]] = shufflevector <16 x i8> [[CAST]], <16 x i8> zeroinitializer, <16 x i32> <i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20>
46 // CHECK-NEXT: [[CAST1:%.*]] = bitcast <16 x i8> [[PSRLDQ]] to <2 x i64>
47 // CHECK-NEXT: ret <2 x i64> [[CAST1]]
49 __m128i test_mm_srli_si128(__m128i a) {
50 return _mm_srli_si128(a, 5);
53 // CHECK-LABEL: define dso_local <2 x i64> @test_mm_srli_si128_0(
54 // CHECK-SAME: <2 x i64> noundef [[A:%.*]]) #[[ATTR0]] {
55 // CHECK-NEXT: [[ENTRY:.*:]]
56 // CHECK-NEXT: [[CAST:%.*]] = bitcast <2 x i64> [[A]] to <16 x i8>
57 // CHECK-NEXT: [[PSRLDQ:%.*]] = shufflevector <16 x i8> [[CAST]], <16 x i8> zeroinitializer, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
58 // CHECK-NEXT: [[CAST1:%.*]] = bitcast <16 x i8> [[PSRLDQ]] to <2 x i64>
59 // CHECK-NEXT: ret <2 x i64> [[CAST1]]
61 __m128i test_mm_srli_si128_0(__m128i a) {
62 return _mm_srli_si128(a, 0);
65 // CHECK-LABEL: define dso_local <2 x i64> @test_mm_srli_si128_16(
66 // CHECK-SAME: <2 x i64> noundef [[A:%.*]]) #[[ATTR0]] {
67 // CHECK-NEXT: [[ENTRY:.*:]]
68 // CHECK-NEXT: ret <2 x i64> zeroinitializer
70 __m128i test_mm_srli_si128_16(__m128i a) {
71 return _mm_srli_si128(a, 16);