-
Notifications
You must be signed in to change notification settings - Fork 12.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AArch64] Implement FP8 SVE intrinsics for widening conversions #118123
Open
momchil-velikov
wants to merge
1
commit into
llvm:main
Choose a base branch
from
momchil-velikov:fp8-sve-cvt-cvtl
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+316
−9
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
173 changes: 173 additions & 0 deletions
173
clang/test/CodeGen/AArch64/fp8-intrinsics/acle_sve2_fp8_cvt.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 | ||
// 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 | ||
// 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 | ||
|
||
// RUN: %clang_cc1 -DSME_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 | ||
// RUN: %clang_cc1 -DSME_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 | ||
|
||
// 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 | ||
// 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 | ||
|
||
// REQUIRES: aarch64-registered-target | ||
|
||
#ifdef __ARM_FEATURE_SME | ||
#include <arm_sme.h> | ||
#else | ||
#include <arm_sve.h> | ||
#endif | ||
|
||
#ifdef SVE_OVERLOADED_FORMS | ||
#define SVE_ACLE_FUNC(A1,A2_UNUSED,A3) A1##A3 | ||
#else | ||
#define SVE_ACLE_FUNC(A1,A2,A3) A1##A2##A3 | ||
#endif | ||
|
||
#ifdef __ARM_FEATURE_SME | ||
#define STREAMING __arm_streaming | ||
#else | ||
#define STREAMING | ||
#endif | ||
|
||
// CHECK-LABEL: define dso_local <vscale x 8 x bfloat> @test_svcvt1_bf16_mf8( | ||
// CHECK-SAME: <vscale x 16 x i8> [[ZN:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0:[0-9]+]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]]) | ||
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x bfloat> @llvm.aarch64.sve.fp8.cvt1.nxv8bf16(<vscale x 16 x i8> [[ZN]]) | ||
// CHECK-NEXT: ret <vscale x 8 x bfloat> [[TMP0]] | ||
// | ||
// CHECK-CXX-LABEL: define dso_local <vscale x 8 x bfloat> @_Z20test_svcvt1_bf16_mf8u13__SVMfloat8_tm( | ||
// CHECK-CXX-SAME: <vscale x 16 x i8> [[ZN:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0:[0-9]+]] { | ||
// CHECK-CXX-NEXT: [[ENTRY:.*:]] | ||
// CHECK-CXX-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]]) | ||
// CHECK-CXX-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x bfloat> @llvm.aarch64.sve.fp8.cvt1.nxv8bf16(<vscale x 16 x i8> [[ZN]]) | ||
// CHECK-CXX-NEXT: ret <vscale x 8 x bfloat> [[TMP0]] | ||
// | ||
svbfloat16_t test_svcvt1_bf16_mf8(svmfloat8_t zn, fpm_t fpm) STREAMING { | ||
return SVE_ACLE_FUNC(svcvt1_bf16,_mf8,_fpm)(zn, fpm); | ||
} | ||
|
||
// CHECK-LABEL: define dso_local <vscale x 8 x bfloat> @test_svcvt2_bf16_mf8( | ||
// CHECK-SAME: <vscale x 16 x i8> [[ZN:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]]) | ||
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x bfloat> @llvm.aarch64.sve.fp8.cvt2.nxv8bf16(<vscale x 16 x i8> [[ZN]]) | ||
// CHECK-NEXT: ret <vscale x 8 x bfloat> [[TMP0]] | ||
// | ||
// CHECK-CXX-LABEL: define dso_local <vscale x 8 x bfloat> @_Z20test_svcvt2_bf16_mf8u13__SVMfloat8_tm( | ||
// CHECK-CXX-SAME: <vscale x 16 x i8> [[ZN:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] { | ||
// CHECK-CXX-NEXT: [[ENTRY:.*:]] | ||
// CHECK-CXX-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]]) | ||
// CHECK-CXX-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x bfloat> @llvm.aarch64.sve.fp8.cvt2.nxv8bf16(<vscale x 16 x i8> [[ZN]]) | ||
// CHECK-CXX-NEXT: ret <vscale x 8 x bfloat> [[TMP0]] | ||
// | ||
svbfloat16_t test_svcvt2_bf16_mf8(svmfloat8_t zn, fpm_t fpm) STREAMING { | ||
return SVE_ACLE_FUNC(svcvt2_bf16,_mf8,_fpm)(zn, fpm); | ||
} | ||
|
||
// CHECK-LABEL: define dso_local <vscale x 8 x bfloat> @test_svcvtlt1_bf16_mf8( | ||
// CHECK-SAME: <vscale x 16 x i8> [[ZN:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]]) | ||
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x bfloat> @llvm.aarch64.sve.fp8.cvtlt1.nxv8bf16(<vscale x 16 x i8> [[ZN]]) | ||
// CHECK-NEXT: ret <vscale x 8 x bfloat> [[TMP0]] | ||
// | ||
// CHECK-CXX-LABEL: define dso_local <vscale x 8 x bfloat> @_Z22test_svcvtlt1_bf16_mf8u13__SVMfloat8_tm( | ||
// CHECK-CXX-SAME: <vscale x 16 x i8> [[ZN:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] { | ||
// CHECK-CXX-NEXT: [[ENTRY:.*:]] | ||
// CHECK-CXX-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]]) | ||
// CHECK-CXX-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x bfloat> @llvm.aarch64.sve.fp8.cvtlt1.nxv8bf16(<vscale x 16 x i8> [[ZN]]) | ||
// CHECK-CXX-NEXT: ret <vscale x 8 x bfloat> [[TMP0]] | ||
// | ||
svbfloat16_t test_svcvtlt1_bf16_mf8(svmfloat8_t zn, fpm_t fpm) STREAMING { | ||
return SVE_ACLE_FUNC(svcvtlt1_bf16,_mf8,_fpm)(zn, fpm); | ||
} | ||
|
||
// CHECK-LABEL: define dso_local <vscale x 8 x bfloat> @test_svcvtlt2_bf16_mf8( | ||
// CHECK-SAME: <vscale x 16 x i8> [[ZN:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]]) | ||
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x bfloat> @llvm.aarch64.sve.fp8.cvtlt2.nxv8bf16(<vscale x 16 x i8> [[ZN]]) | ||
// CHECK-NEXT: ret <vscale x 8 x bfloat> [[TMP0]] | ||
// | ||
// CHECK-CXX-LABEL: define dso_local <vscale x 8 x bfloat> @_Z22test_svcvtlt2_bf16_mf8u13__SVMfloat8_tm( | ||
// CHECK-CXX-SAME: <vscale x 16 x i8> [[ZN:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] { | ||
// CHECK-CXX-NEXT: [[ENTRY:.*:]] | ||
// CHECK-CXX-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]]) | ||
// CHECK-CXX-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x bfloat> @llvm.aarch64.sve.fp8.cvtlt2.nxv8bf16(<vscale x 16 x i8> [[ZN]]) | ||
// CHECK-CXX-NEXT: ret <vscale x 8 x bfloat> [[TMP0]] | ||
// | ||
svbfloat16_t test_svcvtlt2_bf16_mf8(svmfloat8_t zn, fpm_t fpm) STREAMING { | ||
return SVE_ACLE_FUNC(svcvtlt2_bf16,_mf8,_fpm)(zn, fpm); | ||
} | ||
|
||
// CHECK-LABEL: define dso_local <vscale x 8 x half> @test_svcvt1_f16_mf8( | ||
// CHECK-SAME: <vscale x 16 x i8> [[ZN:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]]) | ||
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.fp8.cvt1.nxv8f16(<vscale x 16 x i8> [[ZN]]) | ||
// CHECK-NEXT: ret <vscale x 8 x half> [[TMP0]] | ||
// | ||
// CHECK-CXX-LABEL: define dso_local <vscale x 8 x half> @_Z19test_svcvt1_f16_mf8u13__SVMfloat8_tm( | ||
// CHECK-CXX-SAME: <vscale x 16 x i8> [[ZN:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] { | ||
// CHECK-CXX-NEXT: [[ENTRY:.*:]] | ||
// CHECK-CXX-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]]) | ||
// CHECK-CXX-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.fp8.cvt1.nxv8f16(<vscale x 16 x i8> [[ZN]]) | ||
// CHECK-CXX-NEXT: ret <vscale x 8 x half> [[TMP0]] | ||
// | ||
svfloat16_t test_svcvt1_f16_mf8(svmfloat8_t zn, fpm_t fpm) STREAMING { | ||
return SVE_ACLE_FUNC(svcvt1_f16,_mf8,_fpm)(zn, fpm); | ||
} | ||
|
||
// CHECK-LABEL: define dso_local <vscale x 8 x half> @test_svcvt2_f16_mf8( | ||
// CHECK-SAME: <vscale x 16 x i8> [[ZN:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]]) | ||
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.fp8.cvt2.nxv8f16(<vscale x 16 x i8> [[ZN]]) | ||
// CHECK-NEXT: ret <vscale x 8 x half> [[TMP0]] | ||
// | ||
// CHECK-CXX-LABEL: define dso_local <vscale x 8 x half> @_Z19test_svcvt2_f16_mf8u13__SVMfloat8_tm( | ||
// CHECK-CXX-SAME: <vscale x 16 x i8> [[ZN:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] { | ||
// CHECK-CXX-NEXT: [[ENTRY:.*:]] | ||
// CHECK-CXX-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]]) | ||
// CHECK-CXX-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.fp8.cvt2.nxv8f16(<vscale x 16 x i8> [[ZN]]) | ||
// CHECK-CXX-NEXT: ret <vscale x 8 x half> [[TMP0]] | ||
// | ||
svfloat16_t test_svcvt2_f16_mf8(svmfloat8_t zn, fpm_t fpm) STREAMING { | ||
return SVE_ACLE_FUNC(svcvt2_f16,_mf8,_fpm)(zn, fpm); | ||
} | ||
|
||
// CHECK-LABEL: define dso_local <vscale x 8 x half> @test_svcvtlt1_f16_mf8( | ||
// CHECK-SAME: <vscale x 16 x i8> [[ZN:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]]) | ||
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.fp8.cvtlt1.nxv8f16(<vscale x 16 x i8> [[ZN]]) | ||
// CHECK-NEXT: ret <vscale x 8 x half> [[TMP0]] | ||
// | ||
// CHECK-CXX-LABEL: define dso_local <vscale x 8 x half> @_Z21test_svcvtlt1_f16_mf8u13__SVMfloat8_tm( | ||
// CHECK-CXX-SAME: <vscale x 16 x i8> [[ZN:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] { | ||
// CHECK-CXX-NEXT: [[ENTRY:.*:]] | ||
// CHECK-CXX-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]]) | ||
// CHECK-CXX-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.fp8.cvtlt1.nxv8f16(<vscale x 16 x i8> [[ZN]]) | ||
// CHECK-CXX-NEXT: ret <vscale x 8 x half> [[TMP0]] | ||
// | ||
svfloat16_t test_svcvtlt1_f16_mf8(svmfloat8_t zn, fpm_t fpm) STREAMING { | ||
return SVE_ACLE_FUNC(svcvtlt1_f16,_mf8,_fpm)(zn, fpm); | ||
} | ||
|
||
// CHECK-LABEL: define dso_local <vscale x 8 x half> @test_svcvtlt2_f16_mf8( | ||
// CHECK-SAME: <vscale x 16 x i8> [[ZN:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]]) | ||
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.fp8.cvtlt2.nxv8f16(<vscale x 16 x i8> [[ZN]]) | ||
// CHECK-NEXT: ret <vscale x 8 x half> [[TMP0]] | ||
// | ||
// CHECK-CXX-LABEL: define dso_local <vscale x 8 x half> @_Z21test_svcvtlt2_f16_mf8u13__SVMfloat8_tm( | ||
// CHECK-CXX-SAME: <vscale x 16 x i8> [[ZN:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] { | ||
// CHECK-CXX-NEXT: [[ENTRY:.*:]] | ||
// CHECK-CXX-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPM]]) | ||
// CHECK-CXX-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.fp8.cvtlt2.nxv8f16(<vscale x 16 x i8> [[ZN]]) | ||
// CHECK-CXX-NEXT: ret <vscale x 8 x half> [[TMP0]] | ||
// | ||
svfloat16_t test_svcvtlt2_f16_mf8(svmfloat8_t zn, fpm_t fpm) STREAMING { | ||
return SVE_ACLE_FUNC(svcvtlt2_f16,_mf8,_fpm)(zn, fpm); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// REQUIRES: aarch64-registered-target | ||
|
||
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -verify -emit-llvm %s | ||
|
||
#include <arm_sve.h> | ||
|
||
void test_features(svmfloat8_t zn, fpm_t fpm) { | ||
svcvt1_bf16_mf8_fpm(zn, fpm); | ||
// expected-error@-1 {{'svcvt1_bf16_mf8_fpm' needs target feature (sve,sve2,fp8)|(sme,sme2,fp8)}} | ||
svcvt2_bf16_mf8_fpm(zn, fpm); | ||
// expected-error@-1 {{'svcvt2_bf16_mf8_fpm' needs target feature (sve,sve2,fp8)|(sme,sme2,fp8)}} | ||
svcvtlt1_bf16_mf8_fpm(zn, fpm); | ||
// expected-error@-1 {{'svcvtlt1_bf16_mf8_fpm' needs target feature (sve,sve2,fp8)|(sme,sme2,fp8)}} | ||
svcvtlt2_bf16_mf8_fpm(zn, fpm); | ||
// expected-error@-1 {{'svcvtlt2_bf16_mf8_fpm' needs target feature (sve,sve2,fp8)|(sme,sme2,fp8)}} | ||
svcvt1_f16_mf8_fpm(zn, fpm); | ||
// expected-error@-1 {{'svcvt1_f16_mf8_fpm' needs target feature (sve,sve2,fp8)|(sme,sme2,fp8)}} | ||
svcvt2_f16_mf8_fpm(zn, fpm); | ||
// expected-error@-1 {{'svcvt2_f16_mf8_fpm' needs target feature (sve,sve2,fp8)|(sme,sme2,fp8)}} | ||
svcvtlt1_f16_mf8_fpm(zn, fpm); | ||
// expected-error@-1 {{'svcvtlt1_f16_mf8_fpm' needs target feature (sve,sve2,fp8)|(sme,sme2,fp8)}} | ||
svcvtlt2_f16_mf8_fpm(zn, fpm); | ||
// expected-error@-1 {{'svcvtlt2_f16_mf8_fpm' needs target feature (sve,sve2,fp8)|(sme,sme2,fp8)}} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
; RUN: llc -mattr=+bf16,+sve2,+fp8 < %s | FileCheck %s | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: I'm not sure we need |
||
; RUN: llc -mattr=+bf16,+sme2,+fp8 --force-streaming < %s | FileCheck %s | ||
|
||
target triple = "aarch64-linux" | ||
|
||
define <vscale x 8 x bfloat> @cvt1_bf16(<vscale x 16 x i8> %s) { | ||
; CHECK-LABEL: cvt1_bf16: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: bf1cvt z0.h, z0.b | ||
; CHECK-NEXT: ret | ||
%r = call <vscale x 8 x bfloat> @llvm.aarch64.sve.fp8.cvt1.nxv8bf16(<vscale x 16 x i8> %s) | ||
ret <vscale x 8 x bfloat> %r | ||
} | ||
|
||
define <vscale x 8 x bfloat> @cvt2_bf16(<vscale x 16 x i8> %s) { | ||
; CHECK-LABEL: cvt2_bf16: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: bf2cvt z0.h, z0.b | ||
; CHECK-NEXT: ret | ||
%r = call <vscale x 8 x bfloat> @llvm.aarch64.sve.fp8.cvt2.nxv8bf16(<vscale x 16 x i8> %s) | ||
ret <vscale x 8 x bfloat> %r | ||
} | ||
|
||
define <vscale x 8 x bfloat> @cvtlt1_bf16(<vscale x 16 x i8> %s) { | ||
; CHECK-LABEL: cvtlt1_bf16: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: bf1cvtlt z0.h, z0.b | ||
; CHECK-NEXT: ret | ||
%r = call <vscale x 8 x bfloat> @llvm.aarch64.sve.fp8.cvtlt1.nxv8bf16(<vscale x 16 x i8> %s) | ||
ret <vscale x 8 x bfloat> %r | ||
} | ||
|
||
define <vscale x 8 x bfloat> @cvtlt2_bf16(<vscale x 16 x i8> %s) { | ||
; CHECK-LABEL: cvtlt2_bf16: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: bf2cvtlt z0.h, z0.b | ||
; CHECK-NEXT: ret | ||
%r = call <vscale x 8 x bfloat> @llvm.aarch64.sve.fp8.cvtlt2.nxv8bf16(<vscale x 16 x i8> %s) | ||
ret <vscale x 8 x bfloat> %r | ||
} | ||
|
||
define <vscale x 8 x half> @cvt1_f16(<vscale x 16 x i8> %s) { | ||
; CHECK-LABEL: cvt1_f16: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: f1cvt z0.h, z0.b | ||
; CHECK-NEXT: ret | ||
%r = call <vscale x 8 x half> @llvm.aarch64.sve.fp8.cvt1.nxv8f16(<vscale x 16 x i8> %s) | ||
ret <vscale x 8 x half> %r | ||
} | ||
|
||
define <vscale x 8 x half> @cvt2_f16(<vscale x 16 x i8> %s) { | ||
; CHECK-LABEL: cvt2_f16: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: f2cvt z0.h, z0.b | ||
; CHECK-NEXT: ret | ||
%r = call <vscale x 8 x half> @llvm.aarch64.sve.fp8.cvt2.nxv8f16(<vscale x 16 x i8> %s) | ||
ret <vscale x 8 x half> %r | ||
} | ||
|
||
|
||
define <vscale x 8 x half> @cvtlt1_f16(<vscale x 16 x i8> %s) { | ||
; CHECK-LABEL: cvtlt1_f16: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: f1cvtlt z0.h, z0.b | ||
; CHECK-NEXT: ret | ||
%r = call <vscale x 8 x half> @llvm.aarch64.sve.fp8.cvtlt1.nxv8f16(<vscale x 16 x i8> %s) | ||
ret <vscale x 8 x half> %r | ||
} | ||
|
||
define <vscale x 8 x half> @cvtlt2_f16(<vscale x 16 x i8> %s) { | ||
; CHECK-LABEL: cvtlt2_f16: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: f2cvtlt z0.h, z0.b | ||
; CHECK-NEXT: ret | ||
%r = call <vscale x 8 x half> @llvm.aarch64.sve.fp8.cvtlt2.nxv8f16(<vscale x 16 x i8> %s) | ||
ret <vscale x 8 x half> %r | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind moving the
SME2_FP8_CVT_X2_Single_Intrinsic
intrinics I've merged (and perhaps the fp8fscale
ones) down to this section? I'll follow this convention with my in-flight patches.