blob: d1b9996b0b6853ca556df09aa453d7c29b2fd90c [file] [log] [blame]
Stephen Hinesc568f1e2014-07-21 00:47:37 -07001// REQUIRES: aarch64-registered-target
Stephen Hines6bcf27b2014-05-29 04:14:42 -07002// RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \
Stephen Hines651f13c2014-04-23 16:59:28 -07003// RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
Bill Wendlingc02b18c2013-12-01 03:04:49 +00004
5// Test new aarch64 intrinsics and types
6
7#include <arm_neon.h>
8
9float32_t test_vcvtxd_f32_f64(float64_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -070010// CHECK-LABEL: test_vcvtxd_f32_f64
Bill Wendlingc02b18c2013-12-01 03:04:49 +000011// CHECK: fcvtxn {{s[0-9]+}}, {{d[0-9]+}}
12 return (float32_t)vcvtxd_f32_f64(a);
13}
14
15int32_t test_vcvtas_s32_f32(float32_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -070016// CHECK-LABEL: test_vcvtas_s32_f32
17// CHECK: fcvtas {{[ws][0-9]+}}, {{s[0-9]+}}
Bill Wendlingc02b18c2013-12-01 03:04:49 +000018 return (int32_t)vcvtas_s32_f32(a);
19}
20
21int64_t test_test_vcvtad_s64_f64(float64_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -070022// CHECK-LABEL: test_test_vcvtad_s64_f64
23// CHECK: fcvtas {{[dx][0-9]+}}, {{d[0-9]+}}
Bill Wendlingc02b18c2013-12-01 03:04:49 +000024 return (int64_t)vcvtad_s64_f64(a);
25}
26
27uint32_t test_vcvtas_u32_f32(float32_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -070028// CHECK-LABEL: test_vcvtas_u32_f32
29// CHECK: fcvtau {{[ws][0-9]+}}, {{s[0-9]+}}
Bill Wendlingc02b18c2013-12-01 03:04:49 +000030 return (uint32_t)vcvtas_u32_f32(a);
31}
32
33uint64_t test_vcvtad_u64_f64(float64_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -070034// CHECK-LABEL: test_vcvtad_u64_f64
35// CHECK: fcvtau {{[xd][0-9]+}}, {{d[0-9]+}}
Bill Wendlingc02b18c2013-12-01 03:04:49 +000036 return (uint64_t)vcvtad_u64_f64(a);
37}
38
39int32_t test_vcvtms_s32_f32(float32_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -070040// CHECK-LABEL: test_vcvtms_s32_f32
41// CHECK: fcvtms {{[sw][0-9]+}}, {{s[0-9]+}}
Bill Wendlingc02b18c2013-12-01 03:04:49 +000042 return (int32_t)vcvtms_s32_f32(a);
43}
44
45int64_t test_vcvtmd_s64_f64(float64_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -070046// CHECK-LABEL: test_vcvtmd_s64_f64
47// CHECK: fcvtms {{[dx][0-9]+}}, {{d[0-9]+}}
Bill Wendlingc02b18c2013-12-01 03:04:49 +000048 return (int64_t)vcvtmd_s64_f64(a);
49}
50
51uint32_t test_vcvtms_u32_f32(float32_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -070052// CHECK-LABEL: test_vcvtms_u32_f32
53// CHECK: fcvtmu {{[ws][0-9]+}}, {{s[0-9]+}}
Bill Wendlingc02b18c2013-12-01 03:04:49 +000054 return (uint32_t)vcvtms_u32_f32(a);
55}
56
57uint64_t test_vcvtmd_u64_f64(float64_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -070058// CHECK-LABEL: test_vcvtmd_u64_f64
59// CHECK: fcvtmu {{[xd][0-9]+}}, {{d[0-9]+}}
Bill Wendlingc02b18c2013-12-01 03:04:49 +000060 return (uint64_t)vcvtmd_u64_f64(a);
61}
62
63int32_t test_vcvtns_s32_f32(float32_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -070064// CHECK-LABEL: test_vcvtns_s32_f32
65// CHECK: fcvtns {{[sw][0-9]+}}, {{s[0-9]+}}
Bill Wendlingc02b18c2013-12-01 03:04:49 +000066 return (int32_t)vcvtns_s32_f32(a);
67}
68
69int64_t test_vcvtnd_s64_f64(float64_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -070070// CHECK-LABEL: test_vcvtnd_s64_f64
71// CHECK: fcvtns {{[dx][0-9]+}}, {{d[0-9]+}}
Bill Wendlingc02b18c2013-12-01 03:04:49 +000072 return (int64_t)vcvtnd_s64_f64(a);
73}
74
75uint32_t test_vcvtns_u32_f32(float32_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -070076// CHECK-LABEL: test_vcvtns_u32_f32
77// CHECK: fcvtnu {{[sw][0-9]+}}, {{s[0-9]+}}
Bill Wendlingc02b18c2013-12-01 03:04:49 +000078 return (uint32_t)vcvtns_u32_f32(a);
79}
80
81uint64_t test_vcvtnd_u64_f64(float64_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -070082// CHECK-LABEL: test_vcvtnd_u64_f64
83// CHECK: fcvtnu {{[dx][0-9]+}}, {{d[0-9]+}}
Bill Wendlingc02b18c2013-12-01 03:04:49 +000084 return (uint64_t)vcvtnd_u64_f64(a);
85}
86
87int32_t test_vcvtps_s32_f32(float32_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -070088// CHECK-LABEL: test_vcvtps_s32_f32
89// CHECK: fcvtps {{[sw][0-9]+}}, {{s[0-9]+}}
Bill Wendlingc02b18c2013-12-01 03:04:49 +000090 return (int32_t)vcvtps_s32_f32(a);
91}
92
93int64_t test_vcvtpd_s64_f64(float64_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -070094// CHECK-LABEL: test_vcvtpd_s64_f64
95// CHECK: fcvtps {{[dx][0-9]+}}, {{d[0-9]+}}
Bill Wendlingc02b18c2013-12-01 03:04:49 +000096 return (int64_t)vcvtpd_s64_f64(a);
97}
98
99uint32_t test_vcvtps_u32_f32(float32_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -0700100// CHECK-LABEL: test_vcvtps_u32_f32
101// CHECK: fcvtpu {{[sw][0-9]+}}, {{s[0-9]+}}
Bill Wendlingc02b18c2013-12-01 03:04:49 +0000102 return (uint32_t)vcvtps_u32_f32(a);
103}
104
105uint64_t test_vcvtpd_u64_f64(float64_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -0700106// CHECK-LABEL: test_vcvtpd_u64_f64
107// CHECK: fcvtpu {{[dx][0-9]+}}, {{d[0-9]+}}
Bill Wendlingc02b18c2013-12-01 03:04:49 +0000108 return (uint64_t)vcvtpd_u64_f64(a);
109}
110
111int32_t test_vcvts_s32_f32(float32_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -0700112// CHECK-LABEL: test_vcvts_s32_f32
113// CHECK: fcvtzs {{[sw][0-9]+}}, {{s[0-9]+}}
Bill Wendlingc02b18c2013-12-01 03:04:49 +0000114 return (int32_t)vcvts_s32_f32(a);
115}
116
117int64_t test_vcvtd_s64_f64(float64_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -0700118// CHECK-LABEL: test_vcvtd_s64_f64
119// CHECK: fcvtzs {{[dx][0-9]+}}, {{d[0-9]+}}
Bill Wendlingc02b18c2013-12-01 03:04:49 +0000120 return (int64_t)vcvtd_s64_f64(a);
121}
122
123uint32_t test_vcvts_u32_f32(float32_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -0700124// CHECK-LABEL: test_vcvts_u32_f32
125// CHECK: fcvtzu {{[sw][0-9]+}}, {{s[0-9]+}}
Bill Wendlingc02b18c2013-12-01 03:04:49 +0000126 return (uint32_t)vcvts_u32_f32(a);
127}
128
129uint64_t test_vcvtd_u64_f64(float64_t a) {
Stephen Hines651f13c2014-04-23 16:59:28 -0700130// CHECK-LABEL: test_vcvtd_u64_f64
131// CHECK: fcvtzu {{[dx][0-9]+}}, {{d[0-9]+}}
Bill Wendlingc02b18c2013-12-01 03:04:49 +0000132 return (uint64_t)vcvtd_u64_f64(a);
133}