| 1 |
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py |
| 2 |
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s |
| 3 |
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK |
| 4 |
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s |
| 5 |
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK |
| 6 |
|
| 7 |
// REQUIRES: aarch64-registered-target |
| 8 |
|
| 9 |
#include <arm_sve.h> |
| 10 |
|
| 11 |
#ifdef SVE_OVERLOADED_FORMS |
| 12 |
// A simple used,unused... macro, long enough to represent any SVE builtin. |
| 13 |
#define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3 |
| 14 |
#else |
| 15 |
#define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4 |
| 16 |
#endif |
| 17 |
|
| 18 |
// CHECK-LABEL: @test_svmatch_s8( |
| 19 |
// CHECK-NEXT: entry: |
| 20 |
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.match.nxv16i8(<vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP1:%.*]], <vscale x 16 x i8> [[OP2:%.*]]) |
| 21 |
// CHECK-NEXT: ret <vscale x 16 x i1> [[TMP0]] |
| 22 |
// |
| 23 |
// CPP-CHECK-LABEL: @_Z15test_svmatch_s8u10__SVBool_tu10__SVInt8_tS0_( |
| 24 |
// CPP-CHECK-NEXT: entry: |
| 25 |
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.match.nxv16i8(<vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP1:%.*]], <vscale x 16 x i8> [[OP2:%.*]]) |
| 26 |
// CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP0]] |
| 27 |
// |
| 28 |
svbool_t test_svmatch_s8(svbool_t pg, svint8_t op1, svint8_t op2) |
| 29 |
{ |
| 30 |
return SVE_ACLE_FUNC(svmatch,_s8,,)(pg, op1, op2); |
| 31 |
} |
| 32 |
|
| 33 |
// CHECK-LABEL: @test_svmatch_s16( |
| 34 |
// CHECK-NEXT: entry: |
| 35 |
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]]) |
| 36 |
// CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.match.nxv8i16(<vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP1:%.*]], <vscale x 8 x i16> [[OP2:%.*]]) |
| 37 |
// CHECK-NEXT: [[TMP2:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP1]]) |
| 38 |
// CHECK-NEXT: ret <vscale x 16 x i1> [[TMP2]] |
| 39 |
// |
| 40 |
// CPP-CHECK-LABEL: @_Z16test_svmatch_s16u10__SVBool_tu11__SVInt16_tS0_( |
| 41 |
// CPP-CHECK-NEXT: entry: |
| 42 |
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]]) |
| 43 |
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.match.nxv8i16(<vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP1:%.*]], <vscale x 8 x i16> [[OP2:%.*]]) |
| 44 |
// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP1]]) |
| 45 |
// CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP2]] |
| 46 |
// |
| 47 |
svbool_t test_svmatch_s16(svbool_t pg, svint16_t op1, svint16_t op2) |
| 48 |
{ |
| 49 |
return SVE_ACLE_FUNC(svmatch,_s16,,)(pg, op1, op2); |
| 50 |
} |
| 51 |
|
| 52 |
// CHECK-LABEL: @test_svmatch_u8( |
| 53 |
// CHECK-NEXT: entry: |
| 54 |
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.match.nxv16i8(<vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP1:%.*]], <vscale x 16 x i8> [[OP2:%.*]]) |
| 55 |
// CHECK-NEXT: ret <vscale x 16 x i1> [[TMP0]] |
| 56 |
// |
| 57 |
// CPP-CHECK-LABEL: @_Z15test_svmatch_u8u10__SVBool_tu11__SVUint8_tS0_( |
| 58 |
// CPP-CHECK-NEXT: entry: |
| 59 |
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.match.nxv16i8(<vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP1:%.*]], <vscale x 16 x i8> [[OP2:%.*]]) |
| 60 |
// CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP0]] |
| 61 |
// |
| 62 |
svbool_t test_svmatch_u8(svbool_t pg, svuint8_t op1, svuint8_t op2) |
| 63 |
{ |
| 64 |
return SVE_ACLE_FUNC(svmatch,_u8,,)(pg, op1, op2); |
| 65 |
} |
| 66 |
|
| 67 |
// CHECK-LABEL: @test_svmatch_u16( |
| 68 |
// CHECK-NEXT: entry: |
| 69 |
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]]) |
| 70 |
// CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.match.nxv8i16(<vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP1:%.*]], <vscale x 8 x i16> [[OP2:%.*]]) |
| 71 |
// CHECK-NEXT: [[TMP2:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP1]]) |
| 72 |
// CHECK-NEXT: ret <vscale x 16 x i1> [[TMP2]] |
| 73 |
// |
| 74 |
// CPP-CHECK-LABEL: @_Z16test_svmatch_u16u10__SVBool_tu12__SVUint16_tS0_( |
| 75 |
// CPP-CHECK-NEXT: entry: |
| 76 |
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]]) |
| 77 |
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.match.nxv8i16(<vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP1:%.*]], <vscale x 8 x i16> [[OP2:%.*]]) |
| 78 |
// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP1]]) |
| 79 |
// CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP2]] |
| 80 |
// |
| 81 |
svbool_t test_svmatch_u16(svbool_t pg, svuint16_t op1, svuint16_t op2) |
| 82 |
{ |
| 83 |
return SVE_ACLE_FUNC(svmatch,_u16,,)(pg, op1, op2); |
| 84 |
} |