diff options
Diffstat (limited to 'lang')
| -rw-r--r-- | lang/c/pseudoc.cpp | 25 | ||||
| -rw-r--r-- | lang/rust/pseudorust.cpp | 26 |
2 files changed, 51 insertions, 0 deletions
diff --git a/lang/c/pseudoc.cpp b/lang/c/pseudoc.cpp index dc37100e..81401b55 100644 --- a/lang/c/pseudoc.cpp +++ b/lang/c/pseudoc.cpp @@ -2490,6 +2490,31 @@ void PseudoCFunction::GetExprTextInternal(const HighLevelILInstruction& instr, H }(); break; + case HLIL_MINS: + case HLIL_MINU: + AppendTwoOperandFunction("min", instr, tokens, settings, false); + if (statement) + tokens.AppendSemicolon(); + break; + + case HLIL_MAXS: + case HLIL_MAXU: + AppendTwoOperandFunction("max", instr, tokens, settings, false); + if (statement) + tokens.AppendSemicolon(); + break; + + case HLIL_ABS: + [&]() { + tokens.Append(OperationToken, "abs"); + tokens.AppendOpenParen(); + GetExprTextInternal(instr.GetSourceExpr<HLIL_ABS>(), tokens, settings); + tokens.AppendCloseParen(); + if (statement) + tokens.AppendSemicolon(); + }(); + break; + case HLIL_FLOAT_CONV: [&]() { const auto srcExpr = instr.GetSourceExpr<HLIL_FLOAT_CONV>(); diff --git a/lang/rust/pseudorust.cpp b/lang/rust/pseudorust.cpp index de1acae1..7c831e47 100644 --- a/lang/rust/pseudorust.cpp +++ b/lang/rust/pseudorust.cpp @@ -2434,6 +2434,7 @@ void PseudoRustFunction::GetExprText(const HighLevelILInstruction& instr, HighLe case HLIL_CTZ: case HLIL_RBIT: case HLIL_CLS: + case HLIL_ABS: [&]() { const char* method; switch (instr.operation) @@ -2443,6 +2444,7 @@ void PseudoRustFunction::GetExprText(const HighLevelILInstruction& instr, HighLe case HLIL_CLZ: method = "leading_zeros"; break; case HLIL_CTZ: method = "trailing_zeros"; break; case HLIL_RBIT: method = "reverse_bits"; break; + case HLIL_ABS: method = "abs"; break; default: method = "leading_sign_bits"; break; } GetExprText(instr.GetSourceExpr(), tokens, settings, MemberAndFunctionOperatorPrecedence); @@ -2455,6 +2457,30 @@ void PseudoRustFunction::GetExprText(const HighLevelILInstruction& instr, HighLe }(); break; + case HLIL_MINS: + case HLIL_MAXS: + case HLIL_MINU: + case HLIL_MAXU: + [&]() { + const char* method; + switch (instr.operation) + { + case HLIL_MINS: + case HLIL_MINU: method = "min"; break; + default: method = "max"; break; + } + const auto& twoOperand = instr.AsTwoOperand(); + GetExprText(twoOperand.GetLeftExpr(), tokens, settings, MemberAndFunctionOperatorPrecedence); + tokens.Append(TextToken, "."); + tokens.Append(OperationToken, method); + tokens.AppendOpenParen(); + GetExprText(twoOperand.GetRightExpr(), tokens, settings); + tokens.AppendCloseParen(); + if (exprType != InnerExpression) + tokens.AppendSemicolon(); + }(); + break; + case HLIL_FLOAT_CONV: [&]() { const auto srcExpr = instr.GetSourceExpr<HLIL_FLOAT_CONV>(); |
