[Flang] remove whole-archive option for AIX linker (#76039)
[llvm-project.git] / clang / test / CodeGen / aarch64-sve-intrinsics / acle_sve_set4.c
blobe4ece8c2a65ff7f5b5ab67e3fb10709eb0a8fa15
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // 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
3 // 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
4 // 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
5 // 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 // REQUIRES: aarch64-registered-target
9 #include <arm_sve.h>
11 #ifdef SVE_OVERLOADED_FORMS
12 // A simple used,unused... macro, long enough to represent any SVE builtin.
13 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
14 #else
15 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
16 #endif
19 // CHECK-LABEL: @test_svset4_s8(
20 // CHECK-NEXT: entry:
21 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 64 x i8> @llvm.vector.insert.nxv64i8.nxv16i8(<vscale x 64 x i8> [[TUPLE:%.*]], <vscale x 16 x i8> [[X:%.*]], i64 16)
22 // CHECK-NEXT: ret <vscale x 64 x i8> [[TMP0]]
24 // CPP-CHECK-LABEL: @_Z14test_svset4_s810svint8x4_tu10__SVInt8_t(
25 // CPP-CHECK-NEXT: entry:
26 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 64 x i8> @llvm.vector.insert.nxv64i8.nxv16i8(<vscale x 64 x i8> [[TUPLE:%.*]], <vscale x 16 x i8> [[X:%.*]], i64 16)
27 // CPP-CHECK-NEXT: ret <vscale x 64 x i8> [[TMP0]]
29 svint8x4_t test_svset4_s8(svint8x4_t tuple, svint8_t x)
31 return SVE_ACLE_FUNC(svset4,_s8,,)(tuple, 1, x);
34 // CHECK-LABEL: @test_svset4_s16(
35 // CHECK-NEXT: entry:
36 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 32 x i16> @llvm.vector.insert.nxv32i16.nxv8i16(<vscale x 32 x i16> [[TUPLE:%.*]], <vscale x 8 x i16> [[X:%.*]], i64 24)
37 // CHECK-NEXT: ret <vscale x 32 x i16> [[TMP0]]
39 // CPP-CHECK-LABEL: @_Z15test_svset4_s1611svint16x4_tu11__SVInt16_t(
40 // CPP-CHECK-NEXT: entry:
41 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 32 x i16> @llvm.vector.insert.nxv32i16.nxv8i16(<vscale x 32 x i16> [[TUPLE:%.*]], <vscale x 8 x i16> [[X:%.*]], i64 24)
42 // CPP-CHECK-NEXT: ret <vscale x 32 x i16> [[TMP0]]
44 svint16x4_t test_svset4_s16(svint16x4_t tuple, svint16_t x)
46 return SVE_ACLE_FUNC(svset4,_s16,,)(tuple, 3, x);
49 // CHECK-LABEL: @test_svset4_s32(
50 // CHECK-NEXT: entry:
51 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i32> @llvm.vector.insert.nxv16i32.nxv4i32(<vscale x 16 x i32> [[TUPLE:%.*]], <vscale x 4 x i32> [[X:%.*]], i64 4)
52 // CHECK-NEXT: ret <vscale x 16 x i32> [[TMP0]]
54 // CPP-CHECK-LABEL: @_Z15test_svset4_s3211svint32x4_tu11__SVInt32_t(
55 // CPP-CHECK-NEXT: entry:
56 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i32> @llvm.vector.insert.nxv16i32.nxv4i32(<vscale x 16 x i32> [[TUPLE:%.*]], <vscale x 4 x i32> [[X:%.*]], i64 4)
57 // CPP-CHECK-NEXT: ret <vscale x 16 x i32> [[TMP0]]
59 svint32x4_t test_svset4_s32(svint32x4_t tuple, svint32_t x)
61 return SVE_ACLE_FUNC(svset4,_s32,,)(tuple, 1, x);
64 // CHECK-LABEL: @test_svset4_s64(
65 // CHECK-NEXT: entry:
66 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i64> @llvm.vector.insert.nxv8i64.nxv2i64(<vscale x 8 x i64> [[TUPLE:%.*]], <vscale x 2 x i64> [[X:%.*]], i64 2)
67 // CHECK-NEXT: ret <vscale x 8 x i64> [[TMP0]]
69 // CPP-CHECK-LABEL: @_Z15test_svset4_s6411svint64x4_tu11__SVInt64_t(
70 // CPP-CHECK-NEXT: entry:
71 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i64> @llvm.vector.insert.nxv8i64.nxv2i64(<vscale x 8 x i64> [[TUPLE:%.*]], <vscale x 2 x i64> [[X:%.*]], i64 2)
72 // CPP-CHECK-NEXT: ret <vscale x 8 x i64> [[TMP0]]
74 svint64x4_t test_svset4_s64(svint64x4_t tuple, svint64_t x)
76 return SVE_ACLE_FUNC(svset4,_s64,,)(tuple, 1, x);
79 // CHECK-LABEL: @test_svset4_u8(
80 // CHECK-NEXT: entry:
81 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 64 x i8> @llvm.vector.insert.nxv64i8.nxv16i8(<vscale x 64 x i8> [[TUPLE:%.*]], <vscale x 16 x i8> [[X:%.*]], i64 48)
82 // CHECK-NEXT: ret <vscale x 64 x i8> [[TMP0]]
84 // CPP-CHECK-LABEL: @_Z14test_svset4_u811svuint8x4_tu11__SVUint8_t(
85 // CPP-CHECK-NEXT: entry:
86 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 64 x i8> @llvm.vector.insert.nxv64i8.nxv16i8(<vscale x 64 x i8> [[TUPLE:%.*]], <vscale x 16 x i8> [[X:%.*]], i64 48)
87 // CPP-CHECK-NEXT: ret <vscale x 64 x i8> [[TMP0]]
89 svuint8x4_t test_svset4_u8(svuint8x4_t tuple, svuint8_t x)
91 return SVE_ACLE_FUNC(svset4,_u8,,)(tuple, 3, x);
94 // CHECK-LABEL: @test_svset4_u16(
95 // CHECK-NEXT: entry:
96 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 32 x i16> @llvm.vector.insert.nxv32i16.nxv8i16(<vscale x 32 x i16> [[TUPLE:%.*]], <vscale x 8 x i16> [[X:%.*]], i64 8)
97 // CHECK-NEXT: ret <vscale x 32 x i16> [[TMP0]]
99 // CPP-CHECK-LABEL: @_Z15test_svset4_u1612svuint16x4_tu12__SVUint16_t(
100 // CPP-CHECK-NEXT: entry:
101 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 32 x i16> @llvm.vector.insert.nxv32i16.nxv8i16(<vscale x 32 x i16> [[TUPLE:%.*]], <vscale x 8 x i16> [[X:%.*]], i64 8)
102 // CPP-CHECK-NEXT: ret <vscale x 32 x i16> [[TMP0]]
104 svuint16x4_t test_svset4_u16(svuint16x4_t tuple, svuint16_t x)
106 return SVE_ACLE_FUNC(svset4,_u16,,)(tuple, 1, x);
109 // CHECK-LABEL: @test_svset4_u32(
110 // CHECK-NEXT: entry:
111 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i32> @llvm.vector.insert.nxv16i32.nxv4i32(<vscale x 16 x i32> [[TUPLE:%.*]], <vscale x 4 x i32> [[X:%.*]], i64 4)
112 // CHECK-NEXT: ret <vscale x 16 x i32> [[TMP0]]
114 // CPP-CHECK-LABEL: @_Z15test_svset4_u3212svuint32x4_tu12__SVUint32_t(
115 // CPP-CHECK-NEXT: entry:
116 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i32> @llvm.vector.insert.nxv16i32.nxv4i32(<vscale x 16 x i32> [[TUPLE:%.*]], <vscale x 4 x i32> [[X:%.*]], i64 4)
117 // CPP-CHECK-NEXT: ret <vscale x 16 x i32> [[TMP0]]
119 svuint32x4_t test_svset4_u32(svuint32x4_t tuple, svuint32_t x)
121 return SVE_ACLE_FUNC(svset4,_u32,,)(tuple, 1, x);
124 // CHECK-LABEL: @test_svset4_u64(
125 // CHECK-NEXT: entry:
126 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i64> @llvm.vector.insert.nxv8i64.nxv2i64(<vscale x 8 x i64> [[TUPLE:%.*]], <vscale x 2 x i64> [[X:%.*]], i64 6)
127 // CHECK-NEXT: ret <vscale x 8 x i64> [[TMP0]]
129 // CPP-CHECK-LABEL: @_Z15test_svset4_u6412svuint64x4_tu12__SVUint64_t(
130 // CPP-CHECK-NEXT: entry:
131 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i64> @llvm.vector.insert.nxv8i64.nxv2i64(<vscale x 8 x i64> [[TUPLE:%.*]], <vscale x 2 x i64> [[X:%.*]], i64 6)
132 // CPP-CHECK-NEXT: ret <vscale x 8 x i64> [[TMP0]]
134 svuint64x4_t test_svset4_u64(svuint64x4_t tuple, svuint64_t x)
136 return SVE_ACLE_FUNC(svset4,_u64,,)(tuple, 3, x);
139 // CHECK-LABEL: @test_svset4_f16(
140 // CHECK-NEXT: entry:
141 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 32 x half> @llvm.vector.insert.nxv32f16.nxv8f16(<vscale x 32 x half> [[TUPLE:%.*]], <vscale x 8 x half> [[X:%.*]], i64 8)
142 // CHECK-NEXT: ret <vscale x 32 x half> [[TMP0]]
144 // CPP-CHECK-LABEL: @_Z15test_svset4_f1613svfloat16x4_tu13__SVFloat16_t(
145 // CPP-CHECK-NEXT: entry:
146 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 32 x half> @llvm.vector.insert.nxv32f16.nxv8f16(<vscale x 32 x half> [[TUPLE:%.*]], <vscale x 8 x half> [[X:%.*]], i64 8)
147 // CPP-CHECK-NEXT: ret <vscale x 32 x half> [[TMP0]]
149 svfloat16x4_t test_svset4_f16(svfloat16x4_t tuple, svfloat16_t x)
151 return SVE_ACLE_FUNC(svset4,_f16,,)(tuple, 1, x);
154 // CHECK-LABEL: @test_svset4_f32(
155 // CHECK-NEXT: entry:
156 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x float> @llvm.vector.insert.nxv16f32.nxv4f32(<vscale x 16 x float> [[TUPLE:%.*]], <vscale x 4 x float> [[X:%.*]], i64 4)
157 // CHECK-NEXT: ret <vscale x 16 x float> [[TMP0]]
159 // CPP-CHECK-LABEL: @_Z15test_svset4_f3213svfloat32x4_tu13__SVFloat32_t(
160 // CPP-CHECK-NEXT: entry:
161 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x float> @llvm.vector.insert.nxv16f32.nxv4f32(<vscale x 16 x float> [[TUPLE:%.*]], <vscale x 4 x float> [[X:%.*]], i64 4)
162 // CPP-CHECK-NEXT: ret <vscale x 16 x float> [[TMP0]]
164 svfloat32x4_t test_svset4_f32(svfloat32x4_t tuple, svfloat32_t x)
166 return SVE_ACLE_FUNC(svset4,_f32,,)(tuple, 1, x);
169 // CHECK-LABEL: @test_svset4_f64(
170 // CHECK-NEXT: entry:
171 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x double> @llvm.vector.insert.nxv8f64.nxv2f64(<vscale x 8 x double> [[TUPLE:%.*]], <vscale x 2 x double> [[X:%.*]], i64 6)
172 // CHECK-NEXT: ret <vscale x 8 x double> [[TMP0]]
174 // CPP-CHECK-LABEL: @_Z15test_svset4_f6413svfloat64x4_tu13__SVFloat64_t(
175 // CPP-CHECK-NEXT: entry:
176 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x double> @llvm.vector.insert.nxv8f64.nxv2f64(<vscale x 8 x double> [[TUPLE:%.*]], <vscale x 2 x double> [[X:%.*]], i64 6)
177 // CPP-CHECK-NEXT: ret <vscale x 8 x double> [[TMP0]]
179 svfloat64x4_t test_svset4_f64(svfloat64x4_t tuple, svfloat64_t x)
181 return SVE_ACLE_FUNC(svset4,_f64,,)(tuple, 3, x);