override logic for getting FRS in SVP64 FFT mode
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 27 Jun 2021 13:26:09 +0000 (14:26 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 27 Jun 2021 13:26:09 +0000 (14:26 +0100)
src/openpower/decoder/isa/caller.py
src/openpower/decoder/power_decoder2.py

index d1a77a2a2c0f0743d9487e47526f727a6cc1dfa9..3e9be7261807908b91424e159517976c298f5158 100644 (file)
@@ -372,6 +372,7 @@ def get_predcr(crl, mask, vl):
     return mask
 
 
+# TODO, really should just be using PowerDecoder2
 def get_pdecode_idx_in(dec2, name):
     op = dec2.dec.op
     in1_sel = yield op.in1_sel
@@ -433,6 +434,7 @@ def get_pdecode_idx_in(dec2, name):
     return None, False
 
 
+# TODO, really should just be using PowerDecoder2
 def get_pdecode_cr_out(dec2, name):
     op = dec2.dec.op
     out_sel = yield op.cr_out
@@ -456,6 +458,7 @@ def get_pdecode_cr_out(dec2, name):
     return None, False
 
 
+# TODO, really should just be using PowerDecoder2
 def get_pdecode_idx_out(dec2, name):
     op = dec2.dec.op
     out_sel = yield op.out_sel
@@ -485,6 +488,7 @@ def get_pdecode_idx_out(dec2, name):
     return None, False
 
 
+# TODO, really should just be using PowerDecoder2
 def get_pdecode_idx_out2(dec2, name):
     # check first if register is activated for write
     out_ok = yield dec2.e.write_ea.ok
index e8f6ccebb97e7db1383cddfc7eb0853a987a8026..073038402b7786203f6abe819324fc20b3f42a65 100644 (file)
@@ -1288,6 +1288,22 @@ class PowerDecode2(PowerDecodeSubset):
             comb += self.in3_isvec.eq(in3_svdec.isvec)
             comb += self.o_isvec.eq(o_svdec.isvec)
             comb += self.o2_isvec.eq(o2_svdec.isvec)
+
+            # urrr... don't ask... the implicit register FRS in FFT mode
+            # "tracks" FRT exactly except it's offset by VL.  rather than
+            # mess up the above with if-statements, override it here
+            with m.If(dec_o2.reg_out.ok & self.use_svp64_fft):
+                svdec = o_svdec # yes take source as o_svdec...
+                with m.If(svdec.isvec):
+                    # reverse gear goes the opposite way
+                    with m.If(self.rm_dec.reverse_gear):
+                        comb += to_reg.data.eq(vl+svdec.reg_out+(vl-1-dststep))
+                    with m.Else():
+                        comb += to_reg.data.eq(vl+dststep+svdec.reg_out)
+                # ... but write to *second* output
+                comb += self.o2_isvec.eq(svdec.isvec)
+                comb += o2_svdec.idx.eq(self.op_get("sv_out"))
+
             # TODO add SPRs here.  must be True when *all* are scalar
             l = map(lambda svdec: svdec.isvec, [in1_svdec, in2_svdec, in3_svdec,
                                         crin_svdec, crin_svdec_b, crin_svdec_o])