brintos

brintos / llvm-project-archived public Read only

0
0
Text · 7.8 KiB · 2013524 Raw
288 lines · c
1// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py2// RUN: %clang_cc1 -triple thumbv8.1m.main-none-none-eabi -target-feature +mve.fp -mfloat-abi hard -O0 -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes='mem2reg,sroa,early-cse<>' | FileCheck %s3// RUN: %clang_cc1 -triple thumbv8.1m.main-none-none-eabi -target-feature +mve.fp -mfloat-abi hard -O0 -disable-O0-optnone -DPOLYMORPHIC -emit-llvm -o - %s | opt -S -passes='mem2reg,sroa,early-cse<>' | FileCheck %s4 5// REQUIRES: aarch64-registered-target || arm-registered-target6 7#include <arm_mve.h>8 9// CHECK-LABEL: @test_vgetq_lane_f16(10// CHECK-NEXT:  entry:11// CHECK-NEXT:    [[TMP0:%.*]] = extractelement <8 x half> [[A:%.*]], i32 212// CHECK-NEXT:    ret half [[TMP0]]13//14float16_t test_vgetq_lane_f16(float16x8_t a)15{16#ifdef POLYMORPHIC17    return vgetq_lane(a, 2);18#else /* POLYMORPHIC */19    return vgetq_lane_f16(a, 2);20#endif /* POLYMORPHIC */21}22 23// CHECK-LABEL: @test_vgetq_lane_f32(24// CHECK-NEXT:  entry:25// CHECK-NEXT:    [[TMP0:%.*]] = extractelement <4 x float> [[A:%.*]], i32 326// CHECK-NEXT:    ret float [[TMP0]]27//28float32_t test_vgetq_lane_f32(float32x4_t a)29{30#ifdef POLYMORPHIC31    return vgetq_lane(a, 3);32#else /* POLYMORPHIC */33    return vgetq_lane_f32(a, 3);34#endif /* POLYMORPHIC */35}36 37// CHECK-LABEL: @test_vgetq_lane_s16(38// CHECK-NEXT:  entry:39// CHECK-NEXT:    [[TMP0:%.*]] = extractelement <8 x i16> [[A:%.*]], i32 440// CHECK-NEXT:    ret i16 [[TMP0]]41//42int16_t test_vgetq_lane_s16(int16x8_t a)43{44#ifdef POLYMORPHIC45    return vgetq_lane(a, 4);46#else /* POLYMORPHIC */47    return vgetq_lane_s16(a, 4);48#endif /* POLYMORPHIC */49}50 51// CHECK-LABEL: @test_vgetq_lane_s32(52// CHECK-NEXT:  entry:53// CHECK-NEXT:    [[TMP0:%.*]] = extractelement <4 x i32> [[A:%.*]], i32 054// CHECK-NEXT:    ret i32 [[TMP0]]55//56int32_t test_vgetq_lane_s32(int32x4_t a)57{58#ifdef POLYMORPHIC59    return vgetq_lane(a, 0);60#else /* POLYMORPHIC */61    return vgetq_lane_s32(a, 0);62#endif /* POLYMORPHIC */63}64 65// CHECK-LABEL: @test_vgetq_lane_s64(66// CHECK-NEXT:  entry:67// CHECK-NEXT:    [[TMP0:%.*]] = extractelement <2 x i64> [[A:%.*]], i32 068// CHECK-NEXT:    ret i64 [[TMP0]]69//70int64_t test_vgetq_lane_s64(int64x2_t a)71{72#ifdef POLYMORPHIC73    return vgetq_lane(a, 0);74#else /* POLYMORPHIC */75    return vgetq_lane_s64(a, 0);76#endif /* POLYMORPHIC */77}78 79// CHECK-LABEL: @test_vgetq_lane_s8(80// CHECK-NEXT:  entry:81// CHECK-NEXT:    [[TMP0:%.*]] = extractelement <16 x i8> [[A:%.*]], i32 1082// CHECK-NEXT:    ret i8 [[TMP0]]83//84int8_t test_vgetq_lane_s8(int8x16_t a)85{86#ifdef POLYMORPHIC87    return vgetq_lane(a, 10);88#else /* POLYMORPHIC */89    return vgetq_lane_s8(a, 10);90#endif /* POLYMORPHIC */91}92 93// CHECK-LABEL: @test_vgetq_lane_u16(94// CHECK-NEXT:  entry:95// CHECK-NEXT:    [[TMP0:%.*]] = extractelement <8 x i16> [[A:%.*]], i32 396// CHECK-NEXT:    ret i16 [[TMP0]]97//98uint16_t test_vgetq_lane_u16(uint16x8_t a)99{100#ifdef POLYMORPHIC101    return vgetq_lane(a, 3);102#else /* POLYMORPHIC */103    return vgetq_lane_u16(a, 3);104#endif /* POLYMORPHIC */105}106 107// CHECK-LABEL: @test_vgetq_lane_u32(108// CHECK-NEXT:  entry:109// CHECK-NEXT:    [[TMP0:%.*]] = extractelement <4 x i32> [[A:%.*]], i32 3110// CHECK-NEXT:    ret i32 [[TMP0]]111//112uint32_t test_vgetq_lane_u32(uint32x4_t a)113{114#ifdef POLYMORPHIC115    return vgetq_lane(a, 3);116#else /* POLYMORPHIC */117    return vgetq_lane_u32(a, 3);118#endif /* POLYMORPHIC */119}120 121// CHECK-LABEL: @test_vgetq_lane_u64(122// CHECK-NEXT:  entry:123// CHECK-NEXT:    [[TMP0:%.*]] = extractelement <2 x i64> [[A:%.*]], i32 1124// CHECK-NEXT:    ret i64 [[TMP0]]125//126uint64_t test_vgetq_lane_u64(uint64x2_t a)127{128#ifdef POLYMORPHIC129    return vgetq_lane(a, 1);130#else /* POLYMORPHIC */131    return vgetq_lane_u64(a, 1);132#endif /* POLYMORPHIC */133}134 135// CHECK-LABEL: @test_vgetq_lane_u8(136// CHECK-NEXT:  entry:137// CHECK-NEXT:    [[TMP0:%.*]] = extractelement <16 x i8> [[A:%.*]], i32 1138// CHECK-NEXT:    ret i8 [[TMP0]]139//140uint8_t test_vgetq_lane_u8(uint8x16_t a)141{142#ifdef POLYMORPHIC143    return vgetq_lane(a, 1);144#else /* POLYMORPHIC */145    return vgetq_lane_u8(a, 1);146#endif /* POLYMORPHIC */147}148 149// CHECK-LABEL: @test_vsetq_lane_f16(150// CHECK-NEXT:  entry:151// CHECK-NEXT:    [[TMP0:%.*]] = insertelement <8 x half> [[B:%.*]], half [[A:%.*]], i32 4152// CHECK-NEXT:    ret <8 x half> [[TMP0]]153//154float16x8_t test_vsetq_lane_f16(float16_t a, float16x8_t b)155{156#ifdef POLYMORPHIC157    return vsetq_lane(a, b, 4);158#else /* POLYMORPHIC */159    return vsetq_lane_f16(a, b, 4);160#endif /* POLYMORPHIC */161}162 163// CHECK-LABEL: @test_vsetq_lane_f32(164// CHECK-NEXT:  entry:165// CHECK-NEXT:    [[TMP0:%.*]] = insertelement <4 x float> [[B:%.*]], float [[A:%.*]], i32 2166// CHECK-NEXT:    ret <4 x float> [[TMP0]]167//168float32x4_t test_vsetq_lane_f32(float32_t a, float32x4_t b)169{170#ifdef POLYMORPHIC171    return vsetq_lane(a, b, 2);172#else /* POLYMORPHIC */173    return vsetq_lane_f32(a, b, 2);174#endif /* POLYMORPHIC */175}176 177// CHECK-LABEL: @test_vsetq_lane_s8(178// CHECK-NEXT:  entry:179// CHECK-NEXT:    [[TMP0:%.*]] = insertelement <16 x i8> [[B:%.*]], i8 [[A:%.*]], i32 12180// CHECK-NEXT:    ret <16 x i8> [[TMP0]]181//182int8x16_t test_vsetq_lane_s8(int8_t a, int8x16_t b)183{184#ifdef POLYMORPHIC185    return vsetq_lane(a, b, 12);186#else /* POLYMORPHIC */187    return vsetq_lane_s8(a, b, 12);188#endif /* POLYMORPHIC */189}190 191// CHECK-LABEL: @test_vsetq_lane_s16(192// CHECK-NEXT:  entry:193// CHECK-NEXT:    [[TMP0:%.*]] = insertelement <8 x i16> [[B:%.*]], i16 [[A:%.*]], i32 6194// CHECK-NEXT:    ret <8 x i16> [[TMP0]]195//196int16x8_t test_vsetq_lane_s16(int16_t a, int16x8_t b)197{198#ifdef POLYMORPHIC199    return vsetq_lane(a, b, 6);200#else /* POLYMORPHIC */201    return vsetq_lane_s16(a, b, 6);202#endif /* POLYMORPHIC */203}204 205// CHECK-LABEL: @test_vsetq_lane_s32(206// CHECK-NEXT:  entry:207// CHECK-NEXT:    [[TMP0:%.*]] = insertelement <4 x i32> [[B:%.*]], i32 [[A:%.*]], i32 2208// CHECK-NEXT:    ret <4 x i32> [[TMP0]]209//210int32x4_t test_vsetq_lane_s32(int32_t a, int32x4_t b)211{212#ifdef POLYMORPHIC213    return vsetq_lane(a, b, 2);214#else /* POLYMORPHIC */215    return vsetq_lane_s32(a, b, 2);216#endif /* POLYMORPHIC */217}218 219// CHECK-LABEL: @test_vsetq_lane_s64(220// CHECK-NEXT:  entry:221// CHECK-NEXT:    [[TMP0:%.*]] = insertelement <2 x i64> [[B:%.*]], i64 [[A:%.*]], i32 0222// CHECK-NEXT:    ret <2 x i64> [[TMP0]]223//224int64x2_t test_vsetq_lane_s64(int64_t a, int64x2_t b)225{226#ifdef POLYMORPHIC227    return vsetq_lane(a, b, 0);228#else /* POLYMORPHIC */229    return vsetq_lane_s64(a, b, 0);230#endif /* POLYMORPHIC */231}232 233// CHECK-LABEL: @test_vsetq_lane_u8(234// CHECK-NEXT:  entry:235// CHECK-NEXT:    [[TMP0:%.*]] = insertelement <16 x i8> [[B:%.*]], i8 [[A:%.*]], i32 2236// CHECK-NEXT:    ret <16 x i8> [[TMP0]]237//238uint8x16_t test_vsetq_lane_u8(uint8_t a, uint8x16_t b)239{240#ifdef POLYMORPHIC241    return vsetq_lane(a, b, 2);242#else /* POLYMORPHIC */243    return vsetq_lane_u8(a, b, 2);244#endif /* POLYMORPHIC */245}246 247// CHECK-LABEL: @test_vsetq_lane_u16(248// CHECK-NEXT:  entry:249// CHECK-NEXT:    [[TMP0:%.*]] = insertelement <8 x i16> [[B:%.*]], i16 [[A:%.*]], i32 7250// CHECK-NEXT:    ret <8 x i16> [[TMP0]]251//252uint16x8_t test_vsetq_lane_u16(uint16_t a, uint16x8_t b)253{254#ifdef POLYMORPHIC255    return vsetq_lane(a, b, 7);256#else /* POLYMORPHIC */257    return vsetq_lane_u16(a, b, 7);258#endif /* POLYMORPHIC */259}260 261// CHECK-LABEL: @test_vsetq_lane_u32(262// CHECK-NEXT:  entry:263// CHECK-NEXT:    [[TMP0:%.*]] = insertelement <4 x i32> [[B:%.*]], i32 [[A:%.*]], i32 0264// CHECK-NEXT:    ret <4 x i32> [[TMP0]]265//266uint32x4_t test_vsetq_lane_u32(uint32_t a, uint32x4_t b)267{268#ifdef POLYMORPHIC269    return vsetq_lane(a, b, 0);270#else /* POLYMORPHIC */271    return vsetq_lane_u32(a, b, 0);272#endif /* POLYMORPHIC */273}274 275// CHECK-LABEL: @test_vsetq_lane_u64(276// CHECK-NEXT:  entry:277// CHECK-NEXT:    [[TMP0:%.*]] = insertelement <2 x i64> [[B:%.*]], i64 [[A:%.*]], i32 1278// CHECK-NEXT:    ret <2 x i64> [[TMP0]]279//280uint64x2_t test_vsetq_lane_u64(uint64_t a, uint64x2_t b)281{282#ifdef POLYMORPHIC283    return vsetq_lane(a, b, 1);284#else /* POLYMORPHIC */285    return vsetq_lane_u64(a, b, 1);286#endif /* POLYMORPHIC */287}288