brintos

brintos / llvm-project-archived public Read only

0
0
Text · 10.1 KiB · 607a389 Raw
204 lines · c
1// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py2// REQUIRES: aarch64-registered-target3// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s4// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK5// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s6// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK7// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -S -disable-O0-optnone -Werror -Wall -o /dev/null %s8// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sme -S -disable-O0-optnone -Werror -Wall -o /dev/null %s9 10#include <arm_sve.h>11 12#if defined __ARM_FEATURE_SME13#define MODE_ATTR __arm_streaming14#else15#define MODE_ATTR16#endif17 18#ifdef SVE_OVERLOADED_FORMS19// A simple used,unused... macro, long enough to represent any SVE builtin.20#define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A321#else22#define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A423#endif24 25// CHECK-LABEL: @test_svtbl_s8(26// CHECK-NEXT:  entry:27// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.tbl.nxv16i8(<vscale x 16 x i8> [[DATA:%.*]], <vscale x 16 x i8> [[INDICES:%.*]])28// CHECK-NEXT:    ret <vscale x 16 x i8> [[TMP0]]29//30// CPP-CHECK-LABEL: @_Z13test_svtbl_s8u10__SVInt8_tu11__SVUint8_t(31// CPP-CHECK-NEXT:  entry:32// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.tbl.nxv16i8(<vscale x 16 x i8> [[DATA:%.*]], <vscale x 16 x i8> [[INDICES:%.*]])33// CPP-CHECK-NEXT:    ret <vscale x 16 x i8> [[TMP0]]34//35svint8_t test_svtbl_s8(svint8_t data, svuint8_t indices) MODE_ATTR36{37  return SVE_ACLE_FUNC(svtbl,_s8,,)(data, indices);38}39 40// CHECK-LABEL: @test_svtbl_s16(41// CHECK-NEXT:  entry:42// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.tbl.nxv8i16(<vscale x 8 x i16> [[DATA:%.*]], <vscale x 8 x i16> [[INDICES:%.*]])43// CHECK-NEXT:    ret <vscale x 8 x i16> [[TMP0]]44//45// CPP-CHECK-LABEL: @_Z14test_svtbl_s16u11__SVInt16_tu12__SVUint16_t(46// CPP-CHECK-NEXT:  entry:47// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.tbl.nxv8i16(<vscale x 8 x i16> [[DATA:%.*]], <vscale x 8 x i16> [[INDICES:%.*]])48// CPP-CHECK-NEXT:    ret <vscale x 8 x i16> [[TMP0]]49//50svint16_t test_svtbl_s16(svint16_t data, svuint16_t indices) MODE_ATTR51{52  return SVE_ACLE_FUNC(svtbl,_s16,,)(data, indices);53}54 55// CHECK-LABEL: @test_svtbl_s32(56// CHECK-NEXT:  entry:57// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.tbl.nxv4i32(<vscale x 4 x i32> [[DATA:%.*]], <vscale x 4 x i32> [[INDICES:%.*]])58// CHECK-NEXT:    ret <vscale x 4 x i32> [[TMP0]]59//60// CPP-CHECK-LABEL: @_Z14test_svtbl_s32u11__SVInt32_tu12__SVUint32_t(61// CPP-CHECK-NEXT:  entry:62// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.tbl.nxv4i32(<vscale x 4 x i32> [[DATA:%.*]], <vscale x 4 x i32> [[INDICES:%.*]])63// CPP-CHECK-NEXT:    ret <vscale x 4 x i32> [[TMP0]]64//65svint32_t test_svtbl_s32(svint32_t data, svuint32_t indices) MODE_ATTR66{67  return SVE_ACLE_FUNC(svtbl,_s32,,)(data, indices);68}69 70// CHECK-LABEL: @test_svtbl_s64(71// CHECK-NEXT:  entry:72// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.tbl.nxv2i64(<vscale x 2 x i64> [[DATA:%.*]], <vscale x 2 x i64> [[INDICES:%.*]])73// CHECK-NEXT:    ret <vscale x 2 x i64> [[TMP0]]74//75// CPP-CHECK-LABEL: @_Z14test_svtbl_s64u11__SVInt64_tu12__SVUint64_t(76// CPP-CHECK-NEXT:  entry:77// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.tbl.nxv2i64(<vscale x 2 x i64> [[DATA:%.*]], <vscale x 2 x i64> [[INDICES:%.*]])78// CPP-CHECK-NEXT:    ret <vscale x 2 x i64> [[TMP0]]79//80svint64_t test_svtbl_s64(svint64_t data, svuint64_t indices) MODE_ATTR81{82  return SVE_ACLE_FUNC(svtbl,_s64,,)(data, indices);83}84 85// CHECK-LABEL: @test_svtbl_u8(86// CHECK-NEXT:  entry:87// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.tbl.nxv16i8(<vscale x 16 x i8> [[DATA:%.*]], <vscale x 16 x i8> [[INDICES:%.*]])88// CHECK-NEXT:    ret <vscale x 16 x i8> [[TMP0]]89//90// CPP-CHECK-LABEL: @_Z13test_svtbl_u8u11__SVUint8_tS_(91// CPP-CHECK-NEXT:  entry:92// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.tbl.nxv16i8(<vscale x 16 x i8> [[DATA:%.*]], <vscale x 16 x i8> [[INDICES:%.*]])93// CPP-CHECK-NEXT:    ret <vscale x 16 x i8> [[TMP0]]94//95svuint8_t test_svtbl_u8(svuint8_t data, svuint8_t indices) MODE_ATTR96{97  return SVE_ACLE_FUNC(svtbl,_u8,,)(data, indices);98}99 100// CHECK-LABEL: @test_svtbl_u16(101// CHECK-NEXT:  entry:102// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.tbl.nxv8i16(<vscale x 8 x i16> [[DATA:%.*]], <vscale x 8 x i16> [[INDICES:%.*]])103// CHECK-NEXT:    ret <vscale x 8 x i16> [[TMP0]]104//105// CPP-CHECK-LABEL: @_Z14test_svtbl_u16u12__SVUint16_tS_(106// CPP-CHECK-NEXT:  entry:107// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.tbl.nxv8i16(<vscale x 8 x i16> [[DATA:%.*]], <vscale x 8 x i16> [[INDICES:%.*]])108// CPP-CHECK-NEXT:    ret <vscale x 8 x i16> [[TMP0]]109//110svuint16_t test_svtbl_u16(svuint16_t data, svuint16_t indices) MODE_ATTR111{112  return SVE_ACLE_FUNC(svtbl,_u16,,)(data, indices);113}114 115// CHECK-LABEL: @test_svtbl_u32(116// CHECK-NEXT:  entry:117// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.tbl.nxv4i32(<vscale x 4 x i32> [[DATA:%.*]], <vscale x 4 x i32> [[INDICES:%.*]])118// CHECK-NEXT:    ret <vscale x 4 x i32> [[TMP0]]119//120// CPP-CHECK-LABEL: @_Z14test_svtbl_u32u12__SVUint32_tS_(121// CPP-CHECK-NEXT:  entry:122// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.tbl.nxv4i32(<vscale x 4 x i32> [[DATA:%.*]], <vscale x 4 x i32> [[INDICES:%.*]])123// CPP-CHECK-NEXT:    ret <vscale x 4 x i32> [[TMP0]]124//125svuint32_t test_svtbl_u32(svuint32_t data, svuint32_t indices) MODE_ATTR126{127  return SVE_ACLE_FUNC(svtbl,_u32,,)(data, indices);128}129 130// CHECK-LABEL: @test_svtbl_u64(131// CHECK-NEXT:  entry:132// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.tbl.nxv2i64(<vscale x 2 x i64> [[DATA:%.*]], <vscale x 2 x i64> [[INDICES:%.*]])133// CHECK-NEXT:    ret <vscale x 2 x i64> [[TMP0]]134//135// CPP-CHECK-LABEL: @_Z14test_svtbl_u64u12__SVUint64_tS_(136// CPP-CHECK-NEXT:  entry:137// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.tbl.nxv2i64(<vscale x 2 x i64> [[DATA:%.*]], <vscale x 2 x i64> [[INDICES:%.*]])138// CPP-CHECK-NEXT:    ret <vscale x 2 x i64> [[TMP0]]139//140svuint64_t test_svtbl_u64(svuint64_t data, svuint64_t indices) MODE_ATTR141{142  return SVE_ACLE_FUNC(svtbl,_u64,,)(data, indices);143}144 145// CHECK-LABEL: @test_svtbl_f16(146// CHECK-NEXT:  entry:147// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.tbl.nxv8f16(<vscale x 8 x half> [[DATA:%.*]], <vscale x 8 x i16> [[INDICES:%.*]])148// CHECK-NEXT:    ret <vscale x 8 x half> [[TMP0]]149//150// CPP-CHECK-LABEL: @_Z14test_svtbl_f16u13__SVFloat16_tu12__SVUint16_t(151// CPP-CHECK-NEXT:  entry:152// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.tbl.nxv8f16(<vscale x 8 x half> [[DATA:%.*]], <vscale x 8 x i16> [[INDICES:%.*]])153// CPP-CHECK-NEXT:    ret <vscale x 8 x half> [[TMP0]]154//155svfloat16_t test_svtbl_f16(svfloat16_t data, svuint16_t indices) MODE_ATTR156{157  return SVE_ACLE_FUNC(svtbl,_f16,,)(data, indices);158}159 160// CHECK-LABEL: @test_svtbl_f32(161// CHECK-NEXT:  entry:162// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x float> @llvm.aarch64.sve.tbl.nxv4f32(<vscale x 4 x float> [[DATA:%.*]], <vscale x 4 x i32> [[INDICES:%.*]])163// CHECK-NEXT:    ret <vscale x 4 x float> [[TMP0]]164//165// CPP-CHECK-LABEL: @_Z14test_svtbl_f32u13__SVFloat32_tu12__SVUint32_t(166// CPP-CHECK-NEXT:  entry:167// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x float> @llvm.aarch64.sve.tbl.nxv4f32(<vscale x 4 x float> [[DATA:%.*]], <vscale x 4 x i32> [[INDICES:%.*]])168// CPP-CHECK-NEXT:    ret <vscale x 4 x float> [[TMP0]]169//170svfloat32_t test_svtbl_f32(svfloat32_t data, svuint32_t indices) MODE_ATTR171{172  return SVE_ACLE_FUNC(svtbl,_f32,,)(data, indices);173}174 175// CHECK-LABEL: @test_svtbl_f64(176// CHECK-NEXT:  entry:177// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x double> @llvm.aarch64.sve.tbl.nxv2f64(<vscale x 2 x double> [[DATA:%.*]], <vscale x 2 x i64> [[INDICES:%.*]])178// CHECK-NEXT:    ret <vscale x 2 x double> [[TMP0]]179//180// CPP-CHECK-LABEL: @_Z14test_svtbl_f64u13__SVFloat64_tu12__SVUint64_t(181// CPP-CHECK-NEXT:  entry:182// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x double> @llvm.aarch64.sve.tbl.nxv2f64(<vscale x 2 x double> [[DATA:%.*]], <vscale x 2 x i64> [[INDICES:%.*]])183// CPP-CHECK-NEXT:    ret <vscale x 2 x double> [[TMP0]]184//185svfloat64_t test_svtbl_f64(svfloat64_t data, svuint64_t indices) MODE_ATTR186{187  return SVE_ACLE_FUNC(svtbl,_f64,,)(data, indices);188}189 190// CHECK-LABEL: @test_svtbl_bf16(191// CHECK-NEXT:  entry:192// CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x bfloat> @llvm.aarch64.sve.tbl.nxv8bf16(<vscale x 8 x bfloat> [[DATA:%.*]], <vscale x 8 x i16> [[INDICES:%.*]])193// CHECK-NEXT:    ret <vscale x 8 x bfloat> [[TMP0]]194//195// CPP-CHECK-LABEL: @_Z15test_svtbl_bf16u14__SVBfloat16_tu12__SVUint16_t(196// CPP-CHECK-NEXT:  entry:197// CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x bfloat> @llvm.aarch64.sve.tbl.nxv8bf16(<vscale x 8 x bfloat> [[DATA:%.*]], <vscale x 8 x i16> [[INDICES:%.*]])198// CPP-CHECK-NEXT:    ret <vscale x 8 x bfloat> [[TMP0]]199//200svbfloat16_t test_svtbl_bf16(svbfloat16_t data, svuint16_t indices) MODE_ATTR {201  // expected-warning@+1 {{implicit declaration of function 'svtbl_bf16'}}202  return SVE_ACLE_FUNC(svtbl, _bf16, , )(data, indices);203}204