mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-03-07 22:32:55 +00:00
A64: Implement SIMD instructions USHLL, USHLL2
This commit is contained in:
@@ -28,4 +28,25 @@ bool TranslatorVisitor::SHL_2(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TranslatorVisitor::USHLL(bool Q, Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) {
|
||||
if (immh == 0b0000) {
|
||||
return DecodeError();
|
||||
}
|
||||
if (immh.Bit<3>()) {
|
||||
return ReservedValue();
|
||||
}
|
||||
const size_t esize = 8 << Common::HighestSetBit(immh.ZeroExtend());
|
||||
const size_t datasize = 64;
|
||||
const size_t part = Q ? 1 : 0;
|
||||
|
||||
const u8 shift_amount = concatenate(immh, immb).ZeroExtend<u8>() - static_cast<u8>(esize);
|
||||
|
||||
const IR::U128 operand = Vpart(datasize, Vn, part);
|
||||
const IR::U128 expanded_operand = ir.VectorZeroExtend(esize, operand);
|
||||
const IR::U128 result = ir.VectorLogicalShiftLeft(2 * esize, expanded_operand, shift_amount);
|
||||
|
||||
V(2 * datasize, Vd, result);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Dynarmic::A64
|
||||
|
||||
Reference in New Issue
Block a user