File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -549,6 +549,24 @@ impl<'a> FunctionTranslator<'a> {
549549 todo ! ( )
550550 }
551551 }
552+ Binop :: Less => {
553+ let lhs = self . translate_expr ( lhs_id, decl, decls) ;
554+ let rhs = self . translate_expr ( rhs_id, decl, decls) ;
555+ let t = decl. types [ lhs_id] ;
556+
557+ match * t {
558+ crate :: types:: Type :: Int32 | crate :: types:: Type :: Int8 => {
559+ self . builder . ins ( ) . icmp ( IntCC :: SignedLessThan , lhs, rhs)
560+ }
561+ crate :: types:: Type :: UInt32 | crate :: types:: Type :: UInt8 => {
562+ self . builder . ins ( ) . icmp ( IntCC :: UnsignedLessThan , lhs, rhs)
563+ }
564+ crate :: types:: Type :: Float32 | crate :: types:: Type :: Float64 => {
565+ self . builder . ins ( ) . fcmp ( FloatCC :: LessThan , lhs, rhs)
566+ }
567+ _ => todo ! ( ) ,
568+ }
569+ }
552570 Binop :: And => {
553571 let lhs = self . translate_expr ( lhs_id, decl, decls) ;
554572 let rhs = self . translate_expr ( rhs_id, decl, decls) ;
Original file line number Diff line number Diff line change 99 assert(1 == 1)
1010 assert(2 != 1)
1111 assert(1 != 2)
12+ assert(1 < 2)
1213 //assert(1 <= 1)
1314 //assert(1 <= 2)
1415 //assert(1 >= 1)
You can’t perform that action at this time.
0 commit comments