replace DOUBLE function from helpers.py with pseudocode variant
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 31 Jul 2021 18:48:46 +0000 (19:48 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 31 Jul 2021 18:48:46 +0000 (19:48 +0100)
openpower/isafunctions/double2single.mdwn
src/openpower/decoder/pseudo/pywriter.py

index 28e48e2953932884b6567aeb750cad74fde3c638..b731cc04b39ccea3447e6fb6696c84ca84002e1b 100644 (file)
@@ -141,10 +141,11 @@ Round to Single-Precision instruction.
 
 <!-- Power ISA v3.0B p140 section 4.6.2 -->
 
-    def SINGLE(WORD):
+    def DOUBLE(WORD):
         exp <- [0] * 11
         frac <- [0] * 53
         sign <- 0b0
+        FRT <- [0] * 64
         # Normalized Operand
         if (WORD[1:8] >u 0) & (WORD[1:8] <u 255) then
             FRT[0:1] <- WORD[0:1]
@@ -171,3 +172,4 @@ Round to Single-Precision instruction.
             FRT[3] <- WORD[1]
             FRT[4] <- WORD[1]
             FRT[5:63] <- WORD[2:31] || [0]*29
+        return FRT
index aa043fd467c4027a2cdcfbc236c34b284b253583..4776ebb400a5129a512f0fba3fa0c07edd57d568 100644 (file)
@@ -35,13 +35,14 @@ from openpower.decoder.orderedset import OrderedSet
 
 fpheader = """
 from openpower.decoder.helpers import (
-                                 DOUBLE, SINGLE,
+                                 SINGLE,
                                  FPADD32, FPSUB32, FPMUL32, FPDIV32,
                                  FPADD64, FPSUB64, FPMUL64, FPDIV64,
                                  FPMULADD32,
                                  FPSIN32, FPCOS32,
                                 )
 from openpower.decoder.isafunctions.fpfromint import INT2FP
+from openpower.decoder.isafunctions.double2single import DOUBLE
 
 
 """