561 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 | 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_vrndaq_f16(10// CHECK-NEXT: entry:11// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.round.v8f16(<8 x half> [[A:%.*]])12// CHECK-NEXT: ret <8 x half> [[TMP0]]13//14float16x8_t test_vrndaq_f16(float16x8_t a)15{16#ifdef POLYMORPHIC17 return vrndaq(a);18#else /* POLYMORPHIC */19 return vrndaq_f16(a);20#endif /* POLYMORPHIC */21}22 23// CHECK-LABEL: @test_vrndaq_f32(24// CHECK-NEXT: entry:25// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.round.v4f32(<4 x float> [[A:%.*]])26// CHECK-NEXT: ret <4 x float> [[TMP0]]27//28float32x4_t test_vrndaq_f32(float32x4_t a)29{30#ifdef POLYMORPHIC31 return vrndaq(a);32#else /* POLYMORPHIC */33 return vrndaq_f32(a);34#endif /* POLYMORPHIC */35}36 37// CHECK-LABEL: @test_vrndmq_f16(38// CHECK-NEXT: entry:39// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.floor.v8f16(<8 x half> [[A:%.*]])40// CHECK-NEXT: ret <8 x half> [[TMP0]]41//42float16x8_t test_vrndmq_f16(float16x8_t a)43{44#ifdef POLYMORPHIC45 return vrndmq(a);46#else /* POLYMORPHIC */47 return vrndmq_f16(a);48#endif /* POLYMORPHIC */49}50 51// CHECK-LABEL: @test_vrndmq_f32(52// CHECK-NEXT: entry:53// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.floor.v4f32(<4 x float> [[A:%.*]])54// CHECK-NEXT: ret <4 x float> [[TMP0]]55//56float32x4_t test_vrndmq_f32(float32x4_t a)57{58#ifdef POLYMORPHIC59 return vrndmq(a);60#else /* POLYMORPHIC */61 return vrndmq_f32(a);62#endif /* POLYMORPHIC */63}64 65// CHECK-LABEL: @test_vrndpq_f16(66// CHECK-NEXT: entry:67// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.ceil.v8f16(<8 x half> [[A:%.*]])68// CHECK-NEXT: ret <8 x half> [[TMP0]]69//70float16x8_t test_vrndpq_f16(float16x8_t a)71{72#ifdef POLYMORPHIC73 return vrndpq(a);74#else /* POLYMORPHIC */75 return vrndpq_f16(a);76#endif /* POLYMORPHIC */77}78 79// CHECK-LABEL: @test_vrndpq_f32(80// CHECK-NEXT: entry:81// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.ceil.v4f32(<4 x float> [[A:%.*]])82// CHECK-NEXT: ret <4 x float> [[TMP0]]83//84float32x4_t test_vrndpq_f32(float32x4_t a)85{86#ifdef POLYMORPHIC87 return vrndpq(a);88#else /* POLYMORPHIC */89 return vrndpq_f32(a);90#endif /* POLYMORPHIC */91}92 93// CHECK-LABEL: @test_vrndq_f16(94// CHECK-NEXT: entry:95// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.trunc.v8f16(<8 x half> [[A:%.*]])96// CHECK-NEXT: ret <8 x half> [[TMP0]]97//98float16x8_t test_vrndq_f16(float16x8_t a)99{100#ifdef POLYMORPHIC101 return vrndq(a);102#else /* POLYMORPHIC */103 return vrndq_f16(a);104#endif /* POLYMORPHIC */105}106 107// CHECK-LABEL: @test_vrndq_f32(108// CHECK-NEXT: entry:109// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.trunc.v4f32(<4 x float> [[A:%.*]])110// CHECK-NEXT: ret <4 x float> [[TMP0]]111//112float32x4_t test_vrndq_f32(float32x4_t a)113{114#ifdef POLYMORPHIC115 return vrndq(a);116#else /* POLYMORPHIC */117 return vrndq_f32(a);118#endif /* POLYMORPHIC */119}120 121// CHECK-LABEL: @test_vrndxq_f16(122// CHECK-NEXT: entry:123// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.rint.v8f16(<8 x half> [[A:%.*]])124// CHECK-NEXT: ret <8 x half> [[TMP0]]125//126float16x8_t test_vrndxq_f16(float16x8_t a)127{128#ifdef POLYMORPHIC129 return vrndxq(a);130#else /* POLYMORPHIC */131 return vrndxq_f16(a);132#endif /* POLYMORPHIC */133}134 135// CHECK-LABEL: @test_vrndxq_f32(136// CHECK-NEXT: entry:137// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.rint.v4f32(<4 x float> [[A:%.*]])138// CHECK-NEXT: ret <4 x float> [[TMP0]]139//140float32x4_t test_vrndxq_f32(float32x4_t a)141{142#ifdef POLYMORPHIC143 return vrndxq(a);144#else /* POLYMORPHIC */145 return vrndxq_f32(a);146#endif /* POLYMORPHIC */147}148 149// CHECK-LABEL: @test_vrndnq_f16(150// CHECK-NEXT: entry:151// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.roundeven.v8f16(<8 x half> [[A:%.*]])152// CHECK-NEXT: ret <8 x half> [[TMP0]]153//154float16x8_t test_vrndnq_f16(float16x8_t a)155{156#ifdef POLYMORPHIC157 return vrndnq(a);158#else /* POLYMORPHIC */159 return vrndnq_f16(a);160#endif /* POLYMORPHIC */161}162 163// CHECK-LABEL: @test_vrndnq_f32(164// CHECK-NEXT: entry:165// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.roundeven.v4f32(<4 x float> [[A:%.*]])166// CHECK-NEXT: ret <4 x float> [[TMP0]]167//168float32x4_t test_vrndnq_f32(float32x4_t a)169{170#ifdef POLYMORPHIC171 return vrndnq(a);172#else /* POLYMORPHIC */173 return vrndnq_f32(a);174#endif /* POLYMORPHIC */175}176 177// CHECK-LABEL: @test_vrndaq_m_f16(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 <8 x half> @llvm.arm.mve.vrinta.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]])182// CHECK-NEXT: ret <8 x half> [[TMP2]]183//184float16x8_t test_vrndaq_m_f16(float16x8_t inactive, float16x8_t a, mve_pred16_t p)185{186#ifdef POLYMORPHIC187 return vrndaq_m(inactive, a, p);188#else /* POLYMORPHIC */189 return vrndaq_m_f16(inactive, a, p);190#endif /* POLYMORPHIC */191}192 193// CHECK-LABEL: @test_vrndaq_m_f32(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 <4 x float> @llvm.arm.mve.vrinta.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]])198// CHECK-NEXT: ret <4 x float> [[TMP2]]199//200float32x4_t test_vrndaq_m_f32(float32x4_t inactive, float32x4_t a, mve_pred16_t p)201{202#ifdef POLYMORPHIC203 return vrndaq_m(inactive, a, p);204#else /* POLYMORPHIC */205 return vrndaq_m_f32(inactive, a, p);206#endif /* POLYMORPHIC */207}208 209// CHECK-LABEL: @test_vrndmq_m_f16(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 <8 x half> @llvm.arm.mve.vrintm.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]])214// CHECK-NEXT: ret <8 x half> [[TMP2]]215//216float16x8_t test_vrndmq_m_f16(float16x8_t inactive, float16x8_t a, mve_pred16_t p)217{218#ifdef POLYMORPHIC219 return vrndmq_m(inactive, a, p);220#else /* POLYMORPHIC */221 return vrndmq_m_f16(inactive, a, p);222#endif /* POLYMORPHIC */223}224 225// CHECK-LABEL: @test_vrndmq_m_f32(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 <4 x float> @llvm.arm.mve.vrintm.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]])230// CHECK-NEXT: ret <4 x float> [[TMP2]]231//232float32x4_t test_vrndmq_m_f32(float32x4_t inactive, float32x4_t a, mve_pred16_t p)233{234#ifdef POLYMORPHIC235 return vrndmq_m(inactive, a, p);236#else /* POLYMORPHIC */237 return vrndmq_m_f32(inactive, a, p);238#endif /* POLYMORPHIC */239}240 241// CHECK-LABEL: @test_vrndnq_m_f16(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 <8 x half> @llvm.arm.mve.vrintn.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]])246// CHECK-NEXT: ret <8 x half> [[TMP2]]247//248float16x8_t test_vrndnq_m_f16(float16x8_t inactive, float16x8_t a, mve_pred16_t p)249{250#ifdef POLYMORPHIC251 return vrndnq_m(inactive, a, p);252#else /* POLYMORPHIC */253 return vrndnq_m_f16(inactive, a, p);254#endif /* POLYMORPHIC */255}256 257// CHECK-LABEL: @test_vrndnq_m_f32(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 <4 x float> @llvm.arm.mve.vrintn.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]])262// CHECK-NEXT: ret <4 x float> [[TMP2]]263//264float32x4_t test_vrndnq_m_f32(float32x4_t inactive, float32x4_t a, mve_pred16_t p)265{266#ifdef POLYMORPHIC267 return vrndnq_m(inactive, a, p);268#else /* POLYMORPHIC */269 return vrndnq_m_f32(inactive, a, p);270#endif /* POLYMORPHIC */271}272 273// CHECK-LABEL: @test_vrndpq_m_f16(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 <8 x half> @llvm.arm.mve.vrintp.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]])278// CHECK-NEXT: ret <8 x half> [[TMP2]]279//280float16x8_t test_vrndpq_m_f16(float16x8_t inactive, float16x8_t a, mve_pred16_t p)281{282#ifdef POLYMORPHIC283 return vrndpq_m(inactive, a, p);284#else /* POLYMORPHIC */285 return vrndpq_m_f16(inactive, a, p);286#endif /* POLYMORPHIC */287}288 289// CHECK-LABEL: @test_vrndpq_m_f32(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 <4 x float> @llvm.arm.mve.vrintp.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]])294// CHECK-NEXT: ret <4 x float> [[TMP2]]295//296float32x4_t test_vrndpq_m_f32(float32x4_t inactive, float32x4_t a, mve_pred16_t p)297{298#ifdef POLYMORPHIC299 return vrndpq_m(inactive, a, p);300#else /* POLYMORPHIC */301 return vrndpq_m_f32(inactive, a, p);302#endif /* POLYMORPHIC */303}304 305// CHECK-LABEL: @test_vrndq_m_f16(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 <8 x half> @llvm.arm.mve.vrintz.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]])310// CHECK-NEXT: ret <8 x half> [[TMP2]]311//312float16x8_t test_vrndq_m_f16(float16x8_t inactive, float16x8_t a, mve_pred16_t p)313{314#ifdef POLYMORPHIC315 return vrndq_m(inactive, a, p);316#else /* POLYMORPHIC */317 return vrndq_m_f16(inactive, a, p);318#endif /* POLYMORPHIC */319}320 321// CHECK-LABEL: @test_vrndq_m_f32(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 <4 x float> @llvm.arm.mve.vrintz.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]])326// CHECK-NEXT: ret <4 x float> [[TMP2]]327//328float32x4_t test_vrndq_m_f32(float32x4_t inactive, float32x4_t a, mve_pred16_t p)329{330#ifdef POLYMORPHIC331 return vrndq_m(inactive, a, p);332#else /* POLYMORPHIC */333 return vrndq_m_f32(inactive, a, p);334#endif /* POLYMORPHIC */335}336 337// CHECK-LABEL: @test_vrndxq_m_f16(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 <8 x half> @llvm.arm.mve.vrintx.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]])342// CHECK-NEXT: ret <8 x half> [[TMP2]]343//344float16x8_t test_vrndxq_m_f16(float16x8_t inactive, float16x8_t a, mve_pred16_t p)345{346#ifdef POLYMORPHIC347 return vrndxq_m(inactive, a, p);348#else /* POLYMORPHIC */349 return vrndxq_m_f16(inactive, a, p);350#endif /* POLYMORPHIC */351}352 353// CHECK-LABEL: @test_vrndxq_m_f32(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 <4 x float> @llvm.arm.mve.vrintx.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]])358// CHECK-NEXT: ret <4 x float> [[TMP2]]359//360float32x4_t test_vrndxq_m_f32(float32x4_t inactive, float32x4_t a, mve_pred16_t p)361{362#ifdef POLYMORPHIC363 return vrndxq_m(inactive, a, p);364#else /* POLYMORPHIC */365 return vrndxq_m_f32(inactive, a, p);366#endif /* POLYMORPHIC */367}368 369// CHECK-LABEL: @test_vrndaq_x_f16(370// CHECK-NEXT: entry:371// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32372// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])373// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrinta.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> undef)374// CHECK-NEXT: ret <8 x half> [[TMP2]]375//376float16x8_t test_vrndaq_x_f16(float16x8_t a, mve_pred16_t p)377{378#ifdef POLYMORPHIC379 return vrndaq_x(a, p);380#else /* POLYMORPHIC */381 return vrndaq_x_f16(a, p);382#endif /* POLYMORPHIC */383}384 385// CHECK-LABEL: @test_vrndaq_x_f32(386// CHECK-NEXT: entry:387// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32388// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])389// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrinta.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> undef)390// CHECK-NEXT: ret <4 x float> [[TMP2]]391//392float32x4_t test_vrndaq_x_f32(float32x4_t a, mve_pred16_t p)393{394#ifdef POLYMORPHIC395 return vrndaq_x(a, p);396#else /* POLYMORPHIC */397 return vrndaq_x_f32(a, p);398#endif /* POLYMORPHIC */399}400 401// CHECK-LABEL: @test_vrndmq_x_f16(402// CHECK-NEXT: entry:403// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32404// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])405// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintm.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> undef)406// CHECK-NEXT: ret <8 x half> [[TMP2]]407//408float16x8_t test_vrndmq_x_f16(float16x8_t a, mve_pred16_t p)409{410#ifdef POLYMORPHIC411 return vrndmq_x(a, p);412#else /* POLYMORPHIC */413 return vrndmq_x_f16(a, p);414#endif /* POLYMORPHIC */415}416 417// CHECK-LABEL: @test_vrndmq_x_f32(418// CHECK-NEXT: entry:419// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32420// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])421// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintm.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> undef)422// CHECK-NEXT: ret <4 x float> [[TMP2]]423//424float32x4_t test_vrndmq_x_f32(float32x4_t a, mve_pred16_t p)425{426#ifdef POLYMORPHIC427 return vrndmq_x(a, p);428#else /* POLYMORPHIC */429 return vrndmq_x_f32(a, p);430#endif /* POLYMORPHIC */431}432 433// CHECK-LABEL: @test_vrndnq_x_f16(434// CHECK-NEXT: entry:435// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32436// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])437// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintn.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> undef)438// CHECK-NEXT: ret <8 x half> [[TMP2]]439//440float16x8_t test_vrndnq_x_f16(float16x8_t a, mve_pred16_t p)441{442#ifdef POLYMORPHIC443 return vrndnq_x(a, p);444#else /* POLYMORPHIC */445 return vrndnq_x_f16(a, p);446#endif /* POLYMORPHIC */447}448 449// CHECK-LABEL: @test_vrndnq_x_f32(450// CHECK-NEXT: entry:451// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32452// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])453// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintn.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> undef)454// CHECK-NEXT: ret <4 x float> [[TMP2]]455//456float32x4_t test_vrndnq_x_f32(float32x4_t a, mve_pred16_t p)457{458#ifdef POLYMORPHIC459 return vrndnq_x(a, p);460#else /* POLYMORPHIC */461 return vrndnq_x_f32(a, p);462#endif /* POLYMORPHIC */463}464 465// CHECK-LABEL: @test_vrndpq_x_f16(466// CHECK-NEXT: entry:467// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32468// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])469// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintp.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> undef)470// CHECK-NEXT: ret <8 x half> [[TMP2]]471//472float16x8_t test_vrndpq_x_f16(float16x8_t a, mve_pred16_t p)473{474#ifdef POLYMORPHIC475 return vrndpq_x(a, p);476#else /* POLYMORPHIC */477 return vrndpq_x_f16(a, p);478#endif /* POLYMORPHIC */479}480 481// CHECK-LABEL: @test_vrndpq_x_f32(482// CHECK-NEXT: entry:483// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32484// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])485// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintp.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> undef)486// CHECK-NEXT: ret <4 x float> [[TMP2]]487//488float32x4_t test_vrndpq_x_f32(float32x4_t a, mve_pred16_t p)489{490#ifdef POLYMORPHIC491 return vrndpq_x(a, p);492#else /* POLYMORPHIC */493 return vrndpq_x_f32(a, p);494#endif /* POLYMORPHIC */495}496 497// CHECK-LABEL: @test_vrndq_x_f16(498// CHECK-NEXT: entry:499// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32500// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])501// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintz.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> undef)502// CHECK-NEXT: ret <8 x half> [[TMP2]]503//504float16x8_t test_vrndq_x_f16(float16x8_t a, mve_pred16_t p)505{506#ifdef POLYMORPHIC507 return vrndq_x(a, p);508#else /* POLYMORPHIC */509 return vrndq_x_f16(a, p);510#endif /* POLYMORPHIC */511}512 513// CHECK-LABEL: @test_vrndq_x_f32(514// CHECK-NEXT: entry:515// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32516// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])517// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintz.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> undef)518// CHECK-NEXT: ret <4 x float> [[TMP2]]519//520float32x4_t test_vrndq_x_f32(float32x4_t a, mve_pred16_t p)521{522#ifdef POLYMORPHIC523 return vrndq_x(a, p);524#else /* POLYMORPHIC */525 return vrndq_x_f32(a, p);526#endif /* POLYMORPHIC */527}528 529// CHECK-LABEL: @test_vrndxq_x_f16(530// CHECK-NEXT: entry:531// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32532// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])533// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintx.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> undef)534// CHECK-NEXT: ret <8 x half> [[TMP2]]535//536float16x8_t test_vrndxq_x_f16(float16x8_t a, mve_pred16_t p)537{538#ifdef POLYMORPHIC539 return vrndxq_x(a, p);540#else /* POLYMORPHIC */541 return vrndxq_x_f16(a, p);542#endif /* POLYMORPHIC */543}544 545// CHECK-LABEL: @test_vrndxq_x_f32(546// CHECK-NEXT: entry:547// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32548// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])549// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintx.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> undef)550// CHECK-NEXT: ret <4 x float> [[TMP2]]551//552float32x4_t test_vrndxq_x_f32(float32x4_t a, mve_pred16_t p)553{554#ifdef POLYMORPHIC555 return vrndxq_x(a, p);556#else /* POLYMORPHIC */557 return vrndxq_x_f32(a, p);558#endif /* POLYMORPHIC */559}560 561