| 1 |
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py |
| 2 |
// REQUIRES: aarch64-registered-target |
| 3 |
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu \ |
| 4 |
// RUN: -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 -O1 -Werror -emit-llvm -o - %s | FileCheck %s |
| 5 |
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu \ |
| 6 |
// RUN: -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 -O1 -Werror -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK |
| 7 |
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s |
| 8 |
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu \ |
| 9 |
// RUN: -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 -O1 -Werror -emit-llvm -o - %s | FileCheck %s |
| 10 |
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu \ |
| 11 |
// RUN: -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 -O1 -Werror -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK |
| 12 |
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s |
| 13 |
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu \ |
| 14 |
// RUN: -target-feature +sme -target-feature +sme2 -O1 -Werror -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK |
| 15 |
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +sme2 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s |
| 16 |
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s |
| 17 |
|
| 18 |
#include <arm_sve.h> |
| 19 |
|
| 20 |
#ifdef __ARM_FEATURE_SME |
| 21 |
#define ATTR __arm_streaming |
| 22 |
#else |
| 23 |
#define ATTR |
| 24 |
#endif |
| 25 |
|
| 26 |
// CHECK-LABEL: @test_svpsel_lane_c8( |
| 27 |
// CHECK-NEXT: entry: |
| 28 |
// CHECK-NEXT: [[ADD:%.*]] = add i32 [[IDX:%.*]], 15 |
| 29 |
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.taarch64.svcountt(target("aarch64.svcount") [[P1:%.*]]) |
| 30 |
// CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.psel.nxv16i1(<vscale x 16 x i1> [[TMP0]], <vscale x 16 x i1> [[P2:%.*]], i32 [[ADD]]) |
| 31 |
// CHECK-NEXT: [[TMP2:%.*]] = tail call target("aarch64.svcount") @llvm.aarch64.sve.convert.from.svbool.taarch64.svcountt(<vscale x 16 x i1> [[TMP1]]) |
| 32 |
// CHECK-NEXT: ret target("aarch64.svcount") [[TMP2]] |
| 33 |
// |
| 34 |
// CPP-CHECK-LABEL: @_Z19test_svpsel_lane_c8u11__SVCount_tu10__SVBool_tj( |
| 35 |
// CPP-CHECK-NEXT: entry: |
| 36 |
// CPP-CHECK-NEXT: [[ADD:%.*]] = add i32 [[IDX:%.*]], 15 |
| 37 |
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.taarch64.svcountt(target("aarch64.svcount") [[P1:%.*]]) |
| 38 |
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.psel.nxv16i1(<vscale x 16 x i1> [[TMP0]], <vscale x 16 x i1> [[P2:%.*]], i32 [[ADD]]) |
| 39 |
// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call target("aarch64.svcount") @llvm.aarch64.sve.convert.from.svbool.taarch64.svcountt(<vscale x 16 x i1> [[TMP1]]) |
| 40 |
// CPP-CHECK-NEXT: ret target("aarch64.svcount") [[TMP2]] |
| 41 |
// |
| 42 |
svcount_t test_svpsel_lane_c8(svcount_t p1, svbool_t p2, uint32_t idx) ATTR { |
| 43 |
return svpsel_lane_c8(p1, p2, idx + 15); |
| 44 |
} |
| 45 |
|
| 46 |
// CHECK-LABEL: @test_svpsel_lane_c16( |
| 47 |
// CHECK-NEXT: entry: |
| 48 |
// CHECK-NEXT: [[ADD:%.*]] = add i32 [[IDX:%.*]], 7 |
| 49 |
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.taarch64.svcountt(target("aarch64.svcount") [[P1:%.*]]) |
| 50 |
// CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[P2:%.*]]) |
| 51 |
// CHECK-NEXT: [[TMP2:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.psel.nxv8i1(<vscale x 16 x i1> [[TMP0]], <vscale x 8 x i1> [[TMP1]], i32 [[ADD]]) |
| 52 |
// CHECK-NEXT: [[TMP3:%.*]] = tail call target("aarch64.svcount") @llvm.aarch64.sve.convert.from.svbool.taarch64.svcountt(<vscale x 16 x i1> [[TMP2]]) |
| 53 |
// CHECK-NEXT: ret target("aarch64.svcount") [[TMP3]] |
| 54 |
// |
| 55 |
// CPP-CHECK-LABEL: @_Z20test_svpsel_lane_c16u11__SVCount_tu10__SVBool_tj( |
| 56 |
// CPP-CHECK-NEXT: entry: |
| 57 |
// CPP-CHECK-NEXT: [[ADD:%.*]] = add i32 [[IDX:%.*]], 7 |
| 58 |
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.taarch64.svcountt(target("aarch64.svcount") [[P1:%.*]]) |
| 59 |
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[P2:%.*]]) |
| 60 |
// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.psel.nxv8i1(<vscale x 16 x i1> [[TMP0]], <vscale x 8 x i1> [[TMP1]], i32 [[ADD]]) |
| 61 |
// CPP-CHECK-NEXT: [[TMP3:%.*]] = tail call target("aarch64.svcount") @llvm.aarch64.sve.convert.from.svbool.taarch64.svcountt(<vscale x 16 x i1> [[TMP2]]) |
| 62 |
// CPP-CHECK-NEXT: ret target("aarch64.svcount") [[TMP3]] |
| 63 |
// |
| 64 |
svcount_t test_svpsel_lane_c16(svcount_t p1, svbool_t p2, uint32_t idx) ATTR { |
| 65 |
return svpsel_lane_c16(p1, p2, idx + 7); |
| 66 |
} |
| 67 |
|
| 68 |
// CHECK-LABEL: @test_svpsel_lane_c32( |
| 69 |
// CHECK-NEXT: entry: |
| 70 |
// CHECK-NEXT: [[ADD:%.*]] = add i32 [[IDX:%.*]], 3 |
| 71 |
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.taarch64.svcountt(target("aarch64.svcount") [[P1:%.*]]) |
| 72 |
// CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[P2:%.*]]) |
| 73 |
// CHECK-NEXT: [[TMP2:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.psel.nxv4i1(<vscale x 16 x i1> [[TMP0]], <vscale x 4 x i1> [[TMP1]], i32 [[ADD]]) |
| 74 |
// CHECK-NEXT: [[TMP3:%.*]] = tail call target("aarch64.svcount") @llvm.aarch64.sve.convert.from.svbool.taarch64.svcountt(<vscale x 16 x i1> [[TMP2]]) |
| 75 |
// CHECK-NEXT: ret target("aarch64.svcount") [[TMP3]] |
| 76 |
// |
| 77 |
// CPP-CHECK-LABEL: @_Z20test_svpsel_lane_c32u11__SVCount_tu10__SVBool_tj( |
| 78 |
// CPP-CHECK-NEXT: entry: |
| 79 |
// CPP-CHECK-NEXT: [[ADD:%.*]] = add i32 [[IDX:%.*]], 3 |
| 80 |
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.taarch64.svcountt(target("aarch64.svcount") [[P1:%.*]]) |
| 81 |
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[P2:%.*]]) |
| 82 |
// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.psel.nxv4i1(<vscale x 16 x i1> [[TMP0]], <vscale x 4 x i1> [[TMP1]], i32 [[ADD]]) |
| 83 |
// CPP-CHECK-NEXT: [[TMP3:%.*]] = tail call target("aarch64.svcount") @llvm.aarch64.sve.convert.from.svbool.taarch64.svcountt(<vscale x 16 x i1> [[TMP2]]) |
| 84 |
// CPP-CHECK-NEXT: ret target("aarch64.svcount") [[TMP3]] |
| 85 |
// |
| 86 |
svcount_t test_svpsel_lane_c32(svcount_t p1, svbool_t p2, uint32_t idx) ATTR { |
| 87 |
return svpsel_lane_c32(p1, p2, idx + 3); |
| 88 |
} |
| 89 |
|
| 90 |
// CHECK-LABEL: @test_svpsel_lane_c64( |
| 91 |
// CHECK-NEXT: entry: |
| 92 |
// CHECK-NEXT: [[ADD:%.*]] = add i32 [[IDX:%.*]], 1 |
| 93 |
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.taarch64.svcountt(target("aarch64.svcount") [[P1:%.*]]) |
| 94 |
// CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[P2:%.*]]) |
| 95 |
// CHECK-NEXT: [[TMP2:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.psel.nxv2i1(<vscale x 16 x i1> [[TMP0]], <vscale x 2 x i1> [[TMP1]], i32 [[ADD]]) |
| 96 |
// CHECK-NEXT: [[TMP3:%.*]] = tail call target("aarch64.svcount") @llvm.aarch64.sve.convert.from.svbool.taarch64.svcountt(<vscale x 16 x i1> [[TMP2]]) |
| 97 |
// CHECK-NEXT: ret target("aarch64.svcount") [[TMP3]] |
| 98 |
// |
| 99 |
// CPP-CHECK-LABEL: @_Z20test_svpsel_lane_c64u11__SVCount_tu10__SVBool_tj( |
| 100 |
// CPP-CHECK-NEXT: entry: |
| 101 |
// CPP-CHECK-NEXT: [[ADD:%.*]] = add i32 [[IDX:%.*]], 1 |
| 102 |
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.taarch64.svcountt(target("aarch64.svcount") [[P1:%.*]]) |
| 103 |
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[P2:%.*]]) |
| 104 |
// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.psel.nxv2i1(<vscale x 16 x i1> [[TMP0]], <vscale x 2 x i1> [[TMP1]], i32 [[ADD]]) |
| 105 |
// CPP-CHECK-NEXT: [[TMP3:%.*]] = tail call target("aarch64.svcount") @llvm.aarch64.sve.convert.from.svbool.taarch64.svcountt(<vscale x 16 x i1> [[TMP2]]) |
| 106 |
// CPP-CHECK-NEXT: ret target("aarch64.svcount") [[TMP3]] |
| 107 |
// |
| 108 |
svcount_t test_svpsel_lane_c64(svcount_t p1, svbool_t p2, uint32_t idx) ATTR { |
| 109 |
return svpsel_lane_c64(p1, p2, idx + 1); |
| 110 |
} |