[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGen / aarch64-neon-fcvt-intrinsics.c
blob670b65070289d330d4fd92a2fc05ae14f42e9ac4
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature
2 // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \
3 // RUN: -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s
5 // REQUIRES: aarch64-registered-target || arm-registered-target
7 #include <arm_neon.h>
9 // CHECK-LABEL: define {{[^@]+}}@test_vcvtxd_f32_f64
10 // CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0:[0-9]+]] {
11 // CHECK-NEXT: entry:
12 // CHECK-NEXT: [[VCVTXD_F32_F64_I:%.*]] = call float @llvm.aarch64.sisd.fcvtxn(double [[A]])
13 // CHECK-NEXT: ret float [[VCVTXD_F32_F64_I]]
15 float32_t test_vcvtxd_f32_f64(float64_t a) {
16 return (float32_t)vcvtxd_f32_f64(a);
19 // CHECK-LABEL: define {{[^@]+}}@test_vcvtas_s32_f32
20 // CHECK-SAME: (float noundef [[A:%.*]]) #[[ATTR0]] {
21 // CHECK-NEXT: entry:
22 // CHECK-NEXT: [[VCVTAS_S32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtas.i32.f32(float [[A]])
23 // CHECK-NEXT: ret i32 [[VCVTAS_S32_F32_I]]
25 int32_t test_vcvtas_s32_f32(float32_t a) {
26 return (int32_t)vcvtas_s32_f32(a);
29 // CHECK-LABEL: define {{[^@]+}}@test_test_vcvtad_s64_f64
30 // CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0]] {
31 // CHECK-NEXT: entry:
32 // CHECK-NEXT: [[VCVTAD_S64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtas.i64.f64(double [[A]])
33 // CHECK-NEXT: ret i64 [[VCVTAD_S64_F64_I]]
35 int64_t test_test_vcvtad_s64_f64(float64_t a) {
36 return (int64_t)vcvtad_s64_f64(a);
39 // CHECK-LABEL: define {{[^@]+}}@test_vcvtas_u32_f32
40 // CHECK-SAME: (float noundef [[A:%.*]]) #[[ATTR0]] {
41 // CHECK-NEXT: entry:
42 // CHECK-NEXT: [[VCVTAS_U32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtau.i32.f32(float [[A]])
43 // CHECK-NEXT: ret i32 [[VCVTAS_U32_F32_I]]
45 uint32_t test_vcvtas_u32_f32(float32_t a) {
46 return (uint32_t)vcvtas_u32_f32(a);
49 // CHECK-LABEL: define {{[^@]+}}@test_vcvtad_u64_f64
50 // CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0]] {
51 // CHECK-NEXT: entry:
52 // CHECK-NEXT: [[VCVTAD_U64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtau.i64.f64(double [[A]])
53 // CHECK-NEXT: ret i64 [[VCVTAD_U64_F64_I]]
55 uint64_t test_vcvtad_u64_f64(float64_t a) {
56 return (uint64_t)vcvtad_u64_f64(a);
59 // CHECK-LABEL: define {{[^@]+}}@test_vcvtms_s32_f32
60 // CHECK-SAME: (float noundef [[A:%.*]]) #[[ATTR0]] {
61 // CHECK-NEXT: entry:
62 // CHECK-NEXT: [[VCVTMS_S32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtms.i32.f32(float [[A]])
63 // CHECK-NEXT: ret i32 [[VCVTMS_S32_F32_I]]
65 int32_t test_vcvtms_s32_f32(float32_t a) {
66 return (int32_t)vcvtms_s32_f32(a);
69 // CHECK-LABEL: define {{[^@]+}}@test_vcvtmd_s64_f64
70 // CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0]] {
71 // CHECK-NEXT: entry:
72 // CHECK-NEXT: [[VCVTMD_S64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtms.i64.f64(double [[A]])
73 // CHECK-NEXT: ret i64 [[VCVTMD_S64_F64_I]]
75 int64_t test_vcvtmd_s64_f64(float64_t a) {
76 return (int64_t)vcvtmd_s64_f64(a);
79 // CHECK-LABEL: define {{[^@]+}}@test_vcvtms_u32_f32
80 // CHECK-SAME: (float noundef [[A:%.*]]) #[[ATTR0]] {
81 // CHECK-NEXT: entry:
82 // CHECK-NEXT: [[VCVTMS_U32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtmu.i32.f32(float [[A]])
83 // CHECK-NEXT: ret i32 [[VCVTMS_U32_F32_I]]
85 uint32_t test_vcvtms_u32_f32(float32_t a) {
86 return (uint32_t)vcvtms_u32_f32(a);
89 // CHECK-LABEL: define {{[^@]+}}@test_vcvtmd_u64_f64
90 // CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0]] {
91 // CHECK-NEXT: entry:
92 // CHECK-NEXT: [[VCVTMD_U64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtmu.i64.f64(double [[A]])
93 // CHECK-NEXT: ret i64 [[VCVTMD_U64_F64_I]]
95 uint64_t test_vcvtmd_u64_f64(float64_t a) {
96 return (uint64_t)vcvtmd_u64_f64(a);
99 // CHECK-LABEL: define {{[^@]+}}@test_vcvtns_s32_f32
100 // CHECK-SAME: (float noundef [[A:%.*]]) #[[ATTR0]] {
101 // CHECK-NEXT: entry:
102 // CHECK-NEXT: [[VCVTNS_S32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtns.i32.f32(float [[A]])
103 // CHECK-NEXT: ret i32 [[VCVTNS_S32_F32_I]]
105 int32_t test_vcvtns_s32_f32(float32_t a) {
106 return (int32_t)vcvtns_s32_f32(a);
109 // CHECK-LABEL: define {{[^@]+}}@test_vcvtnd_s64_f64
110 // CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0]] {
111 // CHECK-NEXT: entry:
112 // CHECK-NEXT: [[VCVTND_S64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtns.i64.f64(double [[A]])
113 // CHECK-NEXT: ret i64 [[VCVTND_S64_F64_I]]
115 int64_t test_vcvtnd_s64_f64(float64_t a) {
116 return (int64_t)vcvtnd_s64_f64(a);
119 // CHECK-LABEL: define {{[^@]+}}@test_vcvtns_u32_f32
120 // CHECK-SAME: (float noundef [[A:%.*]]) #[[ATTR0]] {
121 // CHECK-NEXT: entry:
122 // CHECK-NEXT: [[VCVTNS_U32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtnu.i32.f32(float [[A]])
123 // CHECK-NEXT: ret i32 [[VCVTNS_U32_F32_I]]
125 uint32_t test_vcvtns_u32_f32(float32_t a) {
126 return (uint32_t)vcvtns_u32_f32(a);
129 // CHECK-LABEL: define {{[^@]+}}@test_vcvtnd_u64_f64
130 // CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0]] {
131 // CHECK-NEXT: entry:
132 // CHECK-NEXT: [[VCVTND_U64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtnu.i64.f64(double [[A]])
133 // CHECK-NEXT: ret i64 [[VCVTND_U64_F64_I]]
135 uint64_t test_vcvtnd_u64_f64(float64_t a) {
136 return (uint64_t)vcvtnd_u64_f64(a);
139 // CHECK-LABEL: define {{[^@]+}}@test_vcvtps_s32_f32
140 // CHECK-SAME: (float noundef [[A:%.*]]) #[[ATTR0]] {
141 // CHECK-NEXT: entry:
142 // CHECK-NEXT: [[VCVTPS_S32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtps.i32.f32(float [[A]])
143 // CHECK-NEXT: ret i32 [[VCVTPS_S32_F32_I]]
145 int32_t test_vcvtps_s32_f32(float32_t a) {
146 return (int32_t)vcvtps_s32_f32(a);
149 // CHECK-LABEL: define {{[^@]+}}@test_vcvtpd_s64_f64
150 // CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0]] {
151 // CHECK-NEXT: entry:
152 // CHECK-NEXT: [[VCVTPD_S64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtps.i64.f64(double [[A]])
153 // CHECK-NEXT: ret i64 [[VCVTPD_S64_F64_I]]
155 int64_t test_vcvtpd_s64_f64(float64_t a) {
156 return (int64_t)vcvtpd_s64_f64(a);
159 // CHECK-LABEL: define {{[^@]+}}@test_vcvtps_u32_f32
160 // CHECK-SAME: (float noundef [[A:%.*]]) #[[ATTR0]] {
161 // CHECK-NEXT: entry:
162 // CHECK-NEXT: [[VCVTPS_U32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtpu.i32.f32(float [[A]])
163 // CHECK-NEXT: ret i32 [[VCVTPS_U32_F32_I]]
165 uint32_t test_vcvtps_u32_f32(float32_t a) {
166 return (uint32_t)vcvtps_u32_f32(a);
169 // CHECK-LABEL: define {{[^@]+}}@test_vcvtpd_u64_f64
170 // CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0]] {
171 // CHECK-NEXT: entry:
172 // CHECK-NEXT: [[VCVTPD_U64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtpu.i64.f64(double [[A]])
173 // CHECK-NEXT: ret i64 [[VCVTPD_U64_F64_I]]
175 uint64_t test_vcvtpd_u64_f64(float64_t a) {
176 return (uint64_t)vcvtpd_u64_f64(a);
179 // CHECK-LABEL: define {{[^@]+}}@test_vcvts_s32_f32
180 // CHECK-SAME: (float noundef [[A:%.*]]) #[[ATTR0]] {
181 // CHECK-NEXT: entry:
182 // CHECK-NEXT: [[VCVTS_S32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtzs.i32.f32(float [[A]])
183 // CHECK-NEXT: ret i32 [[VCVTS_S32_F32_I]]
185 int32_t test_vcvts_s32_f32(float32_t a) {
186 return (int32_t)vcvts_s32_f32(a);
189 // CHECK-LABEL: define {{[^@]+}}@test_vcvtd_s64_f64
190 // CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0]] {
191 // CHECK-NEXT: entry:
192 // CHECK-NEXT: [[VCVTD_S64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtzs.i64.f64(double [[A]])
193 // CHECK-NEXT: ret i64 [[VCVTD_S64_F64_I]]
195 int64_t test_vcvtd_s64_f64(float64_t a) {
196 return (int64_t)vcvtd_s64_f64(a);
199 // CHECK-LABEL: define {{[^@]+}}@test_vcvts_u32_f32
200 // CHECK-SAME: (float noundef [[A:%.*]]) #[[ATTR0]] {
201 // CHECK-NEXT: entry:
202 // CHECK-NEXT: [[VCVTS_U32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtzu.i32.f32(float [[A]])
203 // CHECK-NEXT: ret i32 [[VCVTS_U32_F32_I]]
205 uint32_t test_vcvts_u32_f32(float32_t a) {
206 return (uint32_t)vcvts_u32_f32(a);
209 // CHECK-LABEL: define {{[^@]+}}@test_vcvtd_u64_f64
210 // CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0]] {
211 // CHECK-NEXT: entry:
212 // CHECK-NEXT: [[VCVTD_U64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtzu.i64.f64(double [[A]])
213 // CHECK-NEXT: ret i64 [[VCVTD_U64_F64_I]]
215 uint64_t test_vcvtd_u64_f64(float64_t a) {
216 return (uint64_t)vcvtd_u64_f64(a);