mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-02-19 06:49:38 +00:00
A64: Implement AESE
This commit is contained in:
@@ -329,7 +329,7 @@ INST(UMSUBL, "UMSUBL", "10011
|
||||
//INST(UMULH, "UMULH", "10011011110mmmmm011111nnnnnddddd")
|
||||
|
||||
// Data Processing - FP and SIMD - AES
|
||||
//INST(AESE, "AESE", "0100111000101000010010nnnnnddddd")
|
||||
INST(AESE, "AESE", "0100111000101000010010nnnnnddddd")
|
||||
//INST(AESD, "AESD", "0100111000101000010110nnnnnddddd")
|
||||
INST(AESMC, "AESMC", "0100111000101000011010nnnnnddddd")
|
||||
INST(AESIMC, "AESIMC", "0100111000101000011110nnnnnddddd")
|
||||
|
||||
@@ -8,6 +8,16 @@
|
||||
|
||||
namespace Dynarmic::A64 {
|
||||
|
||||
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));
|
||||
|
||||
ir.SetQ(Vd, result);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TranslatorVisitor::AESIMC(Vec Vn, Vec Vd) {
|
||||
const IR::U128 operand = ir.GetQ(Vn);
|
||||
const IR::U128 result = ir.AESInverseMixColumns(operand);
|
||||
|
||||
@@ -723,11 +723,15 @@ U32 IREmitter::CRC32ISO64(const U32& a, const U64& b) {
|
||||
return Inst<U32>(Opcode::CRC32ISO64, a, b);
|
||||
}
|
||||
|
||||
U128 IREmitter::AESInverseMixColumns(const U128 &a) {
|
||||
U128 IREmitter::AESEncrypt(const U128& a) {
|
||||
return Inst<U128>(Opcode::AESEncrypt, a);
|
||||
}
|
||||
|
||||
U128 IREmitter::AESInverseMixColumns(const U128& a) {
|
||||
return Inst<U128>(Opcode::AESInverseMixColumns, a);
|
||||
}
|
||||
|
||||
U128 IREmitter::AESMixColumns(const U128 &a) {
|
||||
U128 IREmitter::AESMixColumns(const U128& a) {
|
||||
return Inst<U128>(Opcode::AESMixColumns, a);
|
||||
}
|
||||
|
||||
|
||||
@@ -197,6 +197,7 @@ public:
|
||||
U32 CRC32ISO32(const U32& a, const U32& b);
|
||||
U32 CRC32ISO64(const U32& a, const U64& b);
|
||||
|
||||
U128 AESEncrypt(const U128& a);
|
||||
U128 AESInverseMixColumns(const U128& a);
|
||||
U128 AESMixColumns(const U128& a);
|
||||
|
||||
|
||||
@@ -181,6 +181,7 @@ 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(AESInverseMixColumns, T::U128, T::U128 )
|
||||
OPCODE(AESMixColumns, T::U128, T::U128 )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user