1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -O1 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -S -o - -emit-llvm %s | FileCheck %s
2*0a6a1f1dSLionel Sambuc
3*0a6a1f1dSLionel Sambuc #include <arm_neon.h>
4*0a6a1f1dSLionel Sambuc
test_vcvt_f64_f32(float32x2_t x)5*0a6a1f1dSLionel Sambuc float64x2_t test_vcvt_f64_f32(float32x2_t x) {
6*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vcvt_f64_f32
7*0a6a1f1dSLionel Sambuc return vcvt_f64_f32(x);
8*0a6a1f1dSLionel Sambuc // CHECK: fpext <2 x float> {{%.*}} to <2 x double>
9*0a6a1f1dSLionel Sambuc // CHECK-NEXT: ret
10*0a6a1f1dSLionel Sambuc }
11*0a6a1f1dSLionel Sambuc
test_vcvt_high_f64_f32(float32x4_t x)12*0a6a1f1dSLionel Sambuc float64x2_t test_vcvt_high_f64_f32(float32x4_t x) {
13*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vcvt_high_f64_f32
14*0a6a1f1dSLionel Sambuc return vcvt_high_f64_f32(x);
15*0a6a1f1dSLionel Sambuc // CHECK: [[HIGH:%.*]] = shufflevector <4 x float> {{%.*}}, <4 x float> undef, <2 x i32> <i32 2, i32 3>
16*0a6a1f1dSLionel Sambuc // CHECK-NEXT: fpext <2 x float> [[HIGH]] to <2 x double>
17*0a6a1f1dSLionel Sambuc // CHECK-NEXT: ret
18*0a6a1f1dSLionel Sambuc }
19*0a6a1f1dSLionel Sambuc
test_vcvt_f32_f64(float64x2_t v)20*0a6a1f1dSLionel Sambuc float32x2_t test_vcvt_f32_f64(float64x2_t v) {
21*0a6a1f1dSLionel Sambuc // CHECK: test_vcvt_f32_f64
22*0a6a1f1dSLionel Sambuc return vcvt_f32_f64(v);
23*0a6a1f1dSLionel Sambuc // CHECK: fptrunc <2 x double> {{%.*}} to <2 x float>
24*0a6a1f1dSLionel Sambuc // CHECK-NEXT: ret
25*0a6a1f1dSLionel Sambuc }
26*0a6a1f1dSLionel Sambuc
test_vcvt_high_f32_f64(float32x2_t x,float64x2_t v)27*0a6a1f1dSLionel Sambuc float32x4_t test_vcvt_high_f32_f64(float32x2_t x, float64x2_t v) {
28*0a6a1f1dSLionel Sambuc // CHECK: test_vcvt_high_f32_f64
29*0a6a1f1dSLionel Sambuc return vcvt_high_f32_f64(x, v);
30*0a6a1f1dSLionel Sambuc // CHECK: [[TRUNC:%.*]] = fptrunc <2 x double> {{.*}} to <2 x float>
31*0a6a1f1dSLionel Sambuc // CHECK-NEXT: shufflevector <2 x float> {{.*}}, <2 x float> [[TRUNC]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
32*0a6a1f1dSLionel Sambuc // CHECK-NEXT: ret
33*0a6a1f1dSLionel Sambuc }
34*0a6a1f1dSLionel Sambuc
test_vcvtx_f32_f64(float64x2_t v)35*0a6a1f1dSLionel Sambuc float32x2_t test_vcvtx_f32_f64(float64x2_t v) {
36*0a6a1f1dSLionel Sambuc // CHECK: test_vcvtx_f32_f64
37*0a6a1f1dSLionel Sambuc return vcvtx_f32_f64(v);
38*0a6a1f1dSLionel Sambuc // CHECK: llvm.aarch64.neon.fcvtxn.v2f32.v2f64
39*0a6a1f1dSLionel Sambuc // CHECK-NEXT: ret
40*0a6a1f1dSLionel Sambuc }
41*0a6a1f1dSLionel Sambuc
test_vcvtx_high_f32_f64(float32x2_t x,float64x2_t v)42*0a6a1f1dSLionel Sambuc float32x4_t test_vcvtx_high_f32_f64(float32x2_t x, float64x2_t v) {
43*0a6a1f1dSLionel Sambuc // CHECK: test_vcvtx_high_f32_f64
44*0a6a1f1dSLionel Sambuc return vcvtx_high_f32_f64(x, v);
45*0a6a1f1dSLionel Sambuc // CHECK: llvm.aarch64.neon.fcvtxn.v2f32.v2f64
46*0a6a1f1dSLionel Sambuc // CHECK: shufflevector
47*0a6a1f1dSLionel Sambuc // CHECK: ret
48*0a6a1f1dSLionel Sambuc }
49