forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Clang][AArch64][SME] Add vector load/store (ld1/st1) intrinsics
This patch adds support for the following SME ACLE intrinsics (as defined in https://arm-software.github.io/acle/main/acle.html): - svld1_hor_za8 // also for _za16, _za32, _za64 and _za128 - svld1_hor_vnum_za8 // also for _za16, _za32, _za64 and _za128 - svld1_ver_za8 // also for _za16, _za32, _za64 and _za128 - svld1_ver_vnum_za8 // also for _za16, _za32, _za64 and _za128 - svst1_hor_za8 // also for _za16, _za32, _za64 and _za128 - svst1_hor_vnum_za8 // also for _za16, _za32, _za64 and _za128 - svst1_ver_za8 // also for _za16, _za32, _za64 and _za128 - svst1_ver_vnum_za8 // also for _za16, _za32, _za64 and _za128 SveEmitter.cpp is extended to generate arm_sme.h (currently named arm_sme_draft_spec_subject_to_change.h) and other SME definitions from arm_sme.td, which is modeled after arm_sve.td. Common TableGen definitions are moved into arm_sve_sme_incl.td. Co-authored-by: Sagar Kulkarni <sagar.kulkarni1@huawei.com> Reviewed By: sdesmalen, kmclaughlin Differential Revision: https://reviews.llvm.org/D127910
- Loading branch information
Showing
24 changed files
with
1,584 additions
and
253 deletions.
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
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 |
---|---|---|
|
@@ -19,3 +19,4 @@ | |
#undef GET_NEON_BUILTINS | ||
|
||
#undef BUILTIN | ||
#undef TARGET_BUILTIN |
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,21 @@ | ||
//===--- BuiltinsSME.def - SME Builtin function database --------*- C++ -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This file defines the SME-specific builtin function database. Users of | ||
// this file must define the BUILTIN macro to make use of this information. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// The format of this database matches clang/Basic/Builtins.def. | ||
|
||
#define GET_SME_BUILTINS | ||
#include "clang/Basic/arm_sme_builtins.inc" | ||
#undef GET_SME_BUILTINS | ||
|
||
#undef BUILTIN | ||
#undef TARGET_BUILTIN |
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,74 @@ | ||
//===--- arm_sme.td - ARM SME compiler interface ------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This file defines the TableGen definitions from which the ARM SME header | ||
// file will be generated. See: | ||
// | ||
// https://developer.arm.com/architectures/system-architectures/software-standards/acle | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
include "arm_sve_sme_incl.td" | ||
|
||
//////////////////////////////////////////////////////////////////////////////// | ||
// Loads | ||
|
||
multiclass ZALoad<string n_suffix, string t, string i_prefix, list<ImmCheck> ch> { | ||
let TargetGuard = "sme" in { | ||
def NAME # _H : MInst<"svld1_hor_" # n_suffix, "vimiPQ", t, | ||
[IsLoad, IsOverloadNone, IsStreaming, IsSharedZA], | ||
MemEltTyDefault, i_prefix # "_horiz", ch>; | ||
|
||
def NAME # _H_VNUM : MInst<"svld1_hor_vnum_" # n_suffix, "vimiPQl", t, | ||
[IsLoad, IsOverloadNone, IsStreaming, IsSharedZA], | ||
MemEltTyDefault, i_prefix # "_horiz", ch>; | ||
|
||
def NAME # _V : MInst<"svld1_ver_" # n_suffix, "vimiPQ", t, | ||
[IsLoad, IsOverloadNone, IsStreaming, IsSharedZA], | ||
MemEltTyDefault, i_prefix # "_vert", ch>; | ||
|
||
def NAME # _V_VNUM : MInst<"svld1_ver_vnum_" # n_suffix, "vimiPQl", t, | ||
[IsLoad, IsOverloadNone, IsStreaming, IsSharedZA], | ||
MemEltTyDefault, i_prefix # "_vert", ch>; | ||
} | ||
} | ||
|
||
defm SVLD1_ZA8 : ZALoad<"za8", "c", "aarch64_sme_ld1b", [ImmCheck<0, ImmCheck0_0>, ImmCheck<2, ImmCheck0_15>]>; | ||
defm SVLD1_ZA16 : ZALoad<"za16", "s", "aarch64_sme_ld1h", [ImmCheck<0, ImmCheck0_1>, ImmCheck<2, ImmCheck0_7>]>; | ||
defm SVLD1_ZA32 : ZALoad<"za32", "i", "aarch64_sme_ld1w", [ImmCheck<0, ImmCheck0_3>, ImmCheck<2, ImmCheck0_3>]>; | ||
defm SVLD1_ZA64 : ZALoad<"za64", "l", "aarch64_sme_ld1d", [ImmCheck<0, ImmCheck0_7>, ImmCheck<2, ImmCheck0_1>]>; | ||
defm SVLD1_ZA128 : ZALoad<"za128", "q", "aarch64_sme_ld1q", [ImmCheck<0, ImmCheck0_15>, ImmCheck<2, ImmCheck0_0>]>; | ||
|
||
//////////////////////////////////////////////////////////////////////////////// | ||
// Stores | ||
|
||
multiclass ZAStore<string n_suffix, string t, string i_prefix, list<ImmCheck> ch> { | ||
let TargetGuard = "sme" in { | ||
def NAME # _H : MInst<"svst1_hor_" # n_suffix, "vimiP%", t, | ||
[IsStore, IsOverloadNone, IsStreaming, IsSharedZA, IsPreservesZA], | ||
MemEltTyDefault, i_prefix # "_horiz", ch>; | ||
|
||
def NAME # _H_VNUM : MInst<"svst1_hor_vnum_" # n_suffix, "vimiP%l", t, | ||
[IsStore, IsOverloadNone, IsStreaming, IsSharedZA, IsPreservesZA], | ||
MemEltTyDefault, i_prefix # "_horiz", ch>; | ||
|
||
def NAME # _V : MInst<"svst1_ver_" # n_suffix, "vimiP%", t, | ||
[IsStore, IsOverloadNone, IsStreaming, IsSharedZA, IsPreservesZA], | ||
MemEltTyDefault, i_prefix # "_vert", ch>; | ||
|
||
def NAME # _V_VNUM : MInst<"svst1_ver_vnum_" # n_suffix, "vimiP%l", t, | ||
[IsStore, IsOverloadNone, IsStreaming, IsSharedZA, IsPreservesZA], | ||
MemEltTyDefault, i_prefix # "_vert", ch>; | ||
} | ||
} | ||
|
||
defm SVST1_ZA8 : ZAStore<"za8", "c", "aarch64_sme_st1b", [ImmCheck<0, ImmCheck0_0>, ImmCheck<2, ImmCheck0_15>]>; | ||
defm SVST1_ZA16 : ZAStore<"za16", "s", "aarch64_sme_st1h", [ImmCheck<0, ImmCheck0_1>, ImmCheck<2, ImmCheck0_7>]>; | ||
defm SVST1_ZA32 : ZAStore<"za32", "i", "aarch64_sme_st1w", [ImmCheck<0, ImmCheck0_3>, ImmCheck<2, ImmCheck0_3>]>; | ||
defm SVST1_ZA64 : ZAStore<"za64", "l", "aarch64_sme_st1d", [ImmCheck<0, ImmCheck0_7>, ImmCheck<2, ImmCheck0_1>]>; | ||
defm SVST1_ZA128 : ZAStore<"za128", "q", "aarch64_sme_st1q", [ImmCheck<0, ImmCheck0_15>, ImmCheck<2, ImmCheck0_0>]>; |
Oops, something went wrong.