brintos

brintos / llvm-project-archived public Read only

0
0
Text · 13.2 KiB · 96a8aa2 Raw
369 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 -mfloat-abi hard -O0 -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s3// RUN: %clang_cc1 -DPOLYMORPHIC -triple thumbv8.1m.main-none-none-eabi -target-feature +mve -mfloat-abi hard -O0 -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s4 5// REQUIRES: aarch64-registered-target || arm-registered-target6 7#include <arm_mve.h>8 9// CHECK-LABEL: @test_vqmovnbq_s16(10// CHECK-NEXT:  entry:11// CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 0, i32 0)12// CHECK-NEXT:    ret <16 x i8> [[TMP0]]13//14int8x16_t test_vqmovnbq_s16(int8x16_t a, int16x8_t b)15{16#ifdef POLYMORPHIC17    return vqmovnbq(a, b);18#else /* POLYMORPHIC */19    return vqmovnbq_s16(a, b);20#endif /* POLYMORPHIC */21}22 23// CHECK-LABEL: @test_vqmovnbq_s32(24// CHECK-NEXT:  entry:25// CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 0, i32 0)26// CHECK-NEXT:    ret <8 x i16> [[TMP0]]27//28int16x8_t test_vqmovnbq_s32(int16x8_t a, int32x4_t b)29{30#ifdef POLYMORPHIC31    return vqmovnbq(a, b);32#else /* POLYMORPHIC */33    return vqmovnbq_s32(a, b);34#endif /* POLYMORPHIC */35}36 37// CHECK-LABEL: @test_vqmovnbq_u16(38// CHECK-NEXT:  entry:39// CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 0)40// CHECK-NEXT:    ret <16 x i8> [[TMP0]]41//42uint8x16_t test_vqmovnbq_u16(uint8x16_t a, uint16x8_t b)43{44#ifdef POLYMORPHIC45    return vqmovnbq(a, b);46#else /* POLYMORPHIC */47    return vqmovnbq_u16(a, b);48#endif /* POLYMORPHIC */49}50 51// CHECK-LABEL: @test_vqmovnbq_u32(52// CHECK-NEXT:  entry:53// CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 1, i32 0)54// CHECK-NEXT:    ret <8 x i16> [[TMP0]]55//56uint16x8_t test_vqmovnbq_u32(uint16x8_t a, uint32x4_t b)57{58#ifdef POLYMORPHIC59    return vqmovnbq(a, b);60#else /* POLYMORPHIC */61    return vqmovnbq_u32(a, b);62#endif /* POLYMORPHIC */63}64 65// CHECK-LABEL: @test_vqmovntq_s16(66// CHECK-NEXT:  entry:67// CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 0, i32 1)68// CHECK-NEXT:    ret <16 x i8> [[TMP0]]69//70int8x16_t test_vqmovntq_s16(int8x16_t a, int16x8_t b)71{72#ifdef POLYMORPHIC73    return vqmovntq(a, b);74#else /* POLYMORPHIC */75    return vqmovntq_s16(a, b);76#endif /* POLYMORPHIC */77}78 79// CHECK-LABEL: @test_vqmovntq_s32(80// CHECK-NEXT:  entry:81// CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 0, i32 1)82// CHECK-NEXT:    ret <8 x i16> [[TMP0]]83//84int16x8_t test_vqmovntq_s32(int16x8_t a, int32x4_t b)85{86#ifdef POLYMORPHIC87    return vqmovntq(a, b);88#else /* POLYMORPHIC */89    return vqmovntq_s32(a, b);90#endif /* POLYMORPHIC */91}92 93// CHECK-LABEL: @test_vqmovntq_u16(94// CHECK-NEXT:  entry:95// CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 1)96// CHECK-NEXT:    ret <16 x i8> [[TMP0]]97//98uint8x16_t test_vqmovntq_u16(uint8x16_t a, uint16x8_t b)99{100#ifdef POLYMORPHIC101    return vqmovntq(a, b);102#else /* POLYMORPHIC */103    return vqmovntq_u16(a, b);104#endif /* POLYMORPHIC */105}106 107// CHECK-LABEL: @test_vqmovntq_u32(108// CHECK-NEXT:  entry:109// CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 1, i32 1)110// CHECK-NEXT:    ret <8 x i16> [[TMP0]]111//112uint16x8_t test_vqmovntq_u32(uint16x8_t a, uint32x4_t b)113{114#ifdef POLYMORPHIC115    return vqmovntq(a, b);116#else /* POLYMORPHIC */117    return vqmovntq_u32(a, b);118#endif /* POLYMORPHIC */119}120 121// CHECK-LABEL: @test_vqmovunbq_s16(122// CHECK-NEXT:  entry:123// CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 0)124// CHECK-NEXT:    ret <16 x i8> [[TMP0]]125//126uint8x16_t test_vqmovunbq_s16(uint8x16_t a, int16x8_t b)127{128#ifdef POLYMORPHIC129    return vqmovunbq(a, b);130#else /* POLYMORPHIC */131    return vqmovunbq_s16(a, b);132#endif /* POLYMORPHIC */133}134 135// CHECK-LABEL: @test_vqmovunbq_s32(136// CHECK-NEXT:  entry:137// CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 0, i32 0)138// CHECK-NEXT:    ret <8 x i16> [[TMP0]]139//140uint16x8_t test_vqmovunbq_s32(uint16x8_t a, int32x4_t b)141{142#ifdef POLYMORPHIC143    return vqmovunbq(a, b);144#else /* POLYMORPHIC */145    return vqmovunbq_s32(a, b);146#endif /* POLYMORPHIC */147}148 149// CHECK-LABEL: @test_vqmovuntq_s16(150// CHECK-NEXT:  entry:151// CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 1)152// CHECK-NEXT:    ret <16 x i8> [[TMP0]]153//154uint8x16_t test_vqmovuntq_s16(uint8x16_t a, int16x8_t b)155{156#ifdef POLYMORPHIC157    return vqmovuntq(a, b);158#else /* POLYMORPHIC */159    return vqmovuntq_s16(a, b);160#endif /* POLYMORPHIC */161}162 163// CHECK-LABEL: @test_vqmovuntq_s32(164// CHECK-NEXT:  entry:165// CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 0, i32 1)166// CHECK-NEXT:    ret <8 x i16> [[TMP0]]167//168uint16x8_t test_vqmovuntq_s32(uint16x8_t a, int32x4_t b)169{170#ifdef POLYMORPHIC171    return vqmovuntq(a, b);172#else /* POLYMORPHIC */173    return vqmovuntq_s32(a, b);174#endif /* POLYMORPHIC */175}176 177// CHECK-LABEL: @test_vqmovnbq_m_s16(178// CHECK-NEXT:  entry:179// CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32180// CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])181// CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 0, i32 0, <8 x i1> [[TMP1]])182// CHECK-NEXT:    ret <16 x i8> [[TMP2]]183//184int8x16_t test_vqmovnbq_m_s16(int8x16_t a, int16x8_t b, mve_pred16_t p)185{186#ifdef POLYMORPHIC187    return vqmovnbq_m(a, b, p);188#else /* POLYMORPHIC */189    return vqmovnbq_m_s16(a, b, p);190#endif /* POLYMORPHIC */191}192 193// CHECK-LABEL: @test_vqmovnbq_m_s32(194// CHECK-NEXT:  entry:195// CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32196// CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])197// CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 0, i32 0, <4 x i1> [[TMP1]])198// CHECK-NEXT:    ret <8 x i16> [[TMP2]]199//200int16x8_t test_vqmovnbq_m_s32(int16x8_t a, int32x4_t b, mve_pred16_t p)201{202#ifdef POLYMORPHIC203    return vqmovnbq_m(a, b, p);204#else /* POLYMORPHIC */205    return vqmovnbq_m_s32(a, b, p);206#endif /* POLYMORPHIC */207}208 209// CHECK-LABEL: @test_vqmovnbq_m_u16(210// CHECK-NEXT:  entry:211// CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32212// CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])213// CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 0, <8 x i1> [[TMP1]])214// CHECK-NEXT:    ret <16 x i8> [[TMP2]]215//216uint8x16_t test_vqmovnbq_m_u16(uint8x16_t a, uint16x8_t b, mve_pred16_t p)217{218#ifdef POLYMORPHIC219    return vqmovnbq_m(a, b, p);220#else /* POLYMORPHIC */221    return vqmovnbq_m_u16(a, b, p);222#endif /* POLYMORPHIC */223}224 225// CHECK-LABEL: @test_vqmovnbq_m_u32(226// CHECK-NEXT:  entry:227// CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32228// CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])229// CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 1, i32 0, <4 x i1> [[TMP1]])230// CHECK-NEXT:    ret <8 x i16> [[TMP2]]231//232uint16x8_t test_vqmovnbq_m_u32(uint16x8_t a, uint32x4_t b, mve_pred16_t p)233{234#ifdef POLYMORPHIC235    return vqmovnbq_m(a, b, p);236#else /* POLYMORPHIC */237    return vqmovnbq_m_u32(a, b, p);238#endif /* POLYMORPHIC */239}240 241// CHECK-LABEL: @test_vqmovntq_m_s16(242// CHECK-NEXT:  entry:243// CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32244// CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])245// CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 0, i32 1, <8 x i1> [[TMP1]])246// CHECK-NEXT:    ret <16 x i8> [[TMP2]]247//248int8x16_t test_vqmovntq_m_s16(int8x16_t a, int16x8_t b, mve_pred16_t p)249{250#ifdef POLYMORPHIC251    return vqmovntq_m(a, b, p);252#else /* POLYMORPHIC */253    return vqmovntq_m_s16(a, b, p);254#endif /* POLYMORPHIC */255}256 257// CHECK-LABEL: @test_vqmovntq_m_s32(258// CHECK-NEXT:  entry:259// CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32260// CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])261// CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 0, i32 1, <4 x i1> [[TMP1]])262// CHECK-NEXT:    ret <8 x i16> [[TMP2]]263//264int16x8_t test_vqmovntq_m_s32(int16x8_t a, int32x4_t b, mve_pred16_t p)265{266#ifdef POLYMORPHIC267    return vqmovntq_m(a, b, p);268#else /* POLYMORPHIC */269    return vqmovntq_m_s32(a, b, p);270#endif /* POLYMORPHIC */271}272 273// CHECK-LABEL: @test_vqmovntq_m_u16(274// CHECK-NEXT:  entry:275// CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32276// CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])277// CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 1, <8 x i1> [[TMP1]])278// CHECK-NEXT:    ret <16 x i8> [[TMP2]]279//280uint8x16_t test_vqmovntq_m_u16(uint8x16_t a, uint16x8_t b, mve_pred16_t p)281{282#ifdef POLYMORPHIC283    return vqmovntq_m(a, b, p);284#else /* POLYMORPHIC */285    return vqmovntq_m_u16(a, b, p);286#endif /* POLYMORPHIC */287}288 289// CHECK-LABEL: @test_vqmovntq_m_u32(290// CHECK-NEXT:  entry:291// CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32292// CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])293// CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 1, i32 1, <4 x i1> [[TMP1]])294// CHECK-NEXT:    ret <8 x i16> [[TMP2]]295//296uint16x8_t test_vqmovntq_m_u32(uint16x8_t a, uint32x4_t b, mve_pred16_t p)297{298#ifdef POLYMORPHIC299    return vqmovntq_m(a, b, p);300#else /* POLYMORPHIC */301    return vqmovntq_m_u32(a, b, p);302#endif /* POLYMORPHIC */303}304 305// CHECK-LABEL: @test_vqmovunbq_m_s16(306// CHECK-NEXT:  entry:307// CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32308// CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])309// CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 0, <8 x i1> [[TMP1]])310// CHECK-NEXT:    ret <16 x i8> [[TMP2]]311//312uint8x16_t test_vqmovunbq_m_s16(uint8x16_t a, int16x8_t b, mve_pred16_t p)313{314#ifdef POLYMORPHIC315    return vqmovunbq_m(a, b, p);316#else /* POLYMORPHIC */317    return vqmovunbq_m_s16(a, b, p);318#endif /* POLYMORPHIC */319}320 321// CHECK-LABEL: @test_vqmovunbq_m_s32(322// CHECK-NEXT:  entry:323// CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32324// CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])325// CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 0, i32 0, <4 x i1> [[TMP1]])326// CHECK-NEXT:    ret <8 x i16> [[TMP2]]327//328uint16x8_t test_vqmovunbq_m_s32(uint16x8_t a, int32x4_t b, mve_pred16_t p)329{330#ifdef POLYMORPHIC331    return vqmovunbq_m(a, b, p);332#else /* POLYMORPHIC */333    return vqmovunbq_m_s32(a, b, p);334#endif /* POLYMORPHIC */335}336 337// CHECK-LABEL: @test_vqmovuntq_m_s16(338// CHECK-NEXT:  entry:339// CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32340// CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])341// CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 1, <8 x i1> [[TMP1]])342// CHECK-NEXT:    ret <16 x i8> [[TMP2]]343//344uint8x16_t test_vqmovuntq_m_s16(uint8x16_t a, int16x8_t b, mve_pred16_t p)345{346#ifdef POLYMORPHIC347    return vqmovuntq_m(a, b, p);348#else /* POLYMORPHIC */349    return vqmovuntq_m_s16(a, b, p);350#endif /* POLYMORPHIC */351}352 353// CHECK-LABEL: @test_vqmovuntq_m_s32(354// CHECK-NEXT:  entry:355// CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32356// CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])357// CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 0, i32 1, <4 x i1> [[TMP1]])358// CHECK-NEXT:    ret <8 x i16> [[TMP2]]359//360uint16x8_t test_vqmovuntq_m_s32(uint16x8_t a, int32x4_t b, mve_pred16_t p)361{362#ifdef POLYMORPHIC363    return vqmovuntq_m(a, b, p);364#else /* POLYMORPHIC */365    return vqmovuntq_m_s32(a, b, p);366#endif /* POLYMORPHIC */367}368 369