104 lines · c
1// RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s2// RUN: %clang_cc1 -triple aarch64_be-linux-gnu -target-feature +neon -ffreestanding -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s --check-prefix CHECK-BE3 4// REQUIRES: aarch64-registered-target || arm-registered-target5 6#include <arm_neon.h>7 8int8_t test_vdupb_lane_s8(int8x8_t src) {9 return vdupb_lane_s8(src, 2);10 // CHECK-LABEL: @test_vdupb_lane_s811 // CHECK: extractelement <8 x i8> %src, i32 212 13 // CHECK-BE-LABEL: @test_vdupb_lane_s814 // CHECK-BE: [[REV:%.*]] = shufflevector <8 x i8> %src, <8 x i8> %src, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>15 // CHECK-BE: extractelement <8 x i8> [[REV]], i32 216}17 18uint8_t test_vdupb_lane_u8(uint8x8_t src) {19 return vdupb_lane_u8(src, 2);20 // CHECK-LABEL: @test_vdupb_lane_u821 // CHECK: extractelement <8 x i8> %src, i32 222 23 // CHECK-BE-LABEL: @test_vdupb_lane_u824 // CHECK-BE: [[REV:%.*]] = shufflevector <8 x i8> %src, <8 x i8> %src, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>25 // CHECK-BE: extractelement <8 x i8> [[REV]], i32 226}27 28int16_t test_vduph_lane_s16(int16x4_t src) {29 return vduph_lane_s16(src, 2);30 // CHECK-LABEL: @test_vduph_lane_s1631 // CHECK: extractelement <4 x i16> %src, i32 232 33 // CHECK-BE-LABEL: @test_vduph_lane_s1634 // CHECK-BE: [[REV:%.*]] = shufflevector <4 x i16> %src, <4 x i16> %src, <4 x i32> <i32 3, i32 2, i32 1, i32 0>35 // CHECK-BE: extractelement <4 x i16> [[REV]], i32 236}37 38uint16_t test_vduph_lane_u16(uint16x4_t src) {39 return vduph_lane_u16(src, 2);40 // CHECK-LABEL: @test_vduph_lane_u1641 // CHECK: extractelement <4 x i16> %src, i32 242 43 // CHECK-BE-LABEL: @test_vduph_lane_u1644 // CHECK-BE: [[REV:%.*]] = shufflevector <4 x i16> %src, <4 x i16> %src, <4 x i32> <i32 3, i32 2, i32 1, i32 0>45 // CHECK-BE: extractelement <4 x i16> [[REV]], i32 246}47 48int32_t test_vdups_lane_s32(int32x2_t src) {49 return vdups_lane_s32(src, 0);50 // CHECK-LABEL: @test_vdups_lane_s3251 // CHECK: extractelement <2 x i32> %src, i32 052 53 // CHECK-BE-LABEL: @test_vdups_lane_s3254 // CHECK-BE: [[REV:%.*]] = shufflevector <2 x i32> %src, <2 x i32> %src, <2 x i32> <i32 1, i32 0>55 // CHECK-BE: extractelement <2 x i32> [[REV]], i32 056}57 58uint32_t test_vdups_lane_u32(uint32x2_t src) {59 return vdups_lane_u32(src, 0);60 // CHECK-LABEL: @test_vdups_lane_u3261 // CHECK: extractelement <2 x i32> %src, i32 062 63 // CHECK-BE-LABEL: @test_vdups_lane_u3264 // CHECK-BE: [[REV:%.*]] = shufflevector <2 x i32> %src, <2 x i32> %src, <2 x i32> <i32 1, i32 0>65 // CHECK-BE: extractelement <2 x i32> [[REV]], i32 066}67 68float32_t test_vdups_lane_f32(float32x2_t src) {69 return vdups_lane_f32(src, 0);70 // CHECK-LABEL: @test_vdups_lane_f3271 // CHECK: extractelement <2 x float> %src, i32 072 73 // CHECK-BE-LABEL: @test_vdups_lane_f3274 // CHECK-BE: [[REV:%.*]] = shufflevector <2 x float> %src, <2 x float> %src, <2 x i32> <i32 1, i32 0>75 // CHECK-BE: extractelement <2 x float> [[REV]], i32 076}77 78int64_t test_vdupd_lane_s64(int64x1_t src) {79 return vdupd_lane_s64(src, 0);80 // CHECK-LABEL: @test_vdupd_lane_s6481 // CHECK: extractelement <1 x i64> %src, i32 082 83 // CHECK-BE-LABEL: @test_vdupd_lane_s6484 // CHECK-BE: extractelement <1 x i64> %src, i32 085}86 87uint64_t test_vdupd_lane_u64(uint64x1_t src) {88 return vdupd_lane_u64(src, 0);89 // CHECK-LABEL: @test_vdupd_lane_u6490 // CHECK: extractelement <1 x i64> %src, i32 091 92 // CHECK-BE-LABEL: @test_vdupd_lane_u6493 // CHECK-BE: extractelement <1 x i64> %src, i32 094}95 96float64_t test_vdupd_lane_f64(float64x1_t src) {97 return vdupd_lane_f64(src, 0);98 // CHECK-LABEL: @test_vdupd_lane_f6499 // CHECK: extractelement <1 x double> %src, i32 0100 101 // CHECK-BE-LABEL: @test_vdupd_lane_f64102 // CHECK-BE: extractelement <1 x double> %src, i32 0103}104