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 +bf16 -target-feature +sme -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 +bf16 -target-feature +sme -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
20 #ifdef __ARM_FEATURE_SME
21 #define ATTR __arm_streaming
26 // CHECK-LABEL: @test_svpsel_lane_b8(
28 // CHECK-NEXT: [[ADD:%.*]] = add i32 [[IDX:%.*]], 15
29 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.psel.nxv16i1(<vscale x 16 x i1> [[P1:%.*]], <vscale x 16 x i1> [[P2:%.*]], i32 [[ADD]])
30 // CHECK-NEXT: ret <vscale x 16 x i1> [[TMP0]]
32 // CPP-CHECK-LABEL: @_Z19test_svpsel_lane_b8u10__SVBool_tS_j(
33 // CPP-CHECK-NEXT: entry:
34 // CPP-CHECK-NEXT: [[ADD:%.*]] = add i32 [[IDX:%.*]], 15
35 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.psel.nxv16i1(<vscale x 16 x i1> [[P1:%.*]], <vscale x 16 x i1> [[P2:%.*]], i32 [[ADD]])
36 // CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP0]]
38 svbool_t
test_svpsel_lane_b8(svbool_t p1
, svbool_t p2
, uint32_t idx
) ATTR
{
39 return svpsel_lane_b8(p1
, p2
, idx
+ 15);
42 // CHECK-LABEL: @test_svpsel_lane_b16(
44 // CHECK-NEXT: [[ADD:%.*]] = add i32 [[IDX:%.*]], 7
45 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[P2:%.*]])
46 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.psel.nxv8i1(<vscale x 16 x i1> [[P1:%.*]], <vscale x 8 x i1> [[TMP0]], i32 [[ADD]])
47 // CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
49 // CPP-CHECK-LABEL: @_Z20test_svpsel_lane_b16u10__SVBool_tS_j(
50 // CPP-CHECK-NEXT: entry:
51 // CPP-CHECK-NEXT: [[ADD:%.*]] = add i32 [[IDX:%.*]], 7
52 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[P2:%.*]])
53 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.psel.nxv8i1(<vscale x 16 x i1> [[P1:%.*]], <vscale x 8 x i1> [[TMP0]], i32 [[ADD]])
54 // CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
56 svbool_t
test_svpsel_lane_b16(svbool_t p1
, svbool_t p2
, uint32_t idx
) ATTR
{
57 return svpsel_lane_b16(p1
, p2
, idx
+ 7);
60 // CHECK-LABEL: @test_svpsel_lane_b32(
62 // CHECK-NEXT: [[ADD:%.*]] = add i32 [[IDX:%.*]], 3
63 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[P2:%.*]])
64 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.psel.nxv4i1(<vscale x 16 x i1> [[P1:%.*]], <vscale x 4 x i1> [[TMP0]], i32 [[ADD]])
65 // CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
67 // CPP-CHECK-LABEL: @_Z20test_svpsel_lane_b32u10__SVBool_tS_j(
68 // CPP-CHECK-NEXT: entry:
69 // CPP-CHECK-NEXT: [[ADD:%.*]] = add i32 [[IDX:%.*]], 3
70 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[P2:%.*]])
71 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.psel.nxv4i1(<vscale x 16 x i1> [[P1:%.*]], <vscale x 4 x i1> [[TMP0]], i32 [[ADD]])
72 // CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
74 svbool_t
test_svpsel_lane_b32(svbool_t p1
, svbool_t p2
, uint32_t idx
) ATTR
{
75 return svpsel_lane_b32(p1
, p2
, idx
+ 3);
78 // CHECK-LABEL: @test_svpsel_lane_b64(
80 // CHECK-NEXT: [[ADD:%.*]] = add i32 [[IDX:%.*]], 1
81 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[P2:%.*]])
82 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.psel.nxv2i1(<vscale x 16 x i1> [[P1:%.*]], <vscale x 2 x i1> [[TMP0]], i32 [[ADD]])
83 // CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
85 // CPP-CHECK-LABEL: @_Z20test_svpsel_lane_b64u10__SVBool_tS_j(
86 // CPP-CHECK-NEXT: entry:
87 // CPP-CHECK-NEXT: [[ADD:%.*]] = add i32 [[IDX:%.*]], 1
88 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[P2:%.*]])
89 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.psel.nxv2i1(<vscale x 16 x i1> [[P1:%.*]], <vscale x 2 x i1> [[TMP0]], i32 [[ADD]])
90 // CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
92 svbool_t
test_svpsel_lane_b64(svbool_t p1
, svbool_t p2
, uint32_t idx
) ATTR
{
93 return svpsel_lane_b64(p1
, p2
, idx
+ 1);