[llvm] [AArch64][SME2] Preserve ZT0 state around function calls (PR #78321)
Sander de Smalen via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 19 01:17:21 PST 2024
================
@@ -275,4 +278,88 @@ TEST(SMEAttributes, Transitions) {
.requiresSMChange(SA(SA::SM_Compatible | SA::SM_Body),
/*BodyOverridesInterface=*/true),
true);
+
+ SA ZT0_In = SA(SA::encodeZT0State(SA::StateValue::In));
+ SA ZT0_InOut = SA(SA::encodeZT0State(SA::StateValue::InOut));
+ SA ZT0_Out = SA(SA::encodeZT0State(SA::StateValue::Out));
+ SA ZT0_Preserved = SA(SA::encodeZT0State(SA::StateValue::Preserved));
+ SA ZT0_New = SA(SA::encodeZT0State(SA::StateValue::New));
+
+ // ZT0 New -> Normal
+ ASSERT_TRUE(ZT0_New.requiresPreservingZT0(SA(SA::Normal)));
+ ASSERT_TRUE(ZT0_New.requiresDisablingZABeforeCall(SA(SA::Normal)));
+ ASSERT_TRUE(ZT0_New.requiresEnablingZAAfterCall(SA(SA::Normal)));
+
+ // ZT0 New -> ZT0 New
+ ASSERT_TRUE(ZT0_New.requiresPreservingZT0(ZT0_New));
+ ASSERT_TRUE(ZT0_New.requiresDisablingZABeforeCall(ZT0_New));
+ ASSERT_TRUE(ZT0_New.requiresEnablingZAAfterCall(ZT0_New));
----------------
sdesmalen-arm wrote:
Normal and ZT0_New have the same interface, so there's no value in testing them both.
https://github.com/llvm/llvm-project/pull/78321
More information about the llvm-commits
mailing list