-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[AArch64][clang][llvm] Add structured sparsity outer product (TMOP) intrinsics #135145
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c0bff6f
[AArch64][clang][llvm] Add structured sparsity outer product (TMOP) i…
jthackray 2624dc6
fixup! Fixup code review issues for TMOP
jthackray bf4bb10
fixup! Add extra parameter to SME2_ZA_TMOP_Pat for TileOp16 and Vecto…
jthackray 51462fa
fixup! Fix Marian's code review comments
jthackray 66c5ca0
fixup! Remove some range tests, and improve SME2_ZA_TMOP_Pat
jthackray 155ce5d
fixup! Fix remaining CR comments
jthackray eddca2a
fixup! Numbers in test weren't correctly updated - fix.
jthackray 95a5132
fixup! Bother, another number requiring bit-twiddling
jthackray 25bcd21
fixup! Also set "mayLoad"
jthackray 66ff772
fixup! Move mayLoad/mayStore to reduce code duplication
jthackray b7bfd9b
fixup! Add FPCR for all FP TMOP instructions
jthackray 8ff3086
fixup! Address Carol's CR comments
jthackray b6b98f2
fixup! Rename intrinsics
jthackray ea5d22b
fixup! Fix minor nits
jthackray 8f3e036
fixup! One more intrinsic rename
jthackray 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 hidden or 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
133 changes: 133 additions & 0 deletions
133
clang/test/CodeGen/AArch64/sme2-intrinsics/acle_sme2_tmop.c
This file contains hidden or 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,133 @@ | ||
| // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py | ||
|
|
||
| // REQUIRES: aarch64-registered-target | ||
| // RUN: %clang_cc1 -triple aarch64 -target-feature +bf16 -target-feature +sme-tmop -target-feature +sme-f16f16 -target-feature +sme-b16b16 -target-feature +sme-f8f16 -target-feature +sme-f8f32 -target-feature +sme -target-feature +sme2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s | ||
| // RUN: %clang_cc1 -DSME_OVERLOADED_FORMS -triple aarch64 -target-feature +bf16 -target-feature +sme-tmop -target-feature +sme-f16f16 -target-feature +sme-b16b16 -target-feature +sme-f8f16 -target-feature +sme-f8f32 -target-feature +sme -target-feature +sme2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s | ||
| // RUN: %clang_cc1 -triple aarch64 -target-feature +bf16 -target-feature +sme-tmop -target-feature +sme-f16f16 -target-feature +sme-b16b16 -target-feature +sme-f8f16 -target-feature +sme-f8f32 -target-feature +sme -target-feature +sme2 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s | ||
jthackray marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| #include <arm_sme.h> | ||
|
|
||
| #ifdef SME_OVERLOADED_FORMS | ||
| #define SME_ACLE_FUNC(A1,A2_UNUSED,A3) A1##A3 | ||
| #else | ||
| #define SME_ACLE_FUNC(A1,A2,A3) A1##A2##A3 | ||
| #endif | ||
|
|
||
| // CHECK-LABEL: @test_svtmopa_lane_za32_s8_s8( | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: tail call void @llvm.aarch64.sme.stmopa.nxv16i8(i32 1, <vscale x 16 x i8> [[ZN_COERCE0:%.*]], <vscale x 16 x i8> [[ZN_COERCE1:%.*]], <vscale x 16 x i8> [[ZM:%.*]], <vscale x 16 x i8> [[ZK:%.*]], i32 3) | ||
| // CHECK-NEXT: ret void | ||
| // | ||
| void test_svtmopa_lane_za32_s8_s8(svint8x2_t zn, svint8_t zm, svuint8_t zk) __arm_streaming __arm_inout("za") { | ||
| SME_ACLE_FUNC(svtmopa_lane_za32,_s8_s8,)(1, zn, zm, zk, 3); | ||
| } | ||
|
|
||
| // CHECK-LABEL: @test_svtmopa_lane_za32_u8_u8( | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: tail call void @llvm.aarch64.sme.utmopa.nxv16i8(i32 1, <vscale x 16 x i8> [[ZN_COERCE0:%.*]], <vscale x 16 x i8> [[ZN_COERCE1:%.*]], <vscale x 16 x i8> [[ZM:%.*]], <vscale x 16 x i8> [[ZK:%.*]], i32 3) | ||
| // CHECK-NEXT: ret void | ||
| // | ||
| void test_svtmopa_lane_za32_u8_u8(svuint8x2_t zn, svuint8_t zm, svuint8_t zk) __arm_streaming __arm_inout("za") { | ||
| SME_ACLE_FUNC(svtmopa_lane_za32,_u8_u8,)(1, zn, zm, zk, 3); | ||
| } | ||
|
|
||
| // CHECK-LABEL: @test_svtmopa_lane_za32_s8_u8( | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: tail call void @llvm.aarch64.sme.sutmopa.nxv16i8(i32 1, <vscale x 16 x i8> [[ZN_COERCE0:%.*]], <vscale x 16 x i8> [[ZN_COERCE1:%.*]], <vscale x 16 x i8> [[ZM:%.*]], <vscale x 16 x i8> [[ZK:%.*]], i32 3) | ||
| // CHECK-NEXT: ret void | ||
| // | ||
| void test_svtmopa_lane_za32_s8_u8(svint8x2_t zn, svuint8_t zm, svuint8_t zk) __arm_streaming __arm_inout("za") { | ||
| SME_ACLE_FUNC(svtmopa_lane_za32,_s8_u8,)(1, zn, zm, zk, 3); | ||
| } | ||
|
|
||
| // CHECK-LABEL: @test_svtmopa_lane_za32_u8_s8( | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: tail call void @llvm.aarch64.sme.ustmopa.nxv16i8(i32 1, <vscale x 16 x i8> [[ZN_COERCE0:%.*]], <vscale x 16 x i8> [[ZN_COERCE1:%.*]], <vscale x 16 x i8> [[ZM:%.*]], <vscale x 16 x i8> [[ZK:%.*]], i32 3) | ||
| // CHECK-NEXT: ret void | ||
| // | ||
| void test_svtmopa_lane_za32_u8_s8(svuint8x2_t zn, svint8_t zm, svuint8_t zk) __arm_streaming __arm_inout("za") { | ||
| SME_ACLE_FUNC(svtmopa_lane_za32,_u8_s8,)(1, zn, zm, zk, 3); | ||
| } | ||
|
|
||
| // CHECK-LABEL: @test_svtmopa_lane_za32_s16_s16( | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: tail call void @llvm.aarch64.sme.stmopa.nxv8i16(i32 1, <vscale x 8 x i16> [[ZN_COERCE0:%.*]], <vscale x 8 x i16> [[ZN_COERCE1:%.*]], <vscale x 8 x i16> [[ZM:%.*]], <vscale x 16 x i8> [[ZK:%.*]], i32 3) | ||
| // CHECK-NEXT: ret void | ||
| // | ||
| void test_svtmopa_lane_za32_s16_s16(svint16x2_t zn, svint16_t zm, svuint8_t zk) __arm_streaming __arm_inout("za") { | ||
| SME_ACLE_FUNC(svtmopa_lane_za32,_s16_s16,)(1, zn, zm, zk, 3); | ||
| } | ||
|
|
||
| // CHECK-LABEL: @test_svtmopa_lane_za32_u16_u16( | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: tail call void @llvm.aarch64.sme.utmopa.nxv8i16(i32 1, <vscale x 8 x i16> [[ZN_COERCE0:%.*]], <vscale x 8 x i16> [[ZN_COERCE1:%.*]], <vscale x 8 x i16> [[ZM:%.*]], <vscale x 16 x i8> [[ZK:%.*]], i32 3) | ||
| // CHECK-NEXT: ret void | ||
| // | ||
| void test_svtmopa_lane_za32_u16_u16(svuint16x2_t zn, svuint16_t zm, svuint8_t zk) __arm_streaming __arm_inout("za") { | ||
| SME_ACLE_FUNC(svtmopa_lane_za32,_u16_u16,)(1, zn, zm, zk, 3); | ||
| } | ||
|
|
||
| // CHECK-LABEL: @test_svtmopa_lane_za32_f16_f16( | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: tail call void @llvm.aarch64.sme.tmopa.nxv8f16(i32 1, <vscale x 8 x half> [[ZN_COERCE0:%.*]], <vscale x 8 x half> [[ZN_COERCE1:%.*]], <vscale x 8 x half> [[ZM:%.*]], <vscale x 16 x i8> [[ZK:%.*]], i32 3) | ||
| // CHECK-NEXT: ret void | ||
| // | ||
| void test_svtmopa_lane_za32_f16_f16(svfloat16x2_t zn, svfloat16_t zm, svuint8_t zk) __arm_streaming __arm_inout("za") { | ||
| SME_ACLE_FUNC(svtmopa_lane_za32,_f16_f16,)(1, zn, zm, zk, 3); | ||
| } | ||
|
|
||
| // CHECK-LABEL: @test_svtmopa_lane_za32_f32_f32( | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: tail call void @llvm.aarch64.sme.tmopa.nxv4f32(i32 1, <vscale x 4 x float> [[ZN_COERCE0:%.*]], <vscale x 4 x float> [[ZN_COERCE1:%.*]], <vscale x 4 x float> [[ZM:%.*]], <vscale x 16 x i8> [[ZK:%.*]], i32 3) | ||
| // CHECK-NEXT: ret void | ||
| // | ||
| void test_svtmopa_lane_za32_f32_f32(svfloat32x2_t zn, svfloat32_t zm, svuint8_t zk) __arm_streaming __arm_inout("za") { | ||
| SME_ACLE_FUNC(svtmopa_lane_za32,_f32_f32,)(1, zn, zm, zk, 3); | ||
| } | ||
|
|
||
| // CHECK-LABEL: @test_svtmopa_lane_za32_bf16_bf16( | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: tail call void @llvm.aarch64.sme.tmopa.nxv8bf16(i32 1, <vscale x 8 x bfloat> [[ZN_COERCE0:%.*]], <vscale x 8 x bfloat> [[ZN_COERCE1:%.*]], <vscale x 8 x bfloat> [[ZM:%.*]], <vscale x 16 x i8> [[ZK:%.*]], i32 3) | ||
| // CHECK-NEXT: ret void | ||
| // | ||
| void test_svtmopa_lane_za32_bf16_bf16(svbfloat16x2_t zn, svbfloat16_t zm, svuint8_t zk) __arm_streaming __arm_inout("za") { | ||
| SME_ACLE_FUNC(svtmopa_lane_za32,_bf16_bf16,)(1, zn, zm, zk, 3); | ||
| } | ||
|
|
||
| // CHECK-LABEL: @test_svtmopa_lane_za16_f16_f16( | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: tail call void @llvm.aarch64.sme.tmopa.nxv8f16(i32 1, <vscale x 8 x half> [[ZN_COERCE0:%.*]], <vscale x 8 x half> [[ZN_COERCE1:%.*]], <vscale x 8 x half> [[ZM:%.*]], <vscale x 16 x i8> [[ZK:%.*]], i32 3) | ||
| // CHECK-NEXT: ret void | ||
| // | ||
| void test_svtmopa_lane_za16_f16_f16(svfloat16x2_t zn, svfloat16_t zm, svuint8_t zk) __arm_streaming __arm_inout("za") { | ||
| SME_ACLE_FUNC(svtmopa_lane_za16,_f16_f16,)(1, zn, zm, zk, 3); | ||
| } | ||
|
|
||
| // CHECK-LABEL: @test_svtmopa_lane_za16_bf16_bf16( | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: tail call void @llvm.aarch64.sme.tmopa.nxv8bf16(i32 1, <vscale x 8 x bfloat> [[ZN_COERCE0:%.*]], <vscale x 8 x bfloat> [[ZN_COERCE1:%.*]], <vscale x 8 x bfloat> [[ZM:%.*]], <vscale x 16 x i8> [[ZK:%.*]], i32 3) | ||
| // CHECK-NEXT: ret void | ||
| // | ||
| void test_svtmopa_lane_za16_bf16_bf16(svbfloat16x2_t zn, svbfloat16_t zm, svuint8_t zk) __arm_streaming __arm_inout("za") { | ||
| SME_ACLE_FUNC(svtmopa_lane_za16,_bf16_bf16,)(1, zn, zm, zk, 3); | ||
| } | ||
|
|
||
| // CHECK-LABEL: @test_svtmopa_lane_za16_mf8_mf8_fpm( | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPMR:%.*]]) | ||
| // CHECK-NEXT: tail call void @llvm.aarch64.sme.tmopa.nxv16i8(i32 1, <vscale x 16 x i8> [[ZN_COERCE0:%.*]], <vscale x 16 x i8> [[ZN_COERCE1:%.*]], <vscale x 16 x i8> [[ZM:%.*]], <vscale x 16 x i8> [[ZK:%.*]], i32 3) | ||
| // CHECK-NEXT: ret void | ||
| // | ||
| void test_svtmopa_lane_za16_mf8_mf8_fpm(svmfloat8x2_t zn, svmfloat8_t zm, svuint8_t zk, fpm_t fpmr) __arm_streaming __arm_inout("za") { | ||
| SME_ACLE_FUNC(svtmopa_lane_za16,_mf8_mf8,_fpm)(1, zn, zm, zk, 3, fpmr); | ||
| } | ||
|
|
||
| // CHECK-LABEL: @test_svtmopa_lane_za32_mf8_mf8_fpm( | ||
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPMR:%.*]]) | ||
| // CHECK-NEXT: tail call void @llvm.aarch64.sme.tmopa.nxv16i8(i32 1, <vscale x 16 x i8> [[ZN_COERCE0:%.*]], <vscale x 16 x i8> [[ZN_COERCE1:%.*]], <vscale x 16 x i8> [[ZM:%.*]], <vscale x 16 x i8> [[ZK:%.*]], i32 3) | ||
| // CHECK-NEXT: ret void | ||
| // | ||
| void test_svtmopa_lane_za32_mf8_mf8_fpm(svmfloat8x2_t zn, svmfloat8_t zm, svuint8_t zk, fpm_t fpmr) __arm_streaming __arm_inout("za") { | ||
| SME_ACLE_FUNC(svtmopa_lane_za32,_mf8_mf8,_fpm)(1, zn, zm, zk, 3, fpmr); | ||
| } | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.