Skip to content

Commit 83a1a73

Browse files
committed
cleanup
1 parent 7e25347 commit 83a1a73

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/jit.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -526,12 +526,15 @@ impl<'a> FunctionTranslator<'a> {
526526
let lhs = self.translate_expr(lhs_id, decl, decls);
527527
let rhs = self.translate_expr(rhs_id, decl, decls);
528528
let t = decl.types[lhs_id];
529-
if *t == crate::types::Type::Int32 || *t == crate::types::Type::Bool {
530-
self.builder.ins().icmp(IntCC::Equal, lhs, rhs)
531-
} else if *t == crate::types::Type::Float32 {
532-
self.builder.ins().fcmp(FloatCC::Equal, lhs, rhs)
533-
} else {
534-
todo!()
529+
530+
match *t {
531+
crate::types::Type::Bool | crate::types::Type::Int32 | crate::types::Type::UInt32 | crate::types::Type::Int8 | crate::types::Type::UInt8 => {
532+
self.builder.ins().icmp(IntCC::Equal, lhs, rhs)
533+
}
534+
crate::types::Type::Float32 | crate::types::Type::Float64 => {
535+
self.builder.ins().fcmp(FloatCC::Equal, lhs, rhs)
536+
}
537+
_ => todo!(),
535538
}
536539
}
537540
Binop::NotEqual => {

0 commit comments

Comments
 (0)