File: aarch64-neon-fcvt-intrinsics.c

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (217 lines) | stat: -rw-r--r-- 8,040 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature
// RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \
// RUN:  -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s

// REQUIRES: aarch64-registered-target || arm-registered-target

#include <arm_neon.h>

// CHECK-LABEL: define {{[^@]+}}@test_vcvtxd_f32_f64
// CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0:[0-9]+]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTXD_F32_F64_I:%.*]] = call float @llvm.aarch64.sisd.fcvtxn(double [[A]])
// CHECK-NEXT:    ret float [[VCVTXD_F32_F64_I]]
//
float32_t test_vcvtxd_f32_f64(float64_t a) {
  return (float32_t)vcvtxd_f32_f64(a);
}

// CHECK-LABEL: define {{[^@]+}}@test_vcvtas_s32_f32
// CHECK-SAME: (float noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTAS_S32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtas.i32.f32(float [[A]])
// CHECK-NEXT:    ret i32 [[VCVTAS_S32_F32_I]]
//
int32_t test_vcvtas_s32_f32(float32_t a) {
  return (int32_t)vcvtas_s32_f32(a);
}

// CHECK-LABEL: define {{[^@]+}}@test_test_vcvtad_s64_f64
// CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTAD_S64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtas.i64.f64(double [[A]])
// CHECK-NEXT:    ret i64 [[VCVTAD_S64_F64_I]]
//
int64_t test_test_vcvtad_s64_f64(float64_t a) {
  return (int64_t)vcvtad_s64_f64(a);
}

// CHECK-LABEL: define {{[^@]+}}@test_vcvtas_u32_f32
// CHECK-SAME: (float noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTAS_U32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtau.i32.f32(float [[A]])
// CHECK-NEXT:    ret i32 [[VCVTAS_U32_F32_I]]
//
uint32_t test_vcvtas_u32_f32(float32_t a) {
  return (uint32_t)vcvtas_u32_f32(a);
}

// CHECK-LABEL: define {{[^@]+}}@test_vcvtad_u64_f64
// CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTAD_U64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtau.i64.f64(double [[A]])
// CHECK-NEXT:    ret i64 [[VCVTAD_U64_F64_I]]
//
uint64_t test_vcvtad_u64_f64(float64_t a) {
  return (uint64_t)vcvtad_u64_f64(a);
}

// CHECK-LABEL: define {{[^@]+}}@test_vcvtms_s32_f32
// CHECK-SAME: (float noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTMS_S32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtms.i32.f32(float [[A]])
// CHECK-NEXT:    ret i32 [[VCVTMS_S32_F32_I]]
//
int32_t test_vcvtms_s32_f32(float32_t a) {
  return (int32_t)vcvtms_s32_f32(a);
}

// CHECK-LABEL: define {{[^@]+}}@test_vcvtmd_s64_f64
// CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTMD_S64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtms.i64.f64(double [[A]])
// CHECK-NEXT:    ret i64 [[VCVTMD_S64_F64_I]]
//
int64_t test_vcvtmd_s64_f64(float64_t a) {
  return (int64_t)vcvtmd_s64_f64(a);
}

// CHECK-LABEL: define {{[^@]+}}@test_vcvtms_u32_f32
// CHECK-SAME: (float noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTMS_U32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtmu.i32.f32(float [[A]])
// CHECK-NEXT:    ret i32 [[VCVTMS_U32_F32_I]]
//
uint32_t test_vcvtms_u32_f32(float32_t a) {
  return (uint32_t)vcvtms_u32_f32(a);
}

// CHECK-LABEL: define {{[^@]+}}@test_vcvtmd_u64_f64
// CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTMD_U64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtmu.i64.f64(double [[A]])
// CHECK-NEXT:    ret i64 [[VCVTMD_U64_F64_I]]
//
uint64_t test_vcvtmd_u64_f64(float64_t a) {
  return (uint64_t)vcvtmd_u64_f64(a);
}

// CHECK-LABEL: define {{[^@]+}}@test_vcvtns_s32_f32
// CHECK-SAME: (float noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTNS_S32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtns.i32.f32(float [[A]])
// CHECK-NEXT:    ret i32 [[VCVTNS_S32_F32_I]]
//
int32_t test_vcvtns_s32_f32(float32_t a) {
  return (int32_t)vcvtns_s32_f32(a);
}

// CHECK-LABEL: define {{[^@]+}}@test_vcvtnd_s64_f64
// CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTND_S64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtns.i64.f64(double [[A]])
// CHECK-NEXT:    ret i64 [[VCVTND_S64_F64_I]]
//
int64_t test_vcvtnd_s64_f64(float64_t a) {
  return (int64_t)vcvtnd_s64_f64(a);
}

// CHECK-LABEL: define {{[^@]+}}@test_vcvtns_u32_f32
// CHECK-SAME: (float noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTNS_U32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtnu.i32.f32(float [[A]])
// CHECK-NEXT:    ret i32 [[VCVTNS_U32_F32_I]]
//
uint32_t test_vcvtns_u32_f32(float32_t a) {
  return (uint32_t)vcvtns_u32_f32(a);
}

// CHECK-LABEL: define {{[^@]+}}@test_vcvtnd_u64_f64
// CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTND_U64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtnu.i64.f64(double [[A]])
// CHECK-NEXT:    ret i64 [[VCVTND_U64_F64_I]]
//
uint64_t test_vcvtnd_u64_f64(float64_t a) {
  return (uint64_t)vcvtnd_u64_f64(a);
}

// CHECK-LABEL: define {{[^@]+}}@test_vcvtps_s32_f32
// CHECK-SAME: (float noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTPS_S32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtps.i32.f32(float [[A]])
// CHECK-NEXT:    ret i32 [[VCVTPS_S32_F32_I]]
//
int32_t test_vcvtps_s32_f32(float32_t a) {
  return (int32_t)vcvtps_s32_f32(a);
}

// CHECK-LABEL: define {{[^@]+}}@test_vcvtpd_s64_f64
// CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTPD_S64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtps.i64.f64(double [[A]])
// CHECK-NEXT:    ret i64 [[VCVTPD_S64_F64_I]]
//
int64_t test_vcvtpd_s64_f64(float64_t a) {
  return (int64_t)vcvtpd_s64_f64(a);
}

// CHECK-LABEL: define {{[^@]+}}@test_vcvtps_u32_f32
// CHECK-SAME: (float noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTPS_U32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtpu.i32.f32(float [[A]])
// CHECK-NEXT:    ret i32 [[VCVTPS_U32_F32_I]]
//
uint32_t test_vcvtps_u32_f32(float32_t a) {
  return (uint32_t)vcvtps_u32_f32(a);
}

// CHECK-LABEL: define {{[^@]+}}@test_vcvtpd_u64_f64
// CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTPD_U64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtpu.i64.f64(double [[A]])
// CHECK-NEXT:    ret i64 [[VCVTPD_U64_F64_I]]
//
uint64_t test_vcvtpd_u64_f64(float64_t a) {
  return (uint64_t)vcvtpd_u64_f64(a);
}

// CHECK-LABEL: define {{[^@]+}}@test_vcvts_s32_f32
// CHECK-SAME: (float noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTS_S32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtzs.i32.f32(float [[A]])
// CHECK-NEXT:    ret i32 [[VCVTS_S32_F32_I]]
//
int32_t test_vcvts_s32_f32(float32_t a) {
  return (int32_t)vcvts_s32_f32(a);
}

// CHECK-LABEL: define {{[^@]+}}@test_vcvtd_s64_f64
// CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTD_S64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtzs.i64.f64(double [[A]])
// CHECK-NEXT:    ret i64 [[VCVTD_S64_F64_I]]
//
int64_t test_vcvtd_s64_f64(float64_t a) {
  return (int64_t)vcvtd_s64_f64(a);
}

// CHECK-LABEL: define {{[^@]+}}@test_vcvts_u32_f32
// CHECK-SAME: (float noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTS_U32_F32_I:%.*]] = call i32 @llvm.aarch64.neon.fcvtzu.i32.f32(float [[A]])
// CHECK-NEXT:    ret i32 [[VCVTS_U32_F32_I]]
//
uint32_t test_vcvts_u32_f32(float32_t a) {
  return (uint32_t)vcvts_u32_f32(a);
}

// CHECK-LABEL: define {{[^@]+}}@test_vcvtd_u64_f64
// CHECK-SAME: (double noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK-NEXT:  entry:
// CHECK-NEXT:    [[VCVTD_U64_F64_I:%.*]] = call i64 @llvm.aarch64.neon.fcvtzu.i64.f64(double [[A]])
// CHECK-NEXT:    ret i64 [[VCVTD_U64_F64_I]]
//
uint64_t test_vcvtd_u64_f64(float64_t a) {
  return (uint64_t)vcvtd_u64_f64(a);
}