From d244d064b027a8fecbd26a3fa800fb4c30a6702d Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 20 Sep 2022 12:06:00 +0100 Subject: [PATCH] add two extra tests, sv.bc/m=r3/sz --- src/openpower/sv/trans/test_pysvp64dis.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/openpower/sv/trans/test_pysvp64dis.py b/src/openpower/sv/trans/test_pysvp64dis.py index 98173ba5..7b05af6e 100644 --- a/src/openpower/sv/trans/test_pysvp64dis.py +++ b/src/openpower/sv/trans/test_pysvp64dis.py @@ -5,6 +5,7 @@ from openpower.decoder.power_insn import Database, Verbosity from openpower.decoder.power_enums import find_wiki_dir from openpower.sv import sv_binutils_fptrans import unittest +import itertools import sys class SVSTATETestCase(unittest.TestCase): @@ -258,9 +259,29 @@ class SVSTATETestCase(unittest.TestCase): def test_16_bc(self): # hilarious. this should be autogenerated from a sequence # of lists of options. it's a lot of frickin options. + lists = [[None, 'all'], + [None, 'm=r3/sz', 'm=r3/snz'], + #[None, 'vs', 'vsi', 'vsb', 'vsbi'], + [None, 'ctr', 'cti'], + #[None, 'sl'], + #[None, 'slu'], + #[None, 'lru'], + ] + expected = [] + for options in itertools.product(*lists): + options = list(filter(lambda x:x, options)) + options.sort() # otherwise chaos! + if len(options) != 0: + options = [''] + options # trick to make a "/" at the front + print ("option", options) + option = "sv.bc%s 12,*1,0xc" % "/".join(options) + expected.append(option) + #_old_handcrafted_expected = [ expected = [ "sv.bc/all 12,*1,0xc", "sv.bc/snz 12,*1,0xc", + "sv.bc/m=r3/snz 12,*1,0xc", + "sv.bc/m=r3/sz 12,*1,0xc", "sv.bc/all/sl/slu 12,*1,0xc", "sv.bc/all/snz/sl/slu/lru 12,*1,0xc", "sv.bc/vs/all/snz/sl/slu/lru 12,*1,0xc", -- 2.30.2