1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5
2 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sve2 -target-feature +fp8 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s
3 // RUN: %clang_cc1 -x c++ -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +sme2 -target-feature +fp8 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CHECK-CXX
5 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +sme2 -target-feature +fp8 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s
6 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -x c++ -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sve2 -target-feature +fp8 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CHECK-CXX
8 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sve2 -target-feature +fp8 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
9 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +sme2 -target-feature +fp8 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
11 // REQUIRES: aarch64-registered-target
13 #ifdef __ARM_FEATURE_SME
19 #ifdef SVE_OVERLOADED_FORMS
20 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3) A1##A3
22 #define SVE_ACLE_FUNC(A1,A2,A3) A1##A2##A3
25 #ifdef __ARM_FEATURE_SME
26 #define STREAMING __arm_streaming
31 // CHECK-LABEL: define dso_local <vscale x 16 x i8> @test_svcvtn_f8_bf16(
32 // CHECK-SAME: <vscale x 8 x bfloat> [[ZN_ZM_COERCE0:%.*]], <vscale x 8 x bfloat> [[ZN_ZM_COERCE1:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0:[0-9]+]] {
33 // CHECK-NEXT: [[ENTRY:.*:]]
34 // CHECK-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]])
35 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.fp8.cvtn.nxv8bf16(<vscale x 8 x bfloat> [[ZN_ZM_COERCE0]], <vscale x 8 x bfloat> [[ZN_ZM_COERCE1]])
36 // CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
38 // CHECK-CXX-LABEL: define dso_local <vscale x 16 x i8> @_Z19test_svcvtn_f8_bf1614svbfloat16x2_tm(
39 // CHECK-CXX-SAME: <vscale x 8 x bfloat> [[ZN_ZM_COERCE0:%.*]], <vscale x 8 x bfloat> [[ZN_ZM_COERCE1:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0:[0-9]+]] {
40 // CHECK-CXX-NEXT: [[ENTRY:.*:]]
41 // CHECK-CXX-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]])
42 // CHECK-CXX-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.fp8.cvtn.nxv8bf16(<vscale x 8 x bfloat> [[ZN_ZM_COERCE0]], <vscale x 8 x bfloat> [[ZN_ZM_COERCE1]])
43 // CHECK-CXX-NEXT: ret <vscale x 16 x i8> [[TMP0]]
45 svmfloat8_t
test_svcvtn_f8_bf16(svbfloat16x2_t zn_zm
, fpm_t fpm
) STREAMING
{
46 return SVE_ACLE_FUNC(svcvtn_mf8
,_bf16_x2
,_fpm
)(zn_zm
, fpm
);
49 // CHECK-LABEL: define dso_local <vscale x 16 x i8> @test_svcvtn_f8_f16(
50 // CHECK-SAME: <vscale x 8 x half> [[ZN_ZM_COERCE0:%.*]], <vscale x 8 x half> [[ZN_ZM_COERCE1:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] {
51 // CHECK-NEXT: [[ENTRY:.*:]]
52 // CHECK-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]])
53 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.fp8.cvtn.nxv8f16(<vscale x 8 x half> [[ZN_ZM_COERCE0]], <vscale x 8 x half> [[ZN_ZM_COERCE1]])
54 // CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
56 // CHECK-CXX-LABEL: define dso_local <vscale x 16 x i8> @_Z18test_svcvtn_f8_f1613svfloat16x2_tm(
57 // CHECK-CXX-SAME: <vscale x 8 x half> [[ZN_ZM_COERCE0:%.*]], <vscale x 8 x half> [[ZN_ZM_COERCE1:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] {
58 // CHECK-CXX-NEXT: [[ENTRY:.*:]]
59 // CHECK-CXX-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]])
60 // CHECK-CXX-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.fp8.cvtn.nxv8f16(<vscale x 8 x half> [[ZN_ZM_COERCE0]], <vscale x 8 x half> [[ZN_ZM_COERCE1]])
61 // CHECK-CXX-NEXT: ret <vscale x 16 x i8> [[TMP0]]
63 svmfloat8_t
test_svcvtn_f8_f16(svfloat16x2_t zn_zm
, fpm_t fpm
) STREAMING
{
64 return SVE_ACLE_FUNC(svcvtn_mf8
,_f16_x2
,_fpm
)(zn_zm
, fpm
);
67 // CHECK-LABEL: define dso_local <vscale x 16 x i8> @test_svcvtnb_f8_f32(
68 // CHECK-SAME: <vscale x 4 x float> [[ZN_ZM_COERCE0:%.*]], <vscale x 4 x float> [[ZN_ZM_COERCE1:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] {
69 // CHECK-NEXT: [[ENTRY:.*:]]
70 // CHECK-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]])
71 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.fp8.cvtnb.nxv4f32(<vscale x 4 x float> [[ZN_ZM_COERCE0]], <vscale x 4 x float> [[ZN_ZM_COERCE1]])
72 // CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
74 // CHECK-CXX-LABEL: define dso_local <vscale x 16 x i8> @_Z19test_svcvtnb_f8_f3213svfloat32x2_tm(
75 // CHECK-CXX-SAME: <vscale x 4 x float> [[ZN_ZM_COERCE0:%.*]], <vscale x 4 x float> [[ZN_ZM_COERCE1:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] {
76 // CHECK-CXX-NEXT: [[ENTRY:.*:]]
77 // CHECK-CXX-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]])
78 // CHECK-CXX-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.fp8.cvtnb.nxv4f32(<vscale x 4 x float> [[ZN_ZM_COERCE0]], <vscale x 4 x float> [[ZN_ZM_COERCE1]])
79 // CHECK-CXX-NEXT: ret <vscale x 16 x i8> [[TMP0]]
81 svmfloat8_t
test_svcvtnb_f8_f32(svfloat32x2_t zn_zm
, fpm_t fpm
) STREAMING
{
82 return SVE_ACLE_FUNC(svcvtnb_mf8
,_f32_x2
,_fpm
)(zn_zm
, fpm
);
85 // CHECK-LABEL: define dso_local <vscale x 16 x i8> @test_svcvtnt_f8_f32(
86 // CHECK-SAME: <vscale x 16 x i8> [[ZD:%.*]], <vscale x 4 x float> [[ZN_ZM_COERCE0:%.*]], <vscale x 4 x float> [[ZN_ZM_COERCE1:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] {
87 // CHECK-NEXT: [[ENTRY:.*:]]
88 // CHECK-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]])
89 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.fp8.cvtnt.nxv4f32(<vscale x 16 x i8> [[ZD]], <vscale x 4 x float> [[ZN_ZM_COERCE0]], <vscale x 4 x float> [[ZN_ZM_COERCE1]])
90 // CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
92 // CHECK-CXX-LABEL: define dso_local <vscale x 16 x i8> @_Z19test_svcvtnt_f8_f32u13__SVMfloat8_t13svfloat32x2_tm(
93 // CHECK-CXX-SAME: <vscale x 16 x i8> [[ZD:%.*]], <vscale x 4 x float> [[ZN_ZM_COERCE0:%.*]], <vscale x 4 x float> [[ZN_ZM_COERCE1:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] {
94 // CHECK-CXX-NEXT: [[ENTRY:.*:]]
95 // CHECK-CXX-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]])
96 // CHECK-CXX-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.fp8.cvtnt.nxv4f32(<vscale x 16 x i8> [[ZD]], <vscale x 4 x float> [[ZN_ZM_COERCE0]], <vscale x 4 x float> [[ZN_ZM_COERCE1]])
97 // CHECK-CXX-NEXT: ret <vscale x 16 x i8> [[TMP0]]
99 svmfloat8_t
test_svcvtnt_f8_f32(svmfloat8_t zd
, svfloat32x2_t zn_zm
, fpm_t fpm
) STREAMING
{
100 return SVE_ACLE_FUNC(svcvtnt_mf8
,_f32_x2
,_fpm
)(zd
, zn_zm
, fpm
);