mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-03-26 07:18:43 +00:00
A64: Implement AESD
This commit is contained in:
@@ -330,7 +330,7 @@ INST(UMSUBL, "UMSUBL", "10011
|
||||
|
||||
// Data Processing - FP and SIMD - AES
|
||||
INST(AESE, "AESE", "0100111000101000010010nnnnnddddd")
|
||||
//INST(AESD, "AESD", "0100111000101000010110nnnnnddddd")
|
||||
INST(AESD, "AESD", "0100111000101000010110nnnnnddddd")
|
||||
INST(AESMC, "AESMC", "0100111000101000011010nnnnnddddd")
|
||||
INST(AESIMC, "AESIMC", "0100111000101000011110nnnnnddddd")
|
||||
|
||||
|
||||
@@ -8,11 +8,21 @@
|
||||
|
||||
namespace Dynarmic::A64 {
|
||||
|
||||
bool TranslatorVisitor::AESD(Vec Vn, Vec Vd) {
|
||||
const IR::U128 operand1 = ir.GetQ(Vd);
|
||||
const IR::U128 operand2 = ir.GetQ(Vn);
|
||||
|
||||
const IR::U128 result = ir.AESDecryptSingleRound(ir.VectorEor(operand1, operand2));
|
||||
|
||||
ir.SetQ(Vd, result);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TranslatorVisitor::AESE(Vec Vn, Vec Vd) {
|
||||
const IR::U128 operand1 = ir.GetQ(Vd);
|
||||
const IR::U128 operand2 = ir.GetQ(Vn);
|
||||
|
||||
const IR::U128 result = ir.AESEncrypt(ir.VectorEor(operand1, operand2));
|
||||
const IR::U128 result = ir.AESEncryptSingleRound(ir.VectorEor(operand1, operand2));
|
||||
|
||||
ir.SetQ(Vd, result);
|
||||
return true;
|
||||
|
||||
@@ -723,8 +723,12 @@ U32 IREmitter::CRC32ISO64(const U32& a, const U64& b) {
|
||||
return Inst<U32>(Opcode::CRC32ISO64, a, b);
|
||||
}
|
||||
|
||||
U128 IREmitter::AESEncrypt(const U128& a) {
|
||||
return Inst<U128>(Opcode::AESEncrypt, a);
|
||||
U128 IREmitter::AESDecryptSingleRound(const U128& a) {
|
||||
return Inst<U128>(Opcode::AESDecryptSingleRound, a);
|
||||
}
|
||||
|
||||
U128 IREmitter::AESEncryptSingleRound(const U128& a) {
|
||||
return Inst<U128>(Opcode::AESEncryptSingleRound, a);
|
||||
}
|
||||
|
||||
U128 IREmitter::AESInverseMixColumns(const U128& a) {
|
||||
|
||||
@@ -197,7 +197,8 @@ public:
|
||||
U32 CRC32ISO32(const U32& a, const U32& b);
|
||||
U32 CRC32ISO64(const U32& a, const U64& b);
|
||||
|
||||
U128 AESEncrypt(const U128& a);
|
||||
U128 AESDecryptSingleRound(const U128& a);
|
||||
U128 AESEncryptSingleRound(const U128& a);
|
||||
U128 AESInverseMixColumns(const U128& a);
|
||||
U128 AESMixColumns(const U128& a);
|
||||
|
||||
|
||||
@@ -181,7 +181,8 @@ OPCODE(CRC32ISO32, T::U32, T::U32, T::U32
|
||||
OPCODE(CRC32ISO64, T::U32, T::U32, T::U64 )
|
||||
|
||||
// AES instructions
|
||||
OPCODE(AESEncrypt, T::U128, T::U128 )
|
||||
OPCODE(AESDecryptSingleRound, T::U128, T::U128 )
|
||||
OPCODE(AESEncryptSingleRound, T::U128, T::U128 )
|
||||
OPCODE(AESInverseMixColumns, T::U128, T::U128 )
|
||||
OPCODE(AESMixColumns, T::U128, T::U128 )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user