mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-03 21:24:38 +01:00
ir: Add an opcode for doing an SM4 lookup table query
This commit is contained in:
parent
27a6d5f6ce
commit
b312d28295
7 changed files with 106 additions and 0 deletions
|
|
@ -683,6 +683,10 @@ U128 IREmitter::AESMixColumns(const U128& a) {
|
|||
return Inst<U128>(Opcode::AESMixColumns, a);
|
||||
}
|
||||
|
||||
U8 IREmitter::SM4AccessSubstitutionBox(const U8& a) {
|
||||
return Inst<U8>(Opcode::SM4AccessSubstitutionBox, a);
|
||||
}
|
||||
|
||||
UAny IREmitter::VectorGetElement(size_t esize, const U128& a, size_t index) {
|
||||
ASSERT_MSG(esize * index < 128, "Invalid index");
|
||||
switch (esize) {
|
||||
|
|
|
|||
|
|
@ -188,6 +188,8 @@ public:
|
|||
U128 AESInverseMixColumns(const U128& a);
|
||||
U128 AESMixColumns(const U128& a);
|
||||
|
||||
U8 SM4AccessSubstitutionBox(const U8& a);
|
||||
|
||||
UAny VectorGetElement(size_t esize, const U128& a, size_t index);
|
||||
U128 VectorSetElement(size_t esize, const U128& a, size_t index, const UAny& elem);
|
||||
U128 VectorAbs(size_t esize, const U128& a);
|
||||
|
|
|
|||
|
|
@ -202,6 +202,10 @@ OPCODE(AESDecryptSingleRound, T::U128, T::U128
|
|||
OPCODE(AESEncryptSingleRound, T::U128, T::U128 )
|
||||
OPCODE(AESInverseMixColumns, T::U128, T::U128 )
|
||||
OPCODE(AESMixColumns, T::U128, T::U128 )
|
||||
|
||||
// SM4 instructions
|
||||
OPCODE(SM4AccessSubstitutionBox, T::U8, T::U8 )
|
||||
|
||||
// Vector instructions
|
||||
OPCODE(VectorGetElement8, T::U8, T::U128, T::U8 )
|
||||
OPCODE(VectorGetElement16, T::U16, T::U128, T::U8 )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue