Stephen Hines | c568f1e | 2014-07-21 00:47:37 -0700 | [diff] [blame] | 1 | // REQUIRES: aarch64-registered-target |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 2 | // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \ |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 3 | // RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 4 | |
| 5 | // Test new aarch64 intrinsics and types |
| 6 | |
| 7 | #include <arm_neon.h> |
| 8 | |
| 9 | float32_t test_vcvtxd_f32_f64(float64_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 10 | // CHECK-LABEL: test_vcvtxd_f32_f64 |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 11 | // CHECK: fcvtxn {{s[0-9]+}}, {{d[0-9]+}} |
| 12 | return (float32_t)vcvtxd_f32_f64(a); |
| 13 | } |
| 14 | |
| 15 | int32_t test_vcvtas_s32_f32(float32_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 16 | // CHECK-LABEL: test_vcvtas_s32_f32 |
| 17 | // CHECK: fcvtas {{[ws][0-9]+}}, {{s[0-9]+}} |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 18 | return (int32_t)vcvtas_s32_f32(a); |
| 19 | } |
| 20 | |
| 21 | int64_t test_test_vcvtad_s64_f64(float64_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 22 | // CHECK-LABEL: test_test_vcvtad_s64_f64 |
| 23 | // CHECK: fcvtas {{[dx][0-9]+}}, {{d[0-9]+}} |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 24 | return (int64_t)vcvtad_s64_f64(a); |
| 25 | } |
| 26 | |
| 27 | uint32_t test_vcvtas_u32_f32(float32_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 28 | // CHECK-LABEL: test_vcvtas_u32_f32 |
| 29 | // CHECK: fcvtau {{[ws][0-9]+}}, {{s[0-9]+}} |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 30 | return (uint32_t)vcvtas_u32_f32(a); |
| 31 | } |
| 32 | |
| 33 | uint64_t test_vcvtad_u64_f64(float64_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 34 | // CHECK-LABEL: test_vcvtad_u64_f64 |
| 35 | // CHECK: fcvtau {{[xd][0-9]+}}, {{d[0-9]+}} |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 36 | return (uint64_t)vcvtad_u64_f64(a); |
| 37 | } |
| 38 | |
| 39 | int32_t test_vcvtms_s32_f32(float32_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 40 | // CHECK-LABEL: test_vcvtms_s32_f32 |
| 41 | // CHECK: fcvtms {{[sw][0-9]+}}, {{s[0-9]+}} |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 42 | return (int32_t)vcvtms_s32_f32(a); |
| 43 | } |
| 44 | |
| 45 | int64_t test_vcvtmd_s64_f64(float64_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 46 | // CHECK-LABEL: test_vcvtmd_s64_f64 |
| 47 | // CHECK: fcvtms {{[dx][0-9]+}}, {{d[0-9]+}} |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 48 | return (int64_t)vcvtmd_s64_f64(a); |
| 49 | } |
| 50 | |
| 51 | uint32_t test_vcvtms_u32_f32(float32_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 52 | // CHECK-LABEL: test_vcvtms_u32_f32 |
| 53 | // CHECK: fcvtmu {{[ws][0-9]+}}, {{s[0-9]+}} |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 54 | return (uint32_t)vcvtms_u32_f32(a); |
| 55 | } |
| 56 | |
| 57 | uint64_t test_vcvtmd_u64_f64(float64_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 58 | // CHECK-LABEL: test_vcvtmd_u64_f64 |
| 59 | // CHECK: fcvtmu {{[xd][0-9]+}}, {{d[0-9]+}} |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 60 | return (uint64_t)vcvtmd_u64_f64(a); |
| 61 | } |
| 62 | |
| 63 | int32_t test_vcvtns_s32_f32(float32_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 64 | // CHECK-LABEL: test_vcvtns_s32_f32 |
| 65 | // CHECK: fcvtns {{[sw][0-9]+}}, {{s[0-9]+}} |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 66 | return (int32_t)vcvtns_s32_f32(a); |
| 67 | } |
| 68 | |
| 69 | int64_t test_vcvtnd_s64_f64(float64_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 70 | // CHECK-LABEL: test_vcvtnd_s64_f64 |
| 71 | // CHECK: fcvtns {{[dx][0-9]+}}, {{d[0-9]+}} |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 72 | return (int64_t)vcvtnd_s64_f64(a); |
| 73 | } |
| 74 | |
| 75 | uint32_t test_vcvtns_u32_f32(float32_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 76 | // CHECK-LABEL: test_vcvtns_u32_f32 |
| 77 | // CHECK: fcvtnu {{[sw][0-9]+}}, {{s[0-9]+}} |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 78 | return (uint32_t)vcvtns_u32_f32(a); |
| 79 | } |
| 80 | |
| 81 | uint64_t test_vcvtnd_u64_f64(float64_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 82 | // CHECK-LABEL: test_vcvtnd_u64_f64 |
| 83 | // CHECK: fcvtnu {{[dx][0-9]+}}, {{d[0-9]+}} |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 84 | return (uint64_t)vcvtnd_u64_f64(a); |
| 85 | } |
| 86 | |
| 87 | int32_t test_vcvtps_s32_f32(float32_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 88 | // CHECK-LABEL: test_vcvtps_s32_f32 |
| 89 | // CHECK: fcvtps {{[sw][0-9]+}}, {{s[0-9]+}} |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 90 | return (int32_t)vcvtps_s32_f32(a); |
| 91 | } |
| 92 | |
| 93 | int64_t test_vcvtpd_s64_f64(float64_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 94 | // CHECK-LABEL: test_vcvtpd_s64_f64 |
| 95 | // CHECK: fcvtps {{[dx][0-9]+}}, {{d[0-9]+}} |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 96 | return (int64_t)vcvtpd_s64_f64(a); |
| 97 | } |
| 98 | |
| 99 | uint32_t test_vcvtps_u32_f32(float32_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 100 | // CHECK-LABEL: test_vcvtps_u32_f32 |
| 101 | // CHECK: fcvtpu {{[sw][0-9]+}}, {{s[0-9]+}} |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 102 | return (uint32_t)vcvtps_u32_f32(a); |
| 103 | } |
| 104 | |
| 105 | uint64_t test_vcvtpd_u64_f64(float64_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 106 | // CHECK-LABEL: test_vcvtpd_u64_f64 |
| 107 | // CHECK: fcvtpu {{[dx][0-9]+}}, {{d[0-9]+}} |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 108 | return (uint64_t)vcvtpd_u64_f64(a); |
| 109 | } |
| 110 | |
| 111 | int32_t test_vcvts_s32_f32(float32_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 112 | // CHECK-LABEL: test_vcvts_s32_f32 |
| 113 | // CHECK: fcvtzs {{[sw][0-9]+}}, {{s[0-9]+}} |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 114 | return (int32_t)vcvts_s32_f32(a); |
| 115 | } |
| 116 | |
| 117 | int64_t test_vcvtd_s64_f64(float64_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 118 | // CHECK-LABEL: test_vcvtd_s64_f64 |
| 119 | // CHECK: fcvtzs {{[dx][0-9]+}}, {{d[0-9]+}} |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 120 | return (int64_t)vcvtd_s64_f64(a); |
| 121 | } |
| 122 | |
| 123 | uint32_t test_vcvts_u32_f32(float32_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 124 | // CHECK-LABEL: test_vcvts_u32_f32 |
| 125 | // CHECK: fcvtzu {{[sw][0-9]+}}, {{s[0-9]+}} |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 126 | return (uint32_t)vcvts_u32_f32(a); |
| 127 | } |
| 128 | |
| 129 | uint64_t test_vcvtd_u64_f64(float64_t a) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 130 | // CHECK-LABEL: test_vcvtd_u64_f64 |
| 131 | // CHECK: fcvtzu {{[dx][0-9]+}}, {{d[0-9]+}} |
Bill Wendling | c02b18c | 2013-12-01 03:04:49 +0000 | [diff] [blame] | 132 | return (uint64_t)vcvtd_u64_f64(a); |
| 133 | } |