common/fp/unpacked: Adjust FPUnpack to operate like ARM pseudocode

This function is defined as always disabling the AHP bit in the fpcr
before performing any operations.

At the same time, rename the original FPUnpack function to FPUnpackBase
to match the pseudocode in the ARM reference manual.
This commit is contained in:
Lioncash
2019-03-09 00:08:08 -05:00
committed by MerryMage
parent 37c4c39d62
commit 8f9fe8690a
2 changed files with 10 additions and 4 deletions

View File

@@ -52,7 +52,13 @@ constexpr FPUnpacked ToNormalized(bool sign, int exponent, u64 value) {
}
template<typename FPT>
std::tuple<FPType, bool, FPUnpacked> FPUnpack(FPT op, FPCR fpcr, FPSR& fpsr);
std::tuple<FPType, bool, FPUnpacked> FPUnpackBase(FPT op, FPCR fpcr, FPSR& fpsr);
template<typename FPT>
std::tuple<FPType, bool, FPUnpacked> FPUnpack(FPT op, FPCR fpcr, FPSR& fpsr) {
fpcr.AHP(false);
return FPUnpackBase(op, fpcr, fpsr);
}
template<typename FPT>
std::tuple<FPType, bool, FPUnpacked> FPUnpackCV(FPT op, FPCR fpcr, FPSR& fpsr) {