@@ -272,12 +272,14 @@ where
272
272
ExternPtr ( Operation < ' func , M , F , operation:: Extern > ) ,
273
273
274
274
RegStackPop ( Operation < ' func , M , F , operation:: RegStackPop > ) ,
275
+ RegStackFreeReg ( Operation < ' func , M , F , operation:: RegStackPop > ) ,
275
276
276
277
CallOutputSsa ( Operation < ' func , M , F , operation:: CallOutputSsa > ) ,
277
278
CallParamSsa ( Operation < ' func , M , F , operation:: CallParamSsa > ) ,
278
279
CallStackSsa ( Operation < ' func , M , F , operation:: CallStackSsa > ) ,
279
280
280
281
Add ( Operation < ' func , M , F , operation:: BinaryOp > ) ,
282
+ AddOverflow ( Operation < ' func , M , F , operation:: BinaryOp > ) ,
281
283
Adc ( Operation < ' func , M , F , operation:: BinaryOpCarry > ) ,
282
284
Sub ( Operation < ' func , M , F , operation:: BinaryOp > ) ,
283
285
Sbb ( Operation < ' func , M , F , operation:: BinaryOpCarry > ) ,
@@ -330,7 +332,7 @@ where
330
332
CmpSgt ( Operation < ' func , M , F , operation:: Condition > ) ,
331
333
CmpUgt ( Operation < ' func , M , F , operation:: Condition > ) ,
332
334
333
- // TestBit(Operation<'func, M, F, operation::TestBit >), // TODO
335
+ TestBit ( Operation < ' func , M , F , operation:: BinaryOp > ) ,
334
336
BoolToInt ( Operation < ' func , M , F , operation:: UnaryOp > ) ,
335
337
336
338
Fadd ( Operation < ' func , M , F , operation:: BinaryOp > ) ,
@@ -361,7 +363,6 @@ where
361
363
362
364
SeparateParamListSsa ( Operation < ' func , M , F , operation:: SeparateParamListSsa > ) ,
363
365
364
- // TODO ADD_OVERFLOW
365
366
Unimpl ( Operation < ' func , M , F , operation:: NoArgs > ) ,
366
367
UnimplMem ( Operation < ' func , M , F , operation:: UnimplMem > ) ,
367
368
@@ -418,6 +419,9 @@ where
418
419
LLIL_REG_STACK_POP => {
419
420
LowLevelILExpressionKind :: RegStackPop ( Operation :: new ( function, op, index) )
420
421
}
422
+ LLIL_REG_STACK_FREE_REG => {
423
+ LowLevelILExpressionKind :: RegStackFreeReg ( Operation :: new ( function, op, index) )
424
+ }
421
425
422
426
LLIL_CALL_OUTPUT_SSA => {
423
427
LowLevelILExpressionKind :: CallOutputSsa ( Operation :: new ( function, op, index) )
@@ -430,6 +434,9 @@ where
430
434
}
431
435
432
436
LLIL_ADD => LowLevelILExpressionKind :: Add ( Operation :: new ( function, op, index) ) ,
437
+ LLIL_ADD_OVERFLOW => {
438
+ LowLevelILExpressionKind :: AddOverflow ( Operation :: new ( function, op, index) )
439
+ }
433
440
LLIL_ADC => LowLevelILExpressionKind :: Adc ( Operation :: new ( function, op, index) ) ,
434
441
LLIL_SUB => LowLevelILExpressionKind :: Sub ( Operation :: new ( function, op, index) ) ,
435
442
LLIL_SBB => LowLevelILExpressionKind :: Sbb ( Operation :: new ( function, op, index) ) ,
@@ -478,6 +485,7 @@ where
478
485
LLIL_CMP_SGT => LowLevelILExpressionKind :: CmpSgt ( Operation :: new ( function, op, index) ) ,
479
486
LLIL_CMP_UGT => LowLevelILExpressionKind :: CmpUgt ( Operation :: new ( function, op, index) ) ,
480
487
488
+ LLIL_TEST_BIT => LowLevelILExpressionKind :: TestBit ( Operation :: new ( function, op, index) ) ,
481
489
LLIL_BOOL_TO_INT => {
482
490
LowLevelILExpressionKind :: BoolToInt ( Operation :: new ( function, op, index) )
483
491
}
@@ -530,9 +538,9 @@ where
530
538
LowLevelILExpressionKind :: UnimplMem ( Operation :: new ( function, op, index) )
531
539
}
532
540
533
- // TODO TEST_BIT ADD_OVERFLOW LLIL_REG_STACK_PUSH
541
+ // TODO: LLIL_REG_STACK_PUSH
534
542
_ => {
535
- #[ cfg( debug_assertions) ]
543
+ // #[cfg(debug_assertions)]
536
544
log:: error!(
537
545
"Got unexpected operation {:?} in value expr at 0x{:x}" ,
538
546
op. operation,
@@ -663,10 +671,11 @@ where
663
671
visit ! ( op. right( ) ) ;
664
672
visit ! ( op. carry( ) ) ;
665
673
}
666
- Add ( ref op) | Sub ( ref op) | And ( ref op) | Or ( ref op) | Xor ( ref op) | Lsl ( ref op)
667
- | Lsr ( ref op) | Asr ( ref op) | Rol ( ref op) | Ror ( ref op) | Mul ( ref op)
668
- | MulsDp ( ref op) | MuluDp ( ref op) | Divu ( ref op) | Divs ( ref op) | Modu ( ref op)
669
- | Mods ( ref op) | Fadd ( ref op) | Fsub ( ref op) | Fmul ( ref op) | Fdiv ( ref op) => {
674
+ Add ( ref op) | AddOverflow ( ref op) | Sub ( ref op) | And ( ref op) | Or ( ref op)
675
+ | Xor ( ref op) | Lsl ( ref op) | Lsr ( ref op) | Asr ( ref op) | Rol ( ref op) | Ror ( ref op)
676
+ | Mul ( ref op) | MulsDp ( ref op) | MuluDp ( ref op) | Divu ( ref op) | Divs ( ref op)
677
+ | Modu ( ref op) | Mods ( ref op) | Fadd ( ref op) | Fsub ( ref op) | Fmul ( ref op)
678
+ | Fdiv ( ref op) | TestBit ( ref op) => {
670
679
visit ! ( op. left( ) ) ;
671
680
visit ! ( op. right( ) ) ;
672
681
}
@@ -703,8 +712,8 @@ where
703
712
// Do not have any sub expressions.
704
713
Pop ( _) | Reg ( _) | RegSsa ( _) | RegPartialSsa ( _) | RegSplit ( _) | RegSplitSsa ( _)
705
714
| Const ( _) | ConstPtr ( _) | Flag ( _) | FlagBit ( _) | ExternPtr ( _) | FlagCond ( _)
706
- | FlagGroup ( _) | Unimpl ( _) | Undef ( _) | RegStackPop ( _) | CallOutputSsa ( _)
707
- | CallStackSsa ( _) | FloatConst ( _) => { }
715
+ | FlagGroup ( _) | Unimpl ( _) | Undef ( _) | RegStackPop ( _) | RegStackFreeReg ( _)
716
+ | CallOutputSsa ( _ ) | CallStackSsa ( _) | FloatConst ( _) => { }
708
717
}
709
718
710
719
VisitorAction :: Sibling
@@ -753,17 +762,19 @@ where
753
762
ExternPtr ( ref op) => & op. op ,
754
763
755
764
RegStackPop ( ref op) => & op. op ,
765
+ RegStackFreeReg ( ref op) => & op. op ,
756
766
757
767
CallOutputSsa ( ref op) => & op. op ,
758
768
CallParamSsa ( ref op) => & op. op ,
759
769
CallStackSsa ( ref op) => & op. op ,
760
770
761
771
Adc ( ref op) | Sbb ( ref op) | Rlc ( ref op) | Rrc ( ref op) => & op. op ,
762
772
763
- Add ( ref op) | Sub ( ref op) | And ( ref op) | Or ( ref op) | Xor ( ref op) | Lsl ( ref op)
764
- | Lsr ( ref op) | Asr ( ref op) | Rol ( ref op) | Ror ( ref op) | Mul ( ref op)
765
- | MulsDp ( ref op) | MuluDp ( ref op) | Divu ( ref op) | Divs ( ref op) | Modu ( ref op)
766
- | Mods ( ref op) | Fadd ( ref op) | Fsub ( ref op) | Fmul ( ref op) | Fdiv ( ref op) => & op. op ,
773
+ Add ( ref op) | AddOverflow ( ref op) | Sub ( ref op) | And ( ref op) | Or ( ref op)
774
+ | Xor ( ref op) | Lsl ( ref op) | Lsr ( ref op) | Asr ( ref op) | Rol ( ref op) | Ror ( ref op)
775
+ | Mul ( ref op) | MulsDp ( ref op) | MuluDp ( ref op) | Divu ( ref op) | Divs ( ref op)
776
+ | Modu ( ref op) | Mods ( ref op) | Fadd ( ref op) | Fsub ( ref op) | Fmul ( ref op)
777
+ | Fdiv ( ref op) | TestBit ( ref op) => & op. op ,
767
778
768
779
DivuDp ( ref op) | DivsDp ( ref op) | ModuDp ( ref op) | ModsDp ( ref op) => & op. op ,
769
780
@@ -775,7 +786,6 @@ where
775
786
SeparateParamListSsa ( ref op) => & op. op ,
776
787
777
788
UnimplMem ( ref op) => & op. op ,
778
- //TestBit(Operation<'func, M, F, operation::TestBit>), // TODO
779
789
}
780
790
}
781
791
}
@@ -825,19 +835,19 @@ impl LowLevelILExpressionKind<'_, Mutable, NonSSA> {
825
835
ExternPtr ( ref op) => op. flag_write ( ) ,
826
836
827
837
RegStackPop ( ref op) => op. flag_write ( ) ,
838
+ RegStackFreeReg ( ref op) => op. flag_write ( ) ,
828
839
829
840
CallOutputSsa ( ref op) => op. flag_write ( ) ,
830
841
CallParamSsa ( ref op) => op. flag_write ( ) ,
831
842
CallStackSsa ( ref op) => op. flag_write ( ) ,
832
843
833
844
Adc ( ref op) | Sbb ( ref op) | Rlc ( ref op) | Rrc ( ref op) => op. flag_write ( ) ,
834
845
835
- Add ( ref op) | Sub ( ref op) | And ( ref op) | Or ( ref op) | Xor ( ref op) | Lsl ( ref op)
836
- | Lsr ( ref op) | Asr ( ref op) | Rol ( ref op) | Ror ( ref op) | Mul ( ref op)
837
- | MulsDp ( ref op) | MuluDp ( ref op) | Divu ( ref op) | Divs ( ref op) | Modu ( ref op)
838
- | Mods ( ref op) | Fadd ( ref op) | Fsub ( ref op) | Fmul ( ref op) | Fdiv ( ref op) => {
839
- op. flag_write ( )
840
- }
846
+ Add ( ref op) | AddOverflow ( ref op) | Sub ( ref op) | And ( ref op) | Or ( ref op)
847
+ | Xor ( ref op) | Lsl ( ref op) | Lsr ( ref op) | Asr ( ref op) | Rol ( ref op) | Ror ( ref op)
848
+ | Mul ( ref op) | MulsDp ( ref op) | MuluDp ( ref op) | Divu ( ref op) | Divs ( ref op)
849
+ | Modu ( ref op) | Mods ( ref op) | Fadd ( ref op) | Fsub ( ref op) | Fmul ( ref op)
850
+ | Fdiv ( ref op) | TestBit ( ref op) => op. flag_write ( ) ,
841
851
842
852
DivuDp ( ref op) | DivsDp ( ref op) | ModuDp ( ref op) | ModsDp ( ref op) => op. flag_write ( ) ,
843
853
@@ -849,7 +859,6 @@ impl LowLevelILExpressionKind<'_, Mutable, NonSSA> {
849
859
SeparateParamListSsa ( ref op) => op. flag_write ( ) ,
850
860
851
861
UnimplMem ( ref op) => op. flag_write ( ) ,
852
- //TestBit(Operation<'func, M, F, operation::TestBit>), // TODO
853
862
}
854
863
}
855
864
}
0 commit comments