Skip to content

Commit

Permalink
Move definition of softfloat_roundPackToF32 before it is called.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shashank V M committed Nov 17, 2024
1 parent c550227 commit 7d65883
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions arch/isa/fp.idl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
}
}

0 comments on commit 7d65883

Please sign in to comment.