mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-02-24 16:09:38 +00:00
A64/translate: Standardize arguments of helper functions
Don't pass in IREmitter when TranslatorVisitor is already available.
This commit is contained in:
@@ -8,9 +8,8 @@
|
||||
|
||||
namespace Dynarmic::A64 {
|
||||
|
||||
static IR::U8 SanitizeShiftAmount(TranslatorVisitor& v, IREmitter& ir, size_t datasize,
|
||||
const IR::U32U64& amount) {
|
||||
return ir.LeastSignificantByte(ir.And(amount, v.I(datasize, datasize - 1)));
|
||||
static IR::U8 SanitizeShiftAmount(TranslatorVisitor& v, size_t datasize, const IR::U32U64& amount) {
|
||||
return v.ir.LeastSignificantByte(v.ir.And(amount, v.I(datasize, datasize - 1)));
|
||||
}
|
||||
|
||||
bool TranslatorVisitor::LSLV(bool sf, Reg Rm, Reg Rn, Reg Rd) {
|
||||
@@ -19,7 +18,7 @@ bool TranslatorVisitor::LSLV(bool sf, Reg Rm, Reg Rn, Reg Rd) {
|
||||
const IR::U32U64 operand = X(datasize, Rn);
|
||||
const IR::U32U64 shift_amount = X(datasize, Rm);
|
||||
|
||||
const IR::U32U64 result = ir.LogicalShiftLeft(operand, SanitizeShiftAmount(*this, ir, datasize, shift_amount));
|
||||
const IR::U32U64 result = ir.LogicalShiftLeft(operand, SanitizeShiftAmount(*this, datasize, shift_amount));
|
||||
|
||||
X(datasize, Rd, result);
|
||||
return true;
|
||||
@@ -31,7 +30,7 @@ bool TranslatorVisitor::LSRV(bool sf, Reg Rm, Reg Rn, Reg Rd) {
|
||||
const IR::U32U64 operand = X(datasize, Rn);
|
||||
const IR::U32U64 shift_amount = X(datasize, Rm);
|
||||
|
||||
const IR::U32U64 result = ir.LogicalShiftRight(operand, SanitizeShiftAmount(*this, ir, datasize, shift_amount));
|
||||
const IR::U32U64 result = ir.LogicalShiftRight(operand, SanitizeShiftAmount(*this, datasize, shift_amount));
|
||||
|
||||
X(datasize, Rd, result);
|
||||
return true;
|
||||
@@ -43,7 +42,7 @@ bool TranslatorVisitor::ASRV(bool sf, Reg Rm, Reg Rn, Reg Rd) {
|
||||
const IR::U32U64 operand = X(datasize, Rn);
|
||||
const IR::U32U64 shift_amount = X(datasize, Rm);
|
||||
|
||||
const IR::U32U64 result = ir.ArithmeticShiftRight(operand, SanitizeShiftAmount(*this, ir, datasize, shift_amount));
|
||||
const IR::U32U64 result = ir.ArithmeticShiftRight(operand, SanitizeShiftAmount(*this, datasize, shift_amount));
|
||||
|
||||
X(datasize, Rd, result);
|
||||
return true;
|
||||
@@ -55,7 +54,7 @@ bool TranslatorVisitor::RORV(bool sf, Reg Rm, Reg Rn, Reg Rd) {
|
||||
const IR::U32U64 operand = X(datasize, Rn);
|
||||
const IR::U32U64 shift_amount = X(datasize, Rm);
|
||||
|
||||
const IR::U32U64 result = ir.RotateRight(operand, SanitizeShiftAmount(*this, ir, datasize, shift_amount));
|
||||
const IR::U32U64 result = ir.RotateRight(operand, SanitizeShiftAmount(*this, datasize, shift_amount));
|
||||
|
||||
X(datasize, Rd, result);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user