diff --git a/lang/src/backend/hbvm.rs b/lang/src/backend/hbvm.rs index 61982d6b..27734b49 100644 --- a/lang/src/backend/hbvm.rs +++ b/lang/src/backend/hbvm.rs @@ -414,11 +414,9 @@ impl Nodes { && op.cond_op(self[o].ty).is_none()) }), Kind::BinOp { op: TokenKind::Mul } if node.ty.is_float() => { - false - && node.outputs.iter().all(|&n| { - self[n].kind == Kind::BinOp { op: TokenKind::Add } - && self[n].inputs[1] == nid - }) + node.outputs.iter().all(|&n| { + self[n].kind == Kind::BinOp { op: TokenKind::Add } && self[n].inputs[1] == nid + }) } Kind::BinOp { op: TokenKind::Add | TokenKind::Sub } => { (self.is_locked(node.inputs[1]) && !self[node.inputs[1]].ty.is_float()) @@ -624,7 +622,7 @@ impl TokenKind { (dst.simple_size(), src.simple_size()), (Some(4 | 8), Some(8)) ); - [instrs::itf32, instrs::itf64][src_idx - 2] + [instrs::itf32, instrs::itf64][dst.simple_size().unwrap().ilog2() as usize - 2] } Self::Number if src.is_float() && dst.is_integer() => { [|a, b| instrs::fti32(a, b, 1), |a, b| instrs::fti64(a, b, 1)][src_idx - 2]