common/fp/unpacked: Add FPRoundCV
Corresponds to the equivalent pseudocode within the ARMv8 reference manual. This will be necessary for supporting half-precision floating-point. This also makes use of it within FPConvert
This commit is contained in:
parent
490bebbd9a
commit
99c494bae9
2 changed files with 7 additions and 1 deletions
|
@ -93,7 +93,7 @@ FPT_TO FPConvert(FPT_FROM op, FPCR fpcr, RoundingMode rounding_mode, FPSR& fpsr)
|
||||||
return FPInfo<FPT_TO>::Zero(sign);
|
return FPInfo<FPT_TO>::Zero(sign);
|
||||||
}
|
}
|
||||||
|
|
||||||
return FPRoundBase<FPT_TO>(value, fpcr, rounding_mode, fpsr);
|
return FPRoundCV<FPT_TO>(value, fpcr, rounding_mode, fpsr);
|
||||||
}
|
}
|
||||||
|
|
||||||
template u64 FPConvert<u64, u32>(u32 op, FPCR fpcr, RoundingMode rounding_mode, FPSR& fpsr);
|
template u64 FPConvert<u64, u32>(u32 op, FPCR fpcr, RoundingMode rounding_mode, FPSR& fpsr);
|
||||||
|
|
|
@ -69,6 +69,12 @@ FPT FPRound(FPUnpacked op, FPCR fpcr, RoundingMode rounding, FPSR& fpsr) {
|
||||||
return FPRoundBase<FPT>(op, fpcr, rounding, fpsr);
|
return FPRoundBase<FPT>(op, fpcr, rounding, fpsr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename FPT>
|
||||||
|
FPT FPRoundCV(FPUnpacked op, FPCR fpcr, RoundingMode rounding, FPSR& fpsr) {
|
||||||
|
fpcr.FZ16(false);
|
||||||
|
return FPRoundBase<FPT>(op, fpcr, rounding, fpsr);
|
||||||
|
}
|
||||||
|
|
||||||
template<typename FPT>
|
template<typename FPT>
|
||||||
FPT FPRound(FPUnpacked op, FPCR fpcr, FPSR& fpsr) {
|
FPT FPRound(FPUnpacked op, FPCR fpcr, FPSR& fpsr) {
|
||||||
return FPRound<FPT>(op, fpcr, fpcr.RMode(), fpsr);
|
return FPRound<FPT>(op, fpcr, fpcr.RMode(), fpsr);
|
||||||
|
|
Loading…
Reference in a new issue