161 lines · c
1// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py2// REQUIRES: aarch64-registered-target3 4// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve-bitperm -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s5// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve-bitperm -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK6// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve-bitperm -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s7// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve-bitperm -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK8// RUN: %clang_cc1 -triple aarch64 -target-feature +sme -target-feature +ssve-bitperm -S -disable-O0-optnone -Werror -Wall -o /dev/null %s9// RUN: not %clang_cc1 -triple aarch64 -target-feature +sme -S -disable-O0-optnone -Werror -Wall -o /dev/null %s10 11#include <arm_sve.h>12 13#ifdef SVE_OVERLOADED_FORMS14// A simple used,unused... macro, long enough to represent any SVE builtin.15#define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A316#else17#define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A418#endif19 20#ifdef __ARM_FEATURE_SME21#define STREAMING __arm_streaming22#else23#define STREAMING24#endif25 26// CHECK-LABEL: @test_svbgrp_u8(27// CHECK-NEXT: entry:28// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.bgrp.x.nxv16i8(<vscale x 16 x i8> [[OP1:%.*]], <vscale x 16 x i8> [[OP2:%.*]])29// CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]30//31// CPP-CHECK-LABEL: @_Z14test_svbgrp_u8u11__SVUint8_tS_(32// CPP-CHECK-NEXT: entry:33// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.bgrp.x.nxv16i8(<vscale x 16 x i8> [[OP1:%.*]], <vscale x 16 x i8> [[OP2:%.*]])34// CPP-CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]35//36svuint8_t test_svbgrp_u8(svuint8_t op1, svuint8_t op2) STREAMING37{38 return SVE_ACLE_FUNC(svbgrp,_u8,,)(op1, op2);39}40 41// CHECK-LABEL: @test_svbgrp_u16(42// CHECK-NEXT: entry:43// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.bgrp.x.nxv8i16(<vscale x 8 x i16> [[OP1:%.*]], <vscale x 8 x i16> [[OP2:%.*]])44// CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]45//46// CPP-CHECK-LABEL: @_Z15test_svbgrp_u16u12__SVUint16_tS_(47// CPP-CHECK-NEXT: entry:48// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.bgrp.x.nxv8i16(<vscale x 8 x i16> [[OP1:%.*]], <vscale x 8 x i16> [[OP2:%.*]])49// CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]50//51svuint16_t test_svbgrp_u16(svuint16_t op1, svuint16_t op2) STREAMING52{53 return SVE_ACLE_FUNC(svbgrp,_u16,,)(op1, op2);54}55 56// CHECK-LABEL: @test_svbgrp_u32(57// CHECK-NEXT: entry:58// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.bgrp.x.nxv4i32(<vscale x 4 x i32> [[OP1:%.*]], <vscale x 4 x i32> [[OP2:%.*]])59// CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]60//61// CPP-CHECK-LABEL: @_Z15test_svbgrp_u32u12__SVUint32_tS_(62// CPP-CHECK-NEXT: entry:63// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.bgrp.x.nxv4i32(<vscale x 4 x i32> [[OP1:%.*]], <vscale x 4 x i32> [[OP2:%.*]])64// CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]65//66svuint32_t test_svbgrp_u32(svuint32_t op1, svuint32_t op2) STREAMING67{68 return SVE_ACLE_FUNC(svbgrp,_u32,,)(op1, op2);69}70 71// CHECK-LABEL: @test_svbgrp_u64(72// CHECK-NEXT: entry:73// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.bgrp.x.nxv2i64(<vscale x 2 x i64> [[OP1:%.*]], <vscale x 2 x i64> [[OP2:%.*]])74// CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]75//76// CPP-CHECK-LABEL: @_Z15test_svbgrp_u64u12__SVUint64_tS_(77// CPP-CHECK-NEXT: entry:78// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.bgrp.x.nxv2i64(<vscale x 2 x i64> [[OP1:%.*]], <vscale x 2 x i64> [[OP2:%.*]])79// CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]80//81svuint64_t test_svbgrp_u64(svuint64_t op1, svuint64_t op2) STREAMING82{83 return SVE_ACLE_FUNC(svbgrp,_u64,,)(op1, op2);84}85 86// CHECK-LABEL: @test_svbgrp_n_u8(87// CHECK-NEXT: entry:88// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[OP2:%.*]], i64 089// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[DOTSPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer90// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.bgrp.x.nxv16i8(<vscale x 16 x i8> [[OP1:%.*]], <vscale x 16 x i8> [[DOTSPLAT]])91// CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]92//93// CPP-CHECK-LABEL: @_Z16test_svbgrp_n_u8u11__SVUint8_th(94// CPP-CHECK-NEXT: entry:95// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[OP2:%.*]], i64 096// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[DOTSPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer97// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.bgrp.x.nxv16i8(<vscale x 16 x i8> [[OP1:%.*]], <vscale x 16 x i8> [[DOTSPLAT]])98// CPP-CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]99//100svuint8_t test_svbgrp_n_u8(svuint8_t op1, uint8_t op2) STREAMING101{102 return SVE_ACLE_FUNC(svbgrp,_n_u8,,)(op1, op2);103}104 105// CHECK-LABEL: @test_svbgrp_n_u16(106// CHECK-NEXT: entry:107// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 8 x i16> poison, i16 [[OP2:%.*]], i64 0108// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 8 x i16> [[DOTSPLATINSERT]], <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer109// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.bgrp.x.nxv8i16(<vscale x 8 x i16> [[OP1:%.*]], <vscale x 8 x i16> [[DOTSPLAT]])110// CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]111//112// CPP-CHECK-LABEL: @_Z17test_svbgrp_n_u16u12__SVUint16_tt(113// CPP-CHECK-NEXT: entry:114// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 8 x i16> poison, i16 [[OP2:%.*]], i64 0115// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 8 x i16> [[DOTSPLATINSERT]], <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer116// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.bgrp.x.nxv8i16(<vscale x 8 x i16> [[OP1:%.*]], <vscale x 8 x i16> [[DOTSPLAT]])117// CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]118//119svuint16_t test_svbgrp_n_u16(svuint16_t op1, uint16_t op2) STREAMING120{121 return SVE_ACLE_FUNC(svbgrp,_n_u16,,)(op1, op2);122}123 124// CHECK-LABEL: @test_svbgrp_n_u32(125// CHECK-NEXT: entry:126// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[OP2:%.*]], i64 0127// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[DOTSPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer128// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.bgrp.x.nxv4i32(<vscale x 4 x i32> [[OP1:%.*]], <vscale x 4 x i32> [[DOTSPLAT]])129// CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]130//131// CPP-CHECK-LABEL: @_Z17test_svbgrp_n_u32u12__SVUint32_tj(132// CPP-CHECK-NEXT: entry:133// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[OP2:%.*]], i64 0134// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[DOTSPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer135// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.bgrp.x.nxv4i32(<vscale x 4 x i32> [[OP1:%.*]], <vscale x 4 x i32> [[DOTSPLAT]])136// CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]137//138svuint32_t test_svbgrp_n_u32(svuint32_t op1, uint32_t op2) STREAMING139{140 return SVE_ACLE_FUNC(svbgrp,_n_u32,,)(op1, op2);141}142 143// CHECK-LABEL: @test_svbgrp_n_u64(144// CHECK-NEXT: entry:145// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 2 x i64> poison, i64 [[OP2:%.*]], i64 0146// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 2 x i64> [[DOTSPLATINSERT]], <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer147// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.bgrp.x.nxv2i64(<vscale x 2 x i64> [[OP1:%.*]], <vscale x 2 x i64> [[DOTSPLAT]])148// CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]149//150// CPP-CHECK-LABEL: @_Z17test_svbgrp_n_u64u12__SVUint64_tm(151// CPP-CHECK-NEXT: entry:152// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 2 x i64> poison, i64 [[OP2:%.*]], i64 0153// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 2 x i64> [[DOTSPLATINSERT]], <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer154// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.bgrp.x.nxv2i64(<vscale x 2 x i64> [[OP1:%.*]], <vscale x 2 x i64> [[DOTSPLAT]])155// CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]156//157svuint64_t test_svbgrp_n_u64(svuint64_t op1, uint64_t op2) STREAMING158{159 return SVE_ACLE_FUNC(svbgrp,_n_u64,,)(op1, op2);160}161