Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / aarch64-sve-intrinsics / acle_sve_get4.c
blob13f8c2a2906ef786585076163727b7b730bc01c9
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // REQUIRES: aarch64-registered-target
3 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
4 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
5 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
6 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
7 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
8 #include <arm_sve.h>
10 #ifdef SVE_OVERLOADED_FORMS
11 // A simple used,unused... macro, long enough to represent any SVE builtin.
12 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
13 #else
14 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
15 #endif
17 // NOTE: For these tests clang converts the struct parameter into
18 // several parameters, one for each member of the original struct.
19 // CHECK-LABEL: @test_svget4_s8(
20 // CHECK-NEXT: entry:
21 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.vector.extract.nxv16i8.nxv64i8(<vscale x 64 x i8> [[TUPLE:%.*]], i64 0)
22 // CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
24 // CPP-CHECK-LABEL: @_Z14test_svget4_s810svint8x4_t(
25 // CPP-CHECK-NEXT: entry:
26 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.vector.extract.nxv16i8.nxv64i8(<vscale x 64 x i8> [[TUPLE:%.*]], i64 0)
27 // CPP-CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
29 svint8_t test_svget4_s8(svint8x4_t tuple)
31 return SVE_ACLE_FUNC(svget4,_s8,,)(tuple, 0);
34 // CHECK-LABEL: @test_svget4_s16(
35 // CHECK-NEXT: entry:
36 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.vector.extract.nxv8i16.nxv32i16(<vscale x 32 x i16> [[TUPLE:%.*]], i64 16)
37 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
39 // CPP-CHECK-LABEL: @_Z15test_svget4_s1611svint16x4_t(
40 // CPP-CHECK-NEXT: entry:
41 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.vector.extract.nxv8i16.nxv32i16(<vscale x 32 x i16> [[TUPLE:%.*]], i64 16)
42 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
44 svint16_t test_svget4_s16(svint16x4_t tuple)
46 return SVE_ACLE_FUNC(svget4,_s16,,)(tuple, 2);
49 // CHECK-LABEL: @test_svget4_s32(
50 // CHECK-NEXT: entry:
51 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.vector.extract.nxv4i32.nxv16i32(<vscale x 16 x i32> [[TUPLE:%.*]], i64 8)
52 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
54 // CPP-CHECK-LABEL: @_Z15test_svget4_s3211svint32x4_t(
55 // CPP-CHECK-NEXT: entry:
56 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.vector.extract.nxv4i32.nxv16i32(<vscale x 16 x i32> [[TUPLE:%.*]], i64 8)
57 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
59 svint32_t test_svget4_s32(svint32x4_t tuple)
61 return SVE_ACLE_FUNC(svget4,_s32,,)(tuple, 2);
64 // CHECK-LABEL: @test_svget4_s64(
65 // CHECK-NEXT: entry:
66 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.vector.extract.nxv2i64.nxv8i64(<vscale x 8 x i64> [[TUPLE:%.*]], i64 6)
67 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]
69 // CPP-CHECK-LABEL: @_Z15test_svget4_s6411svint64x4_t(
70 // CPP-CHECK-NEXT: entry:
71 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.vector.extract.nxv2i64.nxv8i64(<vscale x 8 x i64> [[TUPLE:%.*]], i64 6)
72 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]
74 svint64_t test_svget4_s64(svint64x4_t tuple)
76 return SVE_ACLE_FUNC(svget4,_s64,,)(tuple, 3);
79 // CHECK-LABEL: @test_svget4_u8(
80 // CHECK-NEXT: entry:
81 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.vector.extract.nxv16i8.nxv64i8(<vscale x 64 x i8> [[TUPLE:%.*]], i64 32)
82 // CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
84 // CPP-CHECK-LABEL: @_Z14test_svget4_u811svuint8x4_t(
85 // CPP-CHECK-NEXT: entry:
86 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.vector.extract.nxv16i8.nxv64i8(<vscale x 64 x i8> [[TUPLE:%.*]], i64 32)
87 // CPP-CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
89 svuint8_t test_svget4_u8(svuint8x4_t tuple)
91 return SVE_ACLE_FUNC(svget4,_u8,,)(tuple, 2);
94 // CHECK-LABEL: @test_svget4_u16(
95 // CHECK-NEXT: entry:
96 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.vector.extract.nxv8i16.nxv32i16(<vscale x 32 x i16> [[TUPLE:%.*]], i64 24)
97 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
99 // CPP-CHECK-LABEL: @_Z15test_svget4_u1612svuint16x4_t(
100 // CPP-CHECK-NEXT: entry:
101 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.vector.extract.nxv8i16.nxv32i16(<vscale x 32 x i16> [[TUPLE:%.*]], i64 24)
102 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
104 svuint16_t test_svget4_u16(svuint16x4_t tuple)
106 return SVE_ACLE_FUNC(svget4,_u16,,)(tuple, 3);
109 // CHECK-LABEL: @test_svget4_u32(
110 // CHECK-NEXT: entry:
111 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.vector.extract.nxv4i32.nxv16i32(<vscale x 16 x i32> [[TUPLE:%.*]], i64 0)
112 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
114 // CPP-CHECK-LABEL: @_Z15test_svget4_u3212svuint32x4_t(
115 // CPP-CHECK-NEXT: entry:
116 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.vector.extract.nxv4i32.nxv16i32(<vscale x 16 x i32> [[TUPLE:%.*]], i64 0)
117 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
119 svuint32_t test_svget4_u32(svuint32x4_t tuple)
121 return SVE_ACLE_FUNC(svget4,_u32,,)(tuple, 0);
124 // CHECK-LABEL: @test_svget4_u64(
125 // CHECK-NEXT: entry:
126 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.vector.extract.nxv2i64.nxv8i64(<vscale x 8 x i64> [[TUPLE:%.*]], i64 6)
127 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]
129 // CPP-CHECK-LABEL: @_Z15test_svget4_u6412svuint64x4_t(
130 // CPP-CHECK-NEXT: entry:
131 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.vector.extract.nxv2i64.nxv8i64(<vscale x 8 x i64> [[TUPLE:%.*]], i64 6)
132 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]
134 svuint64_t test_svget4_u64(svuint64x4_t tuple)
136 return SVE_ACLE_FUNC(svget4,_u64,,)(tuple, 3);
139 // CHECK-LABEL: @test_svget4_f16(
140 // CHECK-NEXT: entry:
141 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x half> @llvm.vector.extract.nxv8f16.nxv32f16(<vscale x 32 x half> [[TUPLE:%.*]], i64 16)
142 // CHECK-NEXT: ret <vscale x 8 x half> [[TMP0]]
144 // CPP-CHECK-LABEL: @_Z15test_svget4_f1613svfloat16x4_t(
145 // CPP-CHECK-NEXT: entry:
146 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x half> @llvm.vector.extract.nxv8f16.nxv32f16(<vscale x 32 x half> [[TUPLE:%.*]], i64 16)
147 // CPP-CHECK-NEXT: ret <vscale x 8 x half> [[TMP0]]
149 svfloat16_t test_svget4_f16(svfloat16x4_t tuple)
151 return SVE_ACLE_FUNC(svget4,_f16,,)(tuple, 2);
154 // CHECK-LABEL: @test_svget4_f32(
155 // CHECK-NEXT: entry:
156 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x float> @llvm.vector.extract.nxv4f32.nxv16f32(<vscale x 16 x float> [[TUPLE:%.*]], i64 0)
157 // CHECK-NEXT: ret <vscale x 4 x float> [[TMP0]]
159 // CPP-CHECK-LABEL: @_Z15test_svget4_f3213svfloat32x4_t(
160 // CPP-CHECK-NEXT: entry:
161 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x float> @llvm.vector.extract.nxv4f32.nxv16f32(<vscale x 16 x float> [[TUPLE:%.*]], i64 0)
162 // CPP-CHECK-NEXT: ret <vscale x 4 x float> [[TMP0]]
164 svfloat32_t test_svget4_f32(svfloat32x4_t tuple)
166 return SVE_ACLE_FUNC(svget4,_f32,,)(tuple, 0);
169 // CHECK-LABEL: @test_svget4_f64(
170 // CHECK-NEXT: entry:
171 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x double> @llvm.vector.extract.nxv2f64.nxv8f64(<vscale x 8 x double> [[TUPLE:%.*]], i64 4)
172 // CHECK-NEXT: ret <vscale x 2 x double> [[TMP0]]
174 // CPP-CHECK-LABEL: @_Z15test_svget4_f6413svfloat64x4_t(
175 // CPP-CHECK-NEXT: entry:
176 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x double> @llvm.vector.extract.nxv2f64.nxv8f64(<vscale x 8 x double> [[TUPLE:%.*]], i64 4)
177 // CPP-CHECK-NEXT: ret <vscale x 2 x double> [[TMP0]]
179 svfloat64_t test_svget4_f64(svfloat64x4_t tuple)
181 return SVE_ACLE_FUNC(svget4,_f64,,)(tuple, 2);