Skip to content

Commit

Permalink
Skip aq/rl instructions
Browse files Browse the repository at this point in the history
Signed-off-by: Afonso Oliveira <[email protected]>
  • Loading branch information
AFOliveira committed Dec 23, 2024
1 parent d61fb3b commit 5992124
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions ext/auto-inst/test_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ def load_test_data():

return _yaml_instructions, _json_data, _repo_dir

def has_aqrl_variables(yaml_vars):
"""Check if instruction has aq/rl variables."""
if not yaml_vars:
return False
return any(var.get("name") in ["aq", "rl"] for var in yaml_vars)

def pytest_generate_tests(metafunc):
"""Generate test cases dynamically."""
if "instr_name" in metafunc.fixturenames:
Expand All @@ -50,12 +56,16 @@ def _find_matching_instruction(self, yaml_instr_name):
for key, value in self.json_data.items():
if not isinstance(value, dict):
continue

# Skip if instruction is pseudo and keep looking
is_pseudo = value.get('isPseudo', '')
if is_pseudo == 1:
continue

asm_string = value.get('AsmString', '').lower().strip()
if not asm_string:
continue
is_pseudo = value.get('isPseudo', "")
if is_pseudo == 1:
continue

base_asm_name = asm_string.split()[0]
if base_asm_name == yaml_instr_name:
return key
Expand All @@ -80,6 +90,10 @@ def test_instruction_encoding(self, instr_name):
"""Test encoding for a single instruction."""
yaml_data = self.yaml_instructions[instr_name]

# Skip if the instruction has aq/rl variables
if has_aqrl_variables(yaml_data.get("yaml_vars", [])):
pytest.skip(f"Skipping instruction {instr_name} due to aq/rl variables")

# Skip if no YAML match pattern
if not yaml_data.get("yaml_match"):
pytest.skip(f"Instruction {instr_name} has no YAML match pattern")
Expand Down

0 comments on commit 5992124

Please sign in to comment.