mirror of
https://github.com/vosen/ZLUDA.git
synced 2025-08-01 05:48:37 +00:00
Apply rounding mode in fp div (#416)
This commit is contained in:
parent
95d66df18e
commit
36f0ba9cbb
1 changed files with 15 additions and 4 deletions
|
@ -1921,16 +1921,27 @@ fn get_modes<T: ast::Operand>(inst: &ast::Instruction<T>) -> InstructionModes {
|
|||
..
|
||||
}),
|
||||
..
|
||||
}
|
||||
| ast::Instruction::Div {
|
||||
} => InstructionModes::from_ftz(*type_, *flush_to_zero),
|
||||
ast::Instruction::Div {
|
||||
data:
|
||||
ast::DivDetails::Float(ast::DivFloatDetails {
|
||||
type_,
|
||||
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::Cos { data, .. }
|
||||
| ast::Instruction::Lg2 { data, .. } => InstructionModes::from_ftz_f32(data.flush_to_zero),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue