add ffadds decoding:
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 10 Jul 2021 11:11:19 +0000 (12:11 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 10 Jul 2021 11:11:19 +0000 (12:11 +0100)
- SVP64 trans manual creation of opcode with XO=0b01101
- add to power enums ISA list
- add to minor 59 and SVP64 CSV

openpower/isatables/RM-1P-2S1D.csv
openpower/isatables/minor_59.csv
src/openpower/decoder/power_enums.py
src/openpower/sv/trans/svp64.py

index 93ebb9ea517c9162d9e7cd112e326ae612bc786e..19b6f61ec6f26ad95aba0c73468cf8a2f5865c58 100644 (file)
@@ -79,6 +79,7 @@ divduo,,1P,EXTRA3,d:RT;d:CR0,s:RA,s:RB,0,RA,RB,0,RT,0,CR0,0
 divwuo,,1P,EXTRA3,d:RT;d:CR0,s:RA,s:RB,0,RA,RB,0,RT,0,CR0,0
 divdo,,1P,EXTRA3,d:RT;d:CR0,s:RA,s:RB,0,RA,RB,0,RT,0,CR0,0
 divwo,,1P,EXTRA3,d:RT;d:CR0,s:RA,s:RB,0,RA,RB,0,RT,0,CR0,0
+ffadds,,1P,EXTRA3,d:FRT;d:CR1,s:FRA,s:FRB,0,FRA,FRB,0,FRT,0,CR1,0
 fdivs,,1P,EXTRA3,d:FRT;d:CR1,s:FRA,s:FRB,0,FRA,FRB,0,FRT,0,CR1,0
 fsubs,,1P,EXTRA3,d:FRT;d:CR1,s:FRA,s:FRB,0,FRA,FRB,0,FRT,0,CR1,0
 fadds,,1P,EXTRA3,d:FRT;d:CR1,s:FRA,s:FRB,0,FRA,FRB,0,FRT,0,CR1,0
index 0891f0a33b7ef62476c8f10911d97c46013ef574..1605a58d4dfbab13cf25fd6fe2225bced0f76840 100644 (file)
@@ -16,3 +16,4 @@ opcode,unit,internal op,in1,in2,in3,out,CR in,CR out,inv A,inv out,cry in,cry ou
 -----00101,FPU,OP_FP_MADD,FRA,FRB,FRC,FRT,NONE,CR1,0,0,ZERO,0,NONE,0,0,0,0,1,0,RC,0,0,ffmadds,A,
 -----00110,FPU,OP_FP_MADD,FRA,FRB,FRC,FRT,NONE,CR1,0,0,ZERO,0,NONE,0,0,0,0,1,0,RC,0,0,ffnmsubs,A,
 -----00111,FPU,OP_FP_MADD,FRA,FRB,FRC,FRT,NONE,CR1,0,0,ZERO,0,NONE,0,0,0,0,1,0,RC,0,0,ffnmadds,A,
+-----01101,FPU,OP_FPOP,FRA,FRB,NONE,FRT,NONE,CR1,0,0,ZERO,0,NONE,0,0,0,0,1,0,RC,0,0,ffadds,A,
index 41d712e273b886a1e4e6fc148bc5b7420da8b3d9..48e437ba88d0fce30d2c4365eeeddb09ae48b5a5 100644 (file)
@@ -242,6 +242,7 @@ _insns = [
     "fadd", "fadds", "fsub", "fsubs",                   # FP add / sub
     "fcfids", "fcfidus", "fsqrts", "fres", "frsqrtes",  # FP stuff
     "fmsubs", "fmadds", "fnmsubs", "fnmadds",           # FP 3-arg
+    "ffadds", "ffsubs", "ffmuls", "ffdivs",             # FFT FP 2-arg
     "ffmsubs", "ffmadds", "ffnmsubs", "ffnmadds",       # FFT FP 3-arg
     "fmul", "fmuls", "fdiv", "fdivs",                   # FP mul / div
     "fmr", "fabs", "fnabs", "fneg", "fcpsgn",           # FP move/abs/neg
index 1c12ea7f1a919a414d72bc09c16f021050e7f269..f3b13879bd3571abf7adba15850c0ece3a78ba11 100644 (file)
@@ -813,7 +813,17 @@ class SVP64Asm:
             opcode |= int(v30b_newfields[1]) << (32-16) # FRA
             opcode |= int(v30b_newfields[2]) << (32-21) # FRB
             opcode |= int(v30b_newfields[3]) << (32-26) # FRC
-            opcode |= 5 << (32-31)   # bits 26-30
+            opcode |= 0b00101 << (32-31)   # bits 26-30
+            if rc:
+                opcode |= 1  # Rc, bit 31.
+            yield ".long 0x%x" % opcode
+        # argh, sv.ffadds etc. need to be done manually
+        if v30b_op == 'ffadds':
+            opcode = 59 << (32-6)    # bits 0..6 (MSB0)
+            opcode |= int(v30b_newfields[0]) << (32-11) # FRT
+            opcode |= int(v30b_newfields[1]) << (32-16) # FRA
+            opcode |= int(v30b_newfields[2]) << (32-21) # FRB
+            opcode |= 0b01101 << (32-31)   # bits 26-30
             if rc:
                 opcode |= 1  # Rc, bit 31.
             yield ".long 0x%x" % opcode
@@ -973,6 +983,7 @@ if __name__ == '__main__':
     lst = [
              'sv.fmadds 0.v, 8.v, 16.v, 4.v',
              'svremap 8, 1, 1, 1',
+             'sv.fadds 0.v, 8.v, 4.v',
             ]
     isa = SVP64Asm(lst, macros=macros)
     print ("list", list(isa))