Skip to content

[lldb][AArch64] Add isAArch64SMEFA64 check to SME testing #68094

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 3 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lldb/packages/Python/lldbsuite/test/lldbtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,14 @@ def isAArch64SVE(self):
def isAArch64SME(self):
return self.isAArch64() and "sme" in self.getCPUInfo()

def isAArch64SMEFA64(self):
# smefa64 allows the use of the full A64 instruction set in streaming
# mode. This is required by certain test programs to setup register
# state.
return self.isAArch64SME() and set(["sme", "smefa64"]).issuperset(
set(self.getCPUInfo())
)

def isAArch64MTE(self):
return self.isAArch64() and "mte" in self.getCPUInfo()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ def make_za_value(self, vl, generator):
def test_aarch64_dynamic_regset_config_sme(self):
"""Test AArch64 Dynamic Register sets configuration, but only SME
registers."""
if not self.isAArch64SME():
self.skipTest("SME must be present.")
if not self.isAArch64SMEFA64():
self.skipTest("SME and the smefa64 extension must be present")

register_sets = self.setup_register_config_test("sme")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,11 @@ def run_sve_test(self, mode):
if (mode == Mode.SVE) and not self.isAArch64SVE():
self.skipTest("SVE registers must be supported.")

if (mode == Mode.SSVE) and not self.isAArch64SME():
self.skipTest("Streaming SVE registers must be supported.")
if (mode == Mode.SSVE) and not self.isAArch64SMEFA64():
self.skipTest(
"Streaming SVE registers must be supported and the "
"smefa64 extension must be present."
)

self.build_for_mode(mode)

Expand Down Expand Up @@ -201,8 +204,11 @@ def test_ssve_registers_dynamic_config(self):

def setup_svg_test(self, mode):
# Even when running in SVE mode, we need access to SVG for these tests.
if not self.isAArch64SME():
self.skipTest("Streaming SVE registers must be present.")
if not self.isAArch64SMEFA64():
self.skipTest(
"Streaming SVE registers must be present and the "
"smefa64 extension must be present."
)

self.build_for_mode(mode)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@ def skip_if_needed(self, mode):
if (mode == Mode.SVE) and not self.isAArch64SVE():
self.skipTest("SVE registers must be supported.")

if (mode == Mode.SSVE) and not self.isAArch64SME():
self.skipTest("SSVE registers must be supported.")
if (mode == Mode.SSVE) and not self.isAArch64SMEFA64():
self.skipTest(
"SSVE registers must be supported and the smefa64 "
"extension must be present."
)

def sve_registers_configuration_impl(self, mode):
self.skip_if_needed(mode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ def skip_if_needed(self, mode):
if (mode == Mode.SVE) and not self.isAArch64SVE():
self.skipTest("SVE registers must be supported.")

if (mode == Mode.SSVE) and not self.isAArch64SME():
self.skipTest("SSVE registers must be supported.")
if (mode == Mode.SSVE) and not self.isAArch64SMEFA64():
self.skipTest(
"SSVE registers must be supported and the smefa64 "
"extension must be present."
)

def make_simd_value(self, n):
pad = " ".join(["0x00"] * 7)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ def check_disabled_za_register(self, svg):
self.expect("register read za", substrs=[self.gen_za_value(svg, lambda r: 0)])

def za_test_impl(self, enable_za):
if not self.isAArch64SME():
self.skipTest("SME must be present.")
# Although the test program doesn't obviously do any operations that
# would need smefa64, calls to libc functions like memset may do.
if not self.isAArch64SMEFA64():
self.skipTest("SME and the sm3fa64 extension must be present")

self.build()
supported_vg = self.get_supported_vg()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ void set_za_register(int svl, int value_offset) {
// you have. So setting one that didn't exist would actually set one that did.
// That's why we need the streaming vector length here.
for (int i = 0; i < svl; ++i) {
// This may involve instructions that require the smefa64 extension.
memset(data, i + value_offset, MAX_VL_BYTES);
// Each one of these loads a VL sized row of ZA.
asm volatile("mov w12, %w0\n\t"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ def check_za_disabled(self, vl):
self.expect("register read za", substrs=[self.make_za_value(vl, lambda row: 0)])

def za_expr_test_impl(self, sve_mode, za_state, swap_start_vl):
if not self.isAArch64SME():
self.skipTest("SME must be present.")
if not self.isAArch64SMEFA64():
self.skipTest("SME and the smefa64 extension must be present.")

supported_svg = self.get_supported_svg()
if len(supported_svg) < 2:
Expand Down