|
| 1 | +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py |
| 2 | + |
| 3 | +// REQUIRES: aarch64-registered-target |
| 4 | + |
| 5 | +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sme2 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s |
| 6 | +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sme2 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK |
| 7 | +// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sme2 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s |
| 8 | +// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sme2 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK |
| 9 | + |
| 10 | +#include <arm_sme_draft_spec_subject_to_change.h> |
| 11 | + |
| 12 | +#ifdef SVE_OVERLOADED_FORMS |
| 13 | +// A simple used,unused... macro, long enough to represent any SVE builtin.§ |
| 14 | +#define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3 |
| 15 | +#else |
| 16 | +#define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4 |
| 17 | +#endif |
| 18 | + |
| 19 | +// CHECK-LABEL: @test_svreinterpret_svbool_svcnt( |
| 20 | +// CHECK-NEXT: entry: |
| 21 | +// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.taarch64.svcountt(target("aarch64.svcount") [[CNT:%.*]]) |
| 22 | +// CHECK-NEXT: ret <vscale x 16 x i1> [[TMP0]] |
| 23 | +// |
| 24 | +// CPP-CHECK-LABEL: @_Z31test_svreinterpret_svbool_svcntu11__SVCount_t( |
| 25 | +// CPP-CHECK-NEXT: entry: |
| 26 | +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.taarch64.svcountt(target("aarch64.svcount") [[CNT:%.*]]) |
| 27 | +// CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP0]] |
| 28 | +// |
| 29 | +svbool_t test_svreinterpret_svbool_svcnt(svcount_t cnt) __arm_streaming_compatible |
| 30 | +{ |
| 31 | + return SVE_ACLE_FUNC(svreinterpret,_b,,)(cnt); |
| 32 | +} |
| 33 | + |
| 34 | +// CHECK-LABEL: @test_svreinterpret_svcnt_svbool( |
| 35 | +// CHECK-NEXT: entry: |
| 36 | +// CHECK-NEXT: [[TMP0:%.*]] = tail call target("aarch64.svcount") @llvm.aarch64.sve.convert.from.svbool.taarch64.svcountt(<vscale x 16 x i1> [[PG:%.*]]) |
| 37 | +// CHECK-NEXT: ret target("aarch64.svcount") [[TMP0]] |
| 38 | +// |
| 39 | +// CPP-CHECK-LABEL: @_Z31test_svreinterpret_svcnt_svboolu10__SVBool_t( |
| 40 | +// CPP-CHECK-NEXT: entry: |
| 41 | +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call target("aarch64.svcount") @llvm.aarch64.sve.convert.from.svbool.taarch64.svcountt(<vscale x 16 x i1> [[PG:%.*]]) |
| 42 | +// CPP-CHECK-NEXT: ret target("aarch64.svcount") [[TMP0]] |
| 43 | +// |
| 44 | +svcount_t test_svreinterpret_svcnt_svbool(svbool_t pg) __arm_streaming_compatible |
| 45 | +{ |
| 46 | + return SVE_ACLE_FUNC(svreinterpret,_c,,)(pg); |
| 47 | +} |
0 commit comments