reorder arguments to FPMULADD32 to match pseudocode
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 16 Jun 2021 16:20:51 +0000 (17:20 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 16 Jun 2021 16:20:51 +0000 (17:20 +0100)
src/openpower/decoder/helpers.py

index 7188f6cc74356b2e46e6f9a4d117ee710e3d33d4..8b849fb89588391e75d626df376be821bc85c4ea 100644 (file)
@@ -289,21 +289,21 @@ def FPMUL32(FRA, FRB):
     return cvt
 
 
-def FPMULADD32(FRA, FRB, FRC, addsign, mulsign):
+def FPMULADD32(FRA, FRC, FRB, addsign, mulsign):
     from openpower.decoder.isafunctions.double2single import DOUBLE2SINGLE
     #return FPMUL64(FRA, FRB)
     #FRA = DOUBLE(SINGLE(FRA))
     #FRB = DOUBLE(SINGLE(FRB))
     if addsign == 1:
-        result = float(FRC)
+        result = float(FRB)
     elif addsign == -1:
-        result = -float(FRC)
+        result = -float(FRB)
     elif addsign == 0:
         result = 0.0
     if mulsign == 1:
-        result += float(FRA) * float(FRB)
+        result += float(FRA) * float(FRC)
     elif mulsign == -1:
-        result -= float(FRA) * float(FRB)
+        result -= float(FRA) * float(FRC)
     log ("FPMULADD32", FRA, FRB, FRC,
                        float(FRA), float(FRB), float(FRC),
                        result)