Debian Codegraph @

clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_get4_bool.c

raw
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s \
3 // RUN: | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
4 // RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s \
5 // RUN: | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
6 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s \
7 // RUN: | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
8 // RUN: %clang_cc1 -triple aarch64 -target-feature +bf16 -target-feature +sme -target-feature +sme2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s \
9 // RUN: | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
10 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s\
11 // RUN: | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
12 // RUN: %clang_cc1 -triple aarch64 -target-feature +bf16 -target-feature +sme -target-feature +sme2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s \
13 // RUN: | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
14 // RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
15 // RUN: %clang_cc1 -triple aarch64 -target-feature +bf16 -target-feature +sme -target-feature +sme2 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
16
17 // REQUIRES: aarch64-registered-target
18
19 #include <arm_sve.h>
20
21 #if defined __ARM_FEATURE_SME
22 #define MODE_ATTR __arm_streaming
23 #else
24 #define MODE_ATTR
25 #endif
26
27 #ifdef SVE_OVERLOADED_FORMS
28 // A simple used,unused... macro, long enough to represent any SVE builtin.
29 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
30 #else
31 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
32 #endif
33
34 // NOTE: For these tests clang converts the struct parameter into
35 // several parameters, one for each member of the original struct.
36 // CHECK-LABEL: @test_svget4_b_0(
37 // CHECK-NEXT: entry:
38 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.vector.extract.nxv16i1.nxv64i1(<vscale x 64 x i1> [[TUPLE:%.*]], i64 0)
39 // CHECK-NEXT: ret <vscale x 16 x i1> [[TMP0]]
40 //
41 // CPP-CHECK-LABEL: @_Z15test_svget4_b_010svboolx4_t(
42 // CPP-CHECK-NEXT: entry:
43 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.vector.extract.nxv16i1.nxv64i1(<vscale x 64 x i1> [[TUPLE:%.*]], i64 0)
44 // CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP0]]
45 //
46 svbool_t test_svget4_b_0(svboolx4_t tuple) MODE_ATTR
47 {
48 return SVE_ACLE_FUNC(svget4,_b,,)(tuple, 0);
49 }
50
51 // NOTE: For these tests clang converts the struct parameter into
52 // several parameters, one for each member of the original struct.
53 // CHECK-LABEL: @test_svget4_b_1(
54 // CHECK-NEXT: entry:
55 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.vector.extract.nxv16i1.nxv64i1(<vscale x 64 x i1> [[TUPLE:%.*]], i64 16)
56 // CHECK-NEXT: ret <vscale x 16 x i1> [[TMP0]]
57 //
58 // CPP-CHECK-LABEL: @_Z15test_svget4_b_110svboolx4_t(
59 // CPP-CHECK-NEXT: entry:
60 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.vector.extract.nxv16i1.nxv64i1(<vscale x 64 x i1> [[TUPLE:%.*]], i64 16)
61 // CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP0]]
62 //
63 svbool_t test_svget4_b_1(svboolx4_t tuple) MODE_ATTR
64 {
65 return SVE_ACLE_FUNC(svget4,_b,,)(tuple, 1);
66 }
67
68 // NOTE: For these tests clang converts the struct parameter into
69 // several parameters, one for each member of the original struct.
70 // CHECK-LABEL: @test_svget4_b_3(
71 // CHECK-NEXT: entry:
72 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.vector.extract.nxv16i1.nxv64i1(<vscale x 64 x i1> [[TUPLE:%.*]], i64 48)
73 // CHECK-NEXT: ret <vscale x 16 x i1> [[TMP0]]
74 //
75 // CPP-CHECK-LABEL: @_Z15test_svget4_b_310svboolx4_t(
76 // CPP-CHECK-NEXT: entry:
77 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.vector.extract.nxv16i1.nxv64i1(<vscale x 64 x i1> [[TUPLE:%.*]], i64 48)
78 // CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP0]]
79 //
80 svbool_t test_svget4_b_3(svboolx4_t tuple) MODE_ATTR
81 {
82 return SVE_ACLE_FUNC(svget4,_b,,)(tuple, 3);
83 }