From 7d65883136b2d82b4582bdddc51747919a6eaac0 Mon Sep 17 00:00:00 2001 From: Shashank V M Date: Sat, 16 Nov 2024 22:24:21 -0800 Subject: [PATCH] Move definition of softfloat_roundPackToF32 before it is called. --- arch/isa/fp.idl | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/arch/isa/fp.idl b/arch/isa/fp.idl index 6ddb70dd6..fcaeb70d2 100644 --- a/arch/isa/fp.idl +++ b/arch/isa/fp.idl @@ -416,27 +416,6 @@ function softfloat_normSubnormalF16Sig { } } -function softfloat_normRoundPackToF32 { - returns Bits<32> - arguments - Bits<1> sign, - Bits<8> exp, - Bits<23> sig, - RoundingMode mode - description { - Normalize, round, and pack into a 32-bit floating point value - } - body { - Bits<8> shiftDist = count_leading_zeros<32>(sig) - 1; - exp = exp - shiftDist; - if ((7 <= shiftDist) && (exp < 0xFD)) { - return packToF32UI(sign, (sig != 0) ? exp : 0, sig << (shiftDist - 7)); - } else { - return softfloat_roundPackToF32(sign, exp, sig << shiftDist, mode); - } - } -} - function softfloat_roundPackToF32 { returns Bits<32> # single precision value arguments @@ -485,3 +464,24 @@ function softfloat_roundPackToF32 { return packToF32UI(sign, exp, sig); } } + +function softfloat_normRoundPackToF32 { + returns Bits<32> + arguments + Bits<1> sign, + Bits<8> exp, + Bits<23> sig, + RoundingMode mode + description { + Normalize, round, and pack into a 32-bit floating point value + } + body { + Bits<8> shiftDist = count_leading_zeros<32>(sig) - 1; + exp = exp - shiftDist; + if ((7 <= shiftDist) && (exp < 0xFD)) { + return packToF32UI(sign, (sig != 0) ? exp : 0, sig << (shiftDist - 7)); + } else { + return softfloat_roundPackToF32(sign, exp, sig << shiftDist, mode); + } + } +} \ No newline at end of file