| 1 |
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py |
| 2 |
// REQUIRES: aarch64-registered-target |
| 3 |
|
| 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 %s |
| 5 |
// 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-CHECK |
| 6 |
// 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 %s |
| 7 |
// 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-CHECK |
| 8 |
// RUN: %clang_cc1 -triple aarch64 -target-feature +sme -target-feature +ssve-bitperm -S -disable-O0-optnone -Werror -Wall -o /dev/null %s |
| 9 |
// RUN: not %clang_cc1 -triple aarch64 -target-feature +sme -S -disable-O0-optnone -Werror -Wall -o /dev/null %s |
| 10 |
|
| 11 |
#include <arm_sve.h> |
| 12 |
|
| 13 |
#ifdef SVE_OVERLOADED_FORMS |
| 14 |
// A simple used,unused... macro, long enough to represent any SVE builtin. |
| 15 |
#define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3 |
| 16 |
#else |
| 17 |
#define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4 |
| 18 |
#endif |
| 19 |
|
| 20 |
#ifdef __ARM_FEATURE_SME |
| 21 |
#define STREAMING __arm_streaming |
| 22 |
#else |
| 23 |
#define STREAMING |
| 24 |
#endif |
| 25 |
|
| 26 |
// CHECK-LABEL: @test_svbext_u8( |
| 27 |
// CHECK-NEXT: entry: |
| 28 |
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.bext.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_svbext_u8u11__SVUint8_tS_( |
| 32 |
// CPP-CHECK-NEXT: entry: |
| 33 |
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.bext.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 |
// |
| 36 |
svuint8_t test_svbext_u8(svuint8_t op1, svuint8_t op2) STREAMING |
| 37 |
{ |
| 38 |
return SVE_ACLE_FUNC(svbext,_u8,,)(op1, op2); |
| 39 |
} |
| 40 |
|
| 41 |
// CHECK-LABEL: @test_svbext_u16( |
| 42 |
// CHECK-NEXT: entry: |
| 43 |
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.bext.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_svbext_u16u12__SVUint16_tS_( |
| 47 |
// CPP-CHECK-NEXT: entry: |
| 48 |
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.bext.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 |
// |
| 51 |
svuint16_t test_svbext_u16(svuint16_t op1, svuint16_t op2) STREAMING |
| 52 |
{ |
| 53 |
return SVE_ACLE_FUNC(svbext,_u16,,)(op1, op2); |
| 54 |
} |
| 55 |
|
| 56 |
// CHECK-LABEL: @test_svbext_u32( |
| 57 |
// CHECK-NEXT: entry: |
| 58 |
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.bext.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_svbext_u32u12__SVUint32_tS_( |
| 62 |
// CPP-CHECK-NEXT: entry: |
| 63 |
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.bext.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 |
// |
| 66 |
svuint32_t test_svbext_u32(svuint32_t op1, svuint32_t op2) STREAMING |
| 67 |
{ |
| 68 |
return SVE_ACLE_FUNC(svbext,_u32,,)(op1, op2); |
| 69 |
} |
| 70 |
|
| 71 |
// CHECK-LABEL: @test_svbext_u64( |
| 72 |
// CHECK-NEXT: entry: |
| 73 |
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.bext.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_svbext_u64u12__SVUint64_tS_( |
| 77 |
// CPP-CHECK-NEXT: entry: |
| 78 |
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.bext.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 |
// |
| 81 |
svuint64_t test_svbext_u64(svuint64_t op1, svuint64_t op2) STREAMING |
| 82 |
{ |
| 83 |
return SVE_ACLE_FUNC(svbext,_u64,,)(op1, op2); |
| 84 |
} |
| 85 |
|
| 86 |
// CHECK-LABEL: @test_svbext_n_u8( |
| 87 |
// CHECK-NEXT: entry: |
| 88 |
// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[OP2:%.*]], i64 0 |
| 89 |
// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[DOTSPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer |
| 90 |
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.bext.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_svbext_n_u8u11__SVUint8_th( |
| 94 |
// CPP-CHECK-NEXT: entry: |
| 95 |
// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[OP2:%.*]], i64 0 |
| 96 |
// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[DOTSPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer |
| 97 |
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.bext.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 |
// |
| 100 |
svuint8_t test_svbext_n_u8(svuint8_t op1, uint8_t op2) STREAMING |
| 101 |
{ |
| 102 |
return SVE_ACLE_FUNC(svbext,_n_u8,,)(op1, op2); |
| 103 |
} |
| 104 |
|
| 105 |
// CHECK-LABEL: @test_svbext_n_u16( |
| 106 |
// CHECK-NEXT: entry: |
| 107 |
// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 8 x i16> poison, i16 [[OP2:%.*]], i64 0 |
| 108 |
// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 8 x i16> [[DOTSPLATINSERT]], <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer |
| 109 |
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.bext.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_svbext_n_u16u12__SVUint16_tt( |
| 113 |
// CPP-CHECK-NEXT: entry: |
| 114 |
// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 8 x i16> poison, i16 [[OP2:%.*]], i64 0 |
| 115 |
// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 8 x i16> [[DOTSPLATINSERT]], <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer |
| 116 |
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.bext.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 |
// |
| 119 |
svuint16_t test_svbext_n_u16(svuint16_t op1, uint16_t op2) STREAMING |
| 120 |
{ |
| 121 |
return SVE_ACLE_FUNC(svbext,_n_u16,,)(op1, op2); |
| 122 |
} |
| 123 |
|
| 124 |
// CHECK-LABEL: @test_svbext_n_u32( |
| 125 |
// CHECK-NEXT: entry: |
| 126 |
// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[OP2:%.*]], i64 0 |
| 127 |
// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[DOTSPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer |
| 128 |
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.bext.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_svbext_n_u32u12__SVUint32_tj( |
| 132 |
// CPP-CHECK-NEXT: entry: |
| 133 |
// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[OP2:%.*]], i64 0 |
| 134 |
// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[DOTSPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer |
| 135 |
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.bext.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 |
// |
| 138 |
svuint32_t test_svbext_n_u32(svuint32_t op1, uint32_t op2) STREAMING |
| 139 |
{ |
| 140 |
return SVE_ACLE_FUNC(svbext,_n_u32,,)(op1, op2); |
| 141 |
} |
| 142 |
|
| 143 |
// CHECK-LABEL: @test_svbext_n_u64( |
| 144 |
// CHECK-NEXT: entry: |
| 145 |
// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 2 x i64> poison, i64 [[OP2:%.*]], i64 0 |
| 146 |
// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 2 x i64> [[DOTSPLATINSERT]], <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer |
| 147 |
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.bext.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_svbext_n_u64u12__SVUint64_tm( |
| 151 |
// CPP-CHECK-NEXT: entry: |
| 152 |
// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 2 x i64> poison, i64 [[OP2:%.*]], i64 0 |
| 153 |
// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 2 x i64> [[DOTSPLATINSERT]], <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer |
| 154 |
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.bext.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 |
// |
| 157 |
svuint64_t test_svbext_n_u64(svuint64_t op1, uint64_t op2) STREAMING |
| 158 |
{ |
| 159 |
return SVE_ACLE_FUNC(svbext,_n_u64,,)(op1, op2); |
| 160 |
} |