mirror of
https://github.com/vosen/ZLUDA.git
synced 2025-07-20 18:56:24 +03:00
Apply rounding mode in fp div (#416)
This commit is contained in:
@ -1921,16 +1921,27 @@ fn get_modes<T: ast::Operand>(inst: &ast::Instruction<T>) -> InstructionModes {
|
|||||||
..
|
..
|
||||||
}),
|
}),
|
||||||
..
|
..
|
||||||
}
|
} => InstructionModes::from_ftz(*type_, *flush_to_zero),
|
||||||
| ast::Instruction::Div {
|
ast::Instruction::Div {
|
||||||
data:
|
data:
|
||||||
ast::DivDetails::Float(ast::DivFloatDetails {
|
ast::DivDetails::Float(ast::DivFloatDetails {
|
||||||
type_,
|
type_,
|
||||||
flush_to_zero,
|
flush_to_zero,
|
||||||
..
|
kind,
|
||||||
}),
|
}),
|
||||||
..
|
..
|
||||||
} => InstructionModes::from_ftz(*type_, *flush_to_zero),
|
} => {
|
||||||
|
let rounding = match kind {
|
||||||
|
ast::DivFloatKind::Rounding(rnd) => RoundingMode::from_ast(*rnd),
|
||||||
|
ast::DivFloatKind::Approx => RoundingMode::NearestEven,
|
||||||
|
ast::DivFloatKind::ApproxFull => RoundingMode::NearestEven,
|
||||||
|
};
|
||||||
|
InstructionModes::new(
|
||||||
|
*type_,
|
||||||
|
flush_to_zero.map(DenormalMode::from_ftz),
|
||||||
|
Some(rounding),
|
||||||
|
)
|
||||||
|
}
|
||||||
ast::Instruction::Sin { data, .. }
|
ast::Instruction::Sin { data, .. }
|
||||||
| ast::Instruction::Cos { data, .. }
|
| ast::Instruction::Cos { data, .. }
|
||||||
| ast::Instruction::Lg2 { data, .. } => InstructionModes::from_ftz_f32(data.flush_to_zero),
|
| ast::Instruction::Lg2 { data, .. } => InstructionModes::from_ftz_f32(data.flush_to_zero),
|
||||||
|
Reference in New Issue
Block a user