mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-12 01:18:01 +01:00
A64: Implement CLS
This is not the cleanest implementation.
This commit is contained in:
parent
b8e26bfdc3
commit
d4b05b28cf
2 changed files with 11 additions and 1 deletions
|
|
@ -19,6 +19,16 @@ bool TranslatorVisitor::CLZ_int(bool sf, Reg Rn, Reg Rd) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool TranslatorVisitor::CLS_int(bool sf, Reg Rn, Reg Rd) {
|
||||
const size_t datasize = sf ? 64 : 32;
|
||||
|
||||
const IR::U32U64 operand = X(datasize, Rn);
|
||||
const IR::U32U64 result = ir.Sub(ir.CountLeadingZeros(ir.Eor(operand, ir.ArithmeticShiftRight(operand, ir.Imm8(u8(datasize))))), I(datasize, 1));
|
||||
|
||||
X(datasize, Rd, result);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TranslatorVisitor::REV(bool sf, bool opc_0, Reg Rn, Reg Rd) {
|
||||
const size_t datasize = sf ? 64 : 32;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue