fix SVP64 EXTRA2/3 decode for IEEE754 FP LD/ST operations
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 18 May 2021 17:24:19 +0000 (18:24 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 18 May 2021 17:24:19 +0000 (18:24 +0100)
openpower/isatables/LDSTRM-2P-1S1D.csv
openpower/isatables/LDSTRM-2P-1S2D.csv
openpower/isatables/LDSTRM-2P-2S.csv
openpower/isatables/LDSTRM-2P-2S1D.csv
openpower/isatables/LDSTRM-2P-3S.csv
src/openpower/sv/sv_analysis.py

index 56addddcba0edad45715669ba351db3b67b0ba1c..e17d7fbce1933ce18fa2885627b301f54c195bd2 100644 (file)
@@ -3,7 +3,7 @@ lwz,2P,EXTRA3,d:RT,s:RA,0,0,RA_OR_ZERO,0,0,RT,0,0,0
 lbz,2P,EXTRA3,d:RT,s:RA,0,0,RA_OR_ZERO,0,0,RT,0,0,0
 lhz,2P,EXTRA3,d:RT,s:RA,0,0,RA_OR_ZERO,0,0,RT,0,0,0
 lha,2P,EXTRA3,d:RT,s:RA,0,0,RA_OR_ZERO,0,0,RT,0,0,0
-lfs,2P,EXTRA3,d:RT,s:RA,0,0,RA_OR_ZERO,0,0,FRT,0,0,0
-lfd,2P,EXTRA3,d:RT,s:RA,0,0,RA_OR_ZERO,0,0,FRT,0,0,0
+lfs,2P,EXTRA3,d:FRT,s:RA,0,0,RA_OR_ZERO,0,0,FRT,0,0,0
+lfd,2P,EXTRA3,d:FRT,s:RA,0,0,RA_OR_ZERO,0,0,FRT,0,0,0
 ld,2P,EXTRA3,d:RT,s:RA,0,0,RA_OR_ZERO,0,0,RT,0,0,0
 lwa,2P,EXTRA3,d:RT,s:RA,0,0,RA_OR_ZERO,0,0,RT,0,0,0
index 4e2f359ecb15f829e0b8d47c5d0abffda4831842..43ef632735b22d2ba50f9ec01d97b4dffed82ad5 100644 (file)
@@ -3,6 +3,6 @@ lwzu,2P,EXTRA2,d:RT,d:RA,s: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cx,2P,EXTRA2,s:RS;d:CR0,s:RA,s:RB,0,RA_OR_ZERO,RB,RS,0,0,CR0,0
+stwcx,2P,EXTRA2,s:RSd:CR0,s:RA,s:RB,0,RA_OR_ZERO,RB,RS,0,0,CR0,0
+stdcx,2P,EXTRA2,s:RSd:CR0,s:RA,s:RB,0,RA_OR_ZERO,RB,RS,0,0,CR0,0
+stbcx,2P,EXTRA2,s:RSd:CR0,s:RA,s:RB,0,RA_OR_ZERO,RB,RS,0,0,CR0,0
+sthcx,2P,EXTRA2,s:RSd:CR0,s:RA,s:RB,0,RA_OR_ZERO,RB,RS,0,0,CR0,0
index 836b27c83ddc8a7312d00b4efc34571652815457..a55d6f0ddc86142e338340728862fd3641fc6e25 100644 (file)
@@ -372,53 +372,68 @@ def process_csvs():
                     else:
                         regs.append('')
 
+            # for LD/ST FP, use FRT/FRS not RT/RS, and use CR1 not CR0
+            if insn_name.startswith("lf"):
+                dRT = 'd:FRT'
+                dCR = 'd:CR1'
+            else:
+                dRT = 'd:RT'
+                dCR = 'd:CR0'
+            if insn_name.startswith("stf"):
+                sRS = 's:FRS'
+                dCR = 'd:CR1'
+            else:
+                sRS = 's:RS'
+                dCR = 'd:CR0'
+
             # sigh now the fun begins.  this isn't the sanest way to do it
             # but the patterns are pretty regular.
+
             if value == 'LDSTRM-2P-1S1D':
                 res['Etype'] = 'EXTRA3' # RM EXTRA3 type
-                res['0'] = 'd:RT' # RT: Rdest_EXTRA3
+                res['0'] = dRT    # RT: Rdest_EXTRA3
                 res['1'] = 's:RA' # RA: Rsrc1_EXTRA3
 
             elif value == 'LDSTRM-2P-1S2D':
                 res['Etype'] = 'EXTRA2' # RM EXTRA2 type
-                res['0'] = 'd:RT' # RT: Rdest1_EXTRA2
+                res['0'] = dRT    # RT: Rdest_EXTRA3
                 res['1'] = 'd:RA' # RA: Rdest2_EXTRA2
                 res['2'] = 's:RA' # RA: Rsrc1_EXTRA2
 
             elif value == 'LDSTRM-2P-2S':
                 # stw, std, sth, stb
                 res['Etype'] = 'EXTRA3' # RM EXTRA2 type
-                res['0'] = 's:RS' # RT: Rdest1_EXTRA2
+                res['0'] = sRS    # RS: Rdest1_EXTRA2
                 res['1'] = 's:RA' # RA: Rsrc1_EXTRA2
 
             elif value == 'LDSTRM-2P-2S1D':
                 if 'st' in insn_name and 'x' not in insn_name: # stwu/stbu etc
                     res['Etype'] = 'EXTRA2' # RM EXTRA2 type
                     res['0'] = 'd:RA' # RA: Rdest1_EXTRA2
-                    res['1'] = 's:RS' # RS: Rdsrc1_EXTRA2
+                    res['1'] = sRS    # RS: Rdsrc1_EXTRA2
                     res['2'] = 's:RA' # RA: Rsrc2_EXTRA2
                 elif 'st' in insn_name and 'x' in insn_name: # stwux
                     res['Etype'] = 'EXTRA2' # RM EXTRA2 type
                     res['0'] = 'd:RA' # RA: Rdest1_EXTRA2
-                    res['1'] = 's:RS;s:RA' # RS: Rdest2_EXTRA2, RA: Rsrc1_EXTRA2
+                    res['1'] = sRS+'s:RA' # RS: Rdest2_EXTRA2, RA: Rsrc1_EXTRA2
                     res['2'] = 's:RB' # RB: Rsrc2_EXTRA2
                 elif 'u' in insn_name: # ldux etc.
                     res['Etype'] = 'EXTRA2' # RM EXTRA2 type
-                    res['0'] = 'd:RT' # RT: Rdest1_EXTRA2
+                    res['0'] = dRT    # RT: Rdest1_EXTRA2
                     res['1'] = 'd:RA' # RA: Rdest2_EXTRA2
                     res['2'] = 's:RB' # RB: Rsrc1_EXTRA2
                 else:
                     res['Etype'] = 'EXTRA2' # RM EXTRA2 type
-                    res['0'] = 'd:RT' # RT: Rdest1_EXTRA2
+                    res['0'] = dRT     # RT: Rdest1_EXTRA2
                     res['1'] = 's:RA' # RA: Rsrc1_EXTRA2
                     res['2'] = 's:RB' # RB: Rsrc2_EXTRA2
 
             elif value == 'LDSTRM-2P-3S':
                 res['Etype'] = 'EXTRA2' # RM EXTRA2 type
                 if 'cx' in insn_name:
-                    res['0'] = 's:RS;d:CR0' # RS: Rsrc1_EXTRA2 CR0: dest
+                    res['0'] = sRS+dCR # RS: Rsrc1_EXTRA2 CR0: dest
                 else:
-                    res['0'] = 's:RS' # RS: Rsrc1_EXTRA2
+                    res['0'] = sRS # RS: Rsrc1_EXTRA2
                 res['1'] = 's:RA' # RA: Rsrc2_EXTRA2
                 res['2'] = 's:RB' # RA: Rsrc3_EXTRA2