diff options
| author | Mark Rowe <mark@vector35.com> | 2026-06-03 21:25:55 -0700 |
|---|---|---|
| committer | Mark Rowe <mark@vector35.com> | 2026-06-04 14:31:09 -0700 |
| commit | d592ed6dafbb134553bf3a0b8ee70ff7f2049aba (patch) | |
| tree | 1bfe7e335e5b4e21371cde4bf8858c6439bc3f18 /lang/rust/pseudorust.cpp | |
| parent | 9987102015875991813200116558306851763009 (diff) | |
Add bswap, popcnt, clz, ctz, cls, and rbit instructions
Diffstat (limited to 'lang/rust/pseudorust.cpp')
| -rw-r--r-- | lang/rust/pseudorust.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lang/rust/pseudorust.cpp b/lang/rust/pseudorust.cpp index 2e233550..de1acae1 100644 --- a/lang/rust/pseudorust.cpp +++ b/lang/rust/pseudorust.cpp @@ -2428,6 +2428,33 @@ void PseudoRustFunction::GetExprText(const HighLevelILInstruction& instr, HighLe }(); break; + case HLIL_BSWAP: + case HLIL_POPCNT: + case HLIL_CLZ: + case HLIL_CTZ: + case HLIL_RBIT: + case HLIL_CLS: + [&]() { + const char* method; + switch (instr.operation) + { + case HLIL_BSWAP: method = "swap_bytes"; break; + case HLIL_POPCNT: method = "count_ones"; break; + case HLIL_CLZ: method = "leading_zeros"; break; + case HLIL_CTZ: method = "trailing_zeros"; break; + case HLIL_RBIT: method = "reverse_bits"; break; + default: method = "leading_sign_bits"; break; + } + GetExprText(instr.GetSourceExpr(), tokens, settings, MemberAndFunctionOperatorPrecedence); + tokens.Append(TextToken, "."); + tokens.Append(OperationToken, method); + tokens.AppendOpenParen(); + tokens.AppendCloseParen(); + if (exprType != InnerExpression) + tokens.AppendSemicolon(); + }(); + break; + case HLIL_FLOAT_CONV: [&]() { const auto srcExpr = instr.GetSourceExpr<HLIL_FLOAT_CONV>(); |
