bug 676: more experimenting with maxloc assembler
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 12 Jan 2024 16:54:33 +0000 (16:54 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 30 Jan 2024 20:54:08 +0000 (20:54 +0000)
src/openpower/decoder/isa/test_caller_svp64_maxloc.py

index 2206477f83b161f06452bc5d6374ecc7b77f11a4..f0bdca6b428d875677fb19da3291241f2013b860 100644 (file)
@@ -55,7 +55,7 @@ class DDFFirstTestCase(FHDLTestCase):
             self.assertEqual(sim.gpr(i), SelectableInt(expected[i], 64))
 
     def test_sv_maxloc_1(self):
-        self.sv_maxloc([0,6,1,2])
+        self.sv_maxloc([0,6,7,8])
 
     def tst_sv_maxloc_2(self):
         self.sv_maxloc([3,4,1,5])
@@ -86,18 +86,19 @@ class DDFFirstTestCase(FHDLTestCase):
                 #"addi 6, 0, 0",             # initialise r6 to zero
                 #"sv.lbzu/pi/dw=8 *6, 1(4)", # should be /lf here as well
                 # while (i<n and a[i]<=m) : i += 1
-                "sv.minmax./ff=ge/m=ge *5, *10, *4, 1",
-                "sv.mcrf/m=ge *4,*0", # masked-copy CR0-CR3 to CR4-CR7
+                "sv.cmp/ff=lt/m=ge *0,0,*10,4", # truncates VL to min
+                "sv.creqv *16,*16,*16", # set mask on already-tested
                 "setvl 2,0,4,0,1,1",        # set MVL=4, VL=MIN(MVL,CTR)
-                "sv.addi/mr/m=lt 4, *5, 0", # r4 = last non-masked value
-                "mtcrf 128, 0",       # clear CR0
-                "sv.minmax./ff=lt/m=ge 4, *10, 4, 1", # uses r4 as accumulator
+                #"sv.addi/mr/sm=ge/dm=ns 4, *4, 0", # r4 = last non-masked value
+                "mtcrf 128, 0",       # clear CR0 (in case VL=0?)
+                "sv.minmax./ff=ge/m=ge 4, *10, 4, 1", # uses r4 as accumulator
                 "sv.svstep/mr 3, 0, 6, 1",  # svstep: get vector dststep
-                "sv.addi/dm=1<<r3 *4, 4, 0", # put r4 into vector at r4
+                "add 1,1,3",  # accumulate dststep
+                #"sv.addi/dm=1<<r3 *5, 4, 0", # put r4 into vector at r5
                 "sv.creqv *16,*16,*16", # set mask on already-tested
-                "bc 12,0, -0x44"            # CR0 lt bit clear, branch back
-                #"setvl 3,0,4,0,1,1",        # set MVL=4, VL=MIN(MVL,CTR)
-                #"sv.bc/all/m=ge 16, 19, -0x3c", # until r10[i]>r4 (and dec CTR)
+                #"bc 12,0, -0x34"            # CR0 lt bit clear, branch back
+                "setvl 3,0,4,0,1,1",        # set MVL=4, VL=MIN(MVL,CTR)
+                "sv.bc/m=ge 16, 19, -0x3c", # until r10[i]>r4 (and dec CTR)
                         ])
         lst = list(lst)