add two extra tests, sv.bc/m=r3/sz
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 20 Sep 2022 11:06:00 +0000 (12:06 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 20 Sep 2022 11:06:00 +0000 (12:06 +0100)
src/openpower/sv/trans/test_pysvp64dis.py

index 98173ba566b6f2e475d36c2a2a2186af095bf8a6..7b05af6eef02f829c225ce4be24ff962ecb5794c 100644 (file)
@@ -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",