diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2018-02-26 15:56:34 -0300 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-02-26 15:56:34 -0300 |
| commit | 708761963e09ceb4619f8f21fffc7af051a8f020 (patch) | |
| tree | 211616cfaae24ce4ed68fccb5bd6a88aca059ce4 /ChocolArm64/Instruction/AInstEmitAluHelper.cs | |
| parent | f6dc86c6a097f305701af32e77a2d8995a4385cc (diff) | |
Fix corner cases of ADCS and SBFM
Diffstat (limited to 'ChocolArm64/Instruction/AInstEmitAluHelper.cs')
| -rw-r--r-- | ChocolArm64/Instruction/AInstEmitAluHelper.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ChocolArm64/Instruction/AInstEmitAluHelper.cs b/ChocolArm64/Instruction/AInstEmitAluHelper.cs index b2ea92a6..ef9dd7a7 100644 --- a/ChocolArm64/Instruction/AInstEmitAluHelper.cs +++ b/ChocolArm64/Instruction/AInstEmitAluHelper.cs @@ -7,6 +7,31 @@ namespace ChocolArm64.Instruction { static class AInstEmitAluHelper { + public static void EmitAdcsCCheck(AILEmitterCtx Context) + { + //C = (Rd == Rn && CIn) || Rd < Rn + Context.EmitSttmp(); + Context.EmitLdtmp(); + Context.EmitLdtmp(); + + EmitDataLoadRn(Context); + + Context.Emit(OpCodes.Ceq); + + Context.EmitLdflg((int)APState.CBit); + + Context.Emit(OpCodes.And); + + Context.EmitLdtmp(); + + EmitDataLoadRn(Context); + + Context.Emit(OpCodes.Clt_Un); + Context.Emit(OpCodes.Or); + + Context.EmitStflg((int)APState.CBit); + } + public static void EmitAddsCCheck(AILEmitterCtx Context) { //C = Rd < Rn |
