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
deca5e5dae
commit
6dad779547
@ -93,7 +93,7 @@ FPT_TO FPConvert(FPT_FROM op, FPCR fpcr, RoundingMode rounding_mode, FPSR& fpsr)
|
||||
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);
|
||||
|
@ -69,6 +69,12 @@ FPT FPRound(FPUnpacked op, FPCR fpcr, RoundingMode rounding, FPSR& 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>
|
||||
FPT FPRound(FPUnpacked op, FPCR fpcr, FPSR& fpsr) {
|
||||
return FPRound<FPT>(op, fpcr, fpcr.RMode(), fpsr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user