@@ -449,27 +449,33 @@ impl<'a, 'b> FunctionCompiler<'a, 'b> {
449
449
}
450
450
451
451
// Floats and Integers
452
- ( _, JitValue :: Int ( a) , JitValue :: Float ( b) ) |
453
- ( _, JitValue :: Float ( a) , JitValue :: Int ( b) ) =>{
454
-
452
+ ( _, JitValue :: Int ( a) , JitValue :: Float ( b) )
453
+ | ( _, JitValue :: Float ( a) , JitValue :: Int ( b) ) => {
455
454
let operand_one = match a_type. unwrap ( ) {
456
455
JitType :: Int => self . builder . ins ( ) . fcvt_from_sint ( types:: F64 , a) ,
457
- _=> a
456
+ _ => a,
458
457
} ;
459
458
460
459
let operand_two = match b_type. unwrap ( ) {
461
460
JitType :: Int => self . builder . ins ( ) . fcvt_from_sint ( types:: F64 , b) ,
462
- _=> b
461
+ _ => b,
463
462
} ;
464
463
465
- match op{
466
- BinaryOperator :: Add => JitValue :: Float ( self . builder . ins ( ) . fadd ( operand_one, operand_two) ) ,
467
- BinaryOperator :: Subtract => JitValue :: Float ( self . builder . ins ( ) . fsub ( operand_one, operand_two) ) ,
468
- BinaryOperator :: Multiply => JitValue :: Float ( self . builder . ins ( ) . fmul ( operand_one, operand_two) ) ,
469
- BinaryOperator :: Divide => JitValue :: Float ( self . builder . ins ( ) . fdiv ( operand_one, operand_two) ) ,
470
- _ => return Err ( JitCompileError :: NotSupported )
464
+ match op {
465
+ BinaryOperator :: Add => {
466
+ JitValue :: Float ( self . builder . ins ( ) . fadd ( operand_one, operand_two) )
467
+ }
468
+ BinaryOperator :: Subtract => {
469
+ JitValue :: Float ( self . builder . ins ( ) . fsub ( operand_one, operand_two) )
470
+ }
471
+ BinaryOperator :: Multiply => {
472
+ JitValue :: Float ( self . builder . ins ( ) . fmul ( operand_one, operand_two) )
473
+ }
474
+ BinaryOperator :: Divide => {
475
+ JitValue :: Float ( self . builder . ins ( ) . fdiv ( operand_one, operand_two) )
476
+ }
477
+ _ => return Err ( JitCompileError :: NotSupported ) ,
471
478
}
472
-
473
479
}
474
480
_ => return Err ( JitCompileError :: NotSupported ) ,
475
481
} ;
0 commit comments