summaryrefslogtreecommitdiff
path: root/lang/rust/pseudorust.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lang/rust/pseudorust.cpp')
-rw-r--r--lang/rust/pseudorust.cpp26
1 files changed, 26 insertions, 0 deletions
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>();