brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.2 KiB · 8072c8c Raw
200 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 | FileCheck %s4 5// REQUIRES: aarch64-registered-target || arm-registered-target6 7#include <arm_mve.h>8 9// CHECK-LABEL: @test_vqaddq_u8(10// CHECK-NEXT:  entry:11// CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.uadd.sat.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]])12// CHECK-NEXT:    ret <16 x i8> [[TMP0]]13//14uint8x16_t test_vqaddq_u8(uint8x16_t a, uint8x16_t b)15{16#ifdef POLYMORPHIC17    return vqaddq(a, b);18#else /* POLYMORPHIC */19    return vqaddq_u8(a, b);20#endif /* POLYMORPHIC */21}22 23// CHECK-LABEL: @test_vqaddq_s16(24// CHECK-NEXT:  entry:25// CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.sadd.sat.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])26// CHECK-NEXT:    ret <8 x i16> [[TMP0]]27//28int16x8_t test_vqaddq_s16(int16x8_t a, int16x8_t b)29{30#ifdef POLYMORPHIC31    return vqaddq(a, b);32#else /* POLYMORPHIC */33    return vqaddq_s16(a, b);34#endif /* POLYMORPHIC */35}36 37// CHECK-LABEL: @test_vqaddq_u32(38// CHECK-NEXT:  entry:39// CHECK-NEXT:    [[TMP0:%.*]] = call <4 x i32> @llvm.uadd.sat.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])40// CHECK-NEXT:    ret <4 x i32> [[TMP0]]41//42uint32x4_t test_vqaddq_u32(uint32x4_t a, uint32x4_t b)43{44#ifdef POLYMORPHIC45    return vqaddq(a, b);46#else /* POLYMORPHIC */47    return vqaddq_u32(a, b);48#endif /* POLYMORPHIC */49}50 51// CHECK-LABEL: @test_vqaddq_m_s8(52// CHECK-NEXT:  entry:53// CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i3254// CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])55// CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.qadd.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])56// CHECK-NEXT:    ret <16 x i8> [[TMP2]]57//58int8x16_t test_vqaddq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)59{60#ifdef POLYMORPHIC61    return vqaddq_m(inactive, a, b, p);62#else /* POLYMORPHIC */63    return vqaddq_m_s8(inactive, a, b, p);64#endif /* POLYMORPHIC */65}66 67// CHECK-LABEL: @test_vqaddq_m_u16(68// CHECK-NEXT:  entry:69// CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i3270// CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])71// CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.qadd.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])72// CHECK-NEXT:    ret <8 x i16> [[TMP2]]73//74uint16x8_t test_vqaddq_m_u16(uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)75{76#ifdef POLYMORPHIC77    return vqaddq_m(inactive, a, b, p);78#else /* POLYMORPHIC */79    return vqaddq_m_u16(inactive, a, b, p);80#endif /* POLYMORPHIC */81}82 83// CHECK-LABEL: @test_vqaddq_m_s32(84// CHECK-NEXT:  entry:85// CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i3286// CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])87// CHECK-NEXT:    [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.qadd.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])88// CHECK-NEXT:    ret <4 x i32> [[TMP2]]89//90int32x4_t test_vqaddq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)91{92#ifdef POLYMORPHIC93    return vqaddq_m(inactive, a, b, p);94#else /* POLYMORPHIC */95    return vqaddq_m_s32(inactive, a, b, p);96#endif /* POLYMORPHIC */97}98 99// CHECK-LABEL: @test_vqaddq_n_u8(100// CHECK-NEXT:  entry:101// CHECK-NEXT:    [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> poison, i8 [[B:%.*]], i64 0102// CHECK-NEXT:    [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> poison, <16 x i32> zeroinitializer103// CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.uadd.sat.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[DOTSPLAT]])104// CHECK-NEXT:    ret <16 x i8> [[TMP0]]105//106uint8x16_t test_vqaddq_n_u8(uint8x16_t a, uint8_t b)107{108#ifdef POLYMORPHIC109    return vqaddq(a, b);110#else /* POLYMORPHIC */111    return vqaddq_n_u8(a, b);112#endif /* POLYMORPHIC */113}114 115// CHECK-LABEL: @test_vqaddq_n_s16(116// CHECK-NEXT:  entry:117// CHECK-NEXT:    [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> poison, i16 [[B:%.*]], i64 0118// CHECK-NEXT:    [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> poison, <8 x i32> zeroinitializer119// CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.sadd.sat.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[DOTSPLAT]])120// CHECK-NEXT:    ret <8 x i16> [[TMP0]]121//122int16x8_t test_vqaddq_n_s16(int16x8_t a, int16_t b)123{124#ifdef POLYMORPHIC125    return vqaddq(a, b);126#else /* POLYMORPHIC */127    return vqaddq_n_s16(a, b);128#endif /* POLYMORPHIC */129}130 131// CHECK-LABEL: @test_vqaddq_n_u32(132// CHECK-NEXT:  entry:133// CHECK-NEXT:    [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> poison, i32 [[B:%.*]], i64 0134// CHECK-NEXT:    [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> poison, <4 x i32> zeroinitializer135// CHECK-NEXT:    [[TMP0:%.*]] = call <4 x i32> @llvm.uadd.sat.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[DOTSPLAT]])136// CHECK-NEXT:    ret <4 x i32> [[TMP0]]137//138uint32x4_t test_vqaddq_n_u32(uint32x4_t a, uint32_t b)139{140#ifdef POLYMORPHIC141    return vqaddq(a, b);142#else /* POLYMORPHIC */143    return vqaddq_n_u32(a, b);144#endif /* POLYMORPHIC */145}146 147// CHECK-LABEL: @test_vqaddq_m_n_s8(148// CHECK-NEXT:  entry:149// CHECK-NEXT:    [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> poison, i8 [[B:%.*]], i64 0150// CHECK-NEXT:    [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> poison, <16 x i32> zeroinitializer151// CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32152// CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])153// CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.qadd.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[DOTSPLAT]], i32 0, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])154// CHECK-NEXT:    ret <16 x i8> [[TMP2]]155//156int8x16_t test_vqaddq_m_n_s8(int8x16_t inactive, int8x16_t a, int8_t b, mve_pred16_t p)157{158#ifdef POLYMORPHIC159    return vqaddq_m(inactive, a, b, p);160#else /* POLYMORPHIC */161    return vqaddq_m_n_s8(inactive, a, b, p);162#endif /* POLYMORPHIC */163}164 165// CHECK-LABEL: @test_vqaddq_m_n_u16(166// CHECK-NEXT:  entry:167// CHECK-NEXT:    [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> poison, i16 [[B:%.*]], i64 0168// CHECK-NEXT:    [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> poison, <8 x i32> zeroinitializer169// CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32170// CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])171// CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.qadd.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[DOTSPLAT]], i32 1, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])172// CHECK-NEXT:    ret <8 x i16> [[TMP2]]173//174uint16x8_t test_vqaddq_m_n_u16(uint16x8_t inactive, uint16x8_t a, uint16_t b, mve_pred16_t p)175{176#ifdef POLYMORPHIC177    return vqaddq_m(inactive, a, b, p);178#else /* POLYMORPHIC */179    return vqaddq_m_n_u16(inactive, a, b, p);180#endif /* POLYMORPHIC */181}182 183// CHECK-LABEL: @test_vqaddq_m_n_s32(184// CHECK-NEXT:  entry:185// CHECK-NEXT:    [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> poison, i32 [[B:%.*]], i64 0186// CHECK-NEXT:    [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> poison, <4 x i32> zeroinitializer187// CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32188// CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])189// CHECK-NEXT:    [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.qadd.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[DOTSPLAT]], i32 0, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])190// CHECK-NEXT:    ret <4 x i32> [[TMP2]]191//192int32x4_t test_vqaddq_m_n_s32(int32x4_t inactive, int32x4_t a, int32_t b, mve_pred16_t p)193{194#ifdef POLYMORPHIC195    return vqaddq_m(inactive, a, b, p);196#else /* POLYMORPHIC */197    return vqaddq_m_n_s32(inactive, a, b, p);198#endif /* POLYMORPHIC */199}200