add decode of "reverse gear" in SVP64 reduce mode
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 19 Jun 2021 12:02:03 +0000 (13:02 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 19 Jun 2021 12:02:03 +0000 (13:02 +0100)
src/openpower/decoder/power_svp64_rm.py

index dad6853b69a4e58833392f8d13af0d9fe565a6bd..a91487e1a9ad950616002916f9fa619a34480217 100644 (file)
@@ -97,6 +97,7 @@ class SVP64RMModeDecode(Elaboratable):
         self.inv = Signal(1)     # and whether it's inverted (like branch BO)
         self.map_evm = Signal(1)
         self.map_crm = Signal(1)
+        self.reverse_gear = Signal(1)  # elements to go VL-1..0
         self.ldstmode = Signal(SVP64LDSTmode) # LD/ST Mode (strided type)
 
     def elaborate(self, platform):
@@ -123,6 +124,13 @@ class SVP64RMModeDecode(Elaboratable):
             with m.Case(3):
                 comb += self.mode.eq(SVP64RMMode.PREDRES) # predicate result
 
+        # extract "reverse gear" for mapreduce mode
+        with m.If((~is_ldst) &                     # not for LD/ST
+                    (mode2 == 0) &                 # first 2 bits == 0
+                    mode[SVP64MODE.REDUCE] &       # bit 2 == 1
+                   (~mode[SVP64MODE.PARALLEL])):   # not parallel mapreduce
+            comb += self.reverse_gear.eq(1)        # theeeen finally, whew
+
         # extract zeroing
         with m.Switch(mode2):
             with m.Case(0): # needs further decoding (LDST no mapreduce)