1*f4a2713aSLionel Sambuc // REQUIRES: arm-registered-target
2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple thumbv7-apple-darwin \
3*f4a2713aSLionel Sambuc // RUN: -target-abi apcs-gnu \
4*f4a2713aSLionel Sambuc // RUN: -target-cpu cortex-a8 \
5*f4a2713aSLionel Sambuc // RUN: -mfloat-abi soft \
6*f4a2713aSLionel Sambuc // RUN: -target-feature +soft-float-abi \
7*f4a2713aSLionel Sambuc // RUN: -ffreestanding \
8*f4a2713aSLionel Sambuc // RUN: -emit-llvm -w -o - %s | FileCheck %s
9*f4a2713aSLionel Sambuc
10*f4a2713aSLionel Sambuc #include <arm_neon.h>
11*f4a2713aSLionel Sambuc
12*f4a2713aSLionel Sambuc // Radar 11998303: Avoid using i64 types for vld1q_lane and vst1q_lane Neon
13*f4a2713aSLionel Sambuc // intrinsics with <2 x i64> vectors to avoid poor code for i64 in the backend.
t1(uint64_t * src,uint8_t * dst)14*f4a2713aSLionel Sambuc void t1(uint64_t *src, uint8_t *dst) {
15*f4a2713aSLionel Sambuc // CHECK: @t1
16*f4a2713aSLionel Sambuc uint64x2_t q = vld1q_u64(src);
17*f4a2713aSLionel Sambuc // CHECK: call <2 x i64> @llvm.arm.neon.vld1.v2i64
18*f4a2713aSLionel Sambuc vst1q_lane_u64(dst, q, 1);
19*f4a2713aSLionel Sambuc // CHECK: bitcast <16 x i8> %{{.*}} to <2 x i64>
20*f4a2713aSLionel Sambuc // CHECK: shufflevector <2 x i64>
21*f4a2713aSLionel Sambuc // CHECK: call void @llvm.arm.neon.vst1.v1i64
22*f4a2713aSLionel Sambuc }
23*f4a2713aSLionel Sambuc
t2(uint64_t * src1,uint8_t * src2,uint64x2_t * dst)24*f4a2713aSLionel Sambuc void t2(uint64_t *src1, uint8_t *src2, uint64x2_t *dst) {
25*f4a2713aSLionel Sambuc // CHECK: @t2
26*f4a2713aSLionel Sambuc uint64x2_t q = vld1q_u64(src1);
27*f4a2713aSLionel Sambuc // CHECK: call <2 x i64> @llvm.arm.neon.vld1.v2i64
28*f4a2713aSLionel Sambuc q = vld1q_lane_u64(src2, q, 0);
29*f4a2713aSLionel Sambuc // CHECK: shufflevector <2 x i64>
30*f4a2713aSLionel Sambuc // CHECK: call <1 x i64> @llvm.arm.neon.vld1.v1i64
31*f4a2713aSLionel Sambuc // CHECK: shufflevector <1 x i64>
32*f4a2713aSLionel Sambuc *dst = q;
33*f4a2713aSLionel Sambuc // CHECK: store <2 x i64>
34*f4a2713aSLionel Sambuc }
35