[PATCH] D133894: [AArch64][SME] Add intrinsics for enabling/disabling ZA.
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 17 09:42:56 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGbed214cf0f72: [AArch64][SME] Add intrinsics for enabling/disabling ZA. (authored by sdesmalen).
Changed prior to commit:
https://reviews.llvm.org/D133894?vs=460223&id=461013#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133894/new/
https://reviews.llvm.org/D133894
Files:
llvm/include/llvm/IR/IntrinsicsAArch64.td
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/sme-toggle-pstateza.ll
Index: llvm/test/CodeGen/AArch64/sme-toggle-pstateza.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/AArch64/sme-toggle-pstateza.ll
@@ -0,0 +1,16 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -mtriple=aarch64 -mattr=+sme -verify-machineinstrs < %s | FileCheck %s
+
+define void @toggle_pstate_za() {
+; CHECK-LABEL: toggle_pstate_za:
+; CHECK: // %bb.0:
+; CHECK-NEXT: smstart za
+; CHECK-NEXT: smstop za
+; CHECK-NEXT: ret
+ call void @llvm.aarch64.sme.za.enable()
+ call void @llvm.aarch64.sme.za.disable()
+ ret void
+}
+
+declare void @llvm.aarch64.sme.za.enable()
+declare void @llvm.aarch64.sme.za.disable()
Index: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
===================================================================
--- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -1157,6 +1157,9 @@
}
}
+ if (Subtarget->hasSME())
+ setOperationAction(ISD::INTRINSIC_VOID, MVT::Other, Custom);
+
if (Subtarget->hasSVE()) {
for (auto VT : {MVT::nxv16i8, MVT::nxv8i16, MVT::nxv4i32, MVT::nxv2i64}) {
setOperationAction(ISD::BITREVERSE, VT, Custom);
@@ -4565,6 +4568,18 @@
SDValue PStateSM = getPStateSM(DAG, Chain, Attrs, DL, Op.getValueType());
return DAG.getMergeValues({PStateSM, Chain}, DL);
}
+ case Intrinsic::aarch64_sme_za_enable:
+ return DAG.getNode(
+ AArch64ISD::SMSTART, DL, MVT::Other,
+ Op->getOperand(0), // Chain
+ DAG.getTargetConstant((int32_t)(AArch64SVCR::SVCRZA), DL, MVT::i32),
+ DAG.getConstant(0, DL, MVT::i64), DAG.getConstant(1, DL, MVT::i64));
+ case Intrinsic::aarch64_sme_za_disable:
+ return DAG.getNode(
+ AArch64ISD::SMSTOP, DL, MVT::Other,
+ Op->getOperand(0), // Chain
+ DAG.getTargetConstant((int32_t)(AArch64SVCR::SVCRZA), DL, MVT::i32),
+ DAG.getConstant(0, DL, MVT::i64), DAG.getConstant(1, DL, MVT::i64));
}
}
@@ -5639,6 +5654,7 @@
return LowerToPredicatedOp(Op, DAG, AArch64ISD::MULHS_PRED);
case ISD::MULHU:
return LowerToPredicatedOp(Op, DAG, AArch64ISD::MULHU_PRED);
+ case ISD::INTRINSIC_VOID:
case ISD::INTRINSIC_W_CHAIN:
return LowerINTRINSIC_W_CHAIN(Op, DAG);
case ISD::INTRINSIC_WO_CHAIN:
Index: llvm/include/llvm/IR/IntrinsicsAArch64.td
===================================================================
--- llvm/include/llvm/IR/IntrinsicsAArch64.td
+++ llvm/include/llvm/IR/IntrinsicsAArch64.td
@@ -2700,6 +2700,12 @@
def int_aarch64_sme_set_tpidr2
: DefaultAttrsIntrinsic<[], [llvm_i64_ty],
[IntrNoMem, IntrHasSideEffects]>;
+
+ def int_aarch64_sme_za_enable
+ : DefaultAttrsIntrinsic<[], [], [IntrNoMem, IntrHasSideEffects]>;
+ def int_aarch64_sme_za_disable
+ : DefaultAttrsIntrinsic<[], [], [IntrNoMem, IntrHasSideEffects]>;
+
// Clamp
//
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133894.461013.patch
Type: text/x-patch
Size: 2979 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220917/dd4198a1/attachment.bin>
More information about the llvm-commits
mailing list