diff --git a/src/frontend/A64/decoder/a64.inc b/src/frontend/A64/decoder/a64.inc index c93ed0df..e25b9f32 100644 --- a/src/frontend/A64/decoder/a64.inc +++ b/src/frontend/A64/decoder/a64.inc @@ -865,6 +865,7 @@ INST(RAX1, "RAX1", "11001 INST(SM3PARTW1, "SM3PARTW1", "11001110011mmmmm110000nnnnnddddd") INST(SM3PARTW2, "SM3PARTW2", "11001110011mmmmm110001nnnnnddddd") //INST(SM4EKEY, "SM4EKEY", "11001110011mmmmm110010nnnnnddddd") +INST(XAR, "XAR", "11001110100mmmmmiiiiiinnnnnddddd") // Data Processing - FP and SIMD - Cryptographic four register INST(EOR3, "EOR3", "11001110000mmmmm0aaaaannnnnddddd") diff --git a/src/frontend/A64/translate/impl/impl.h b/src/frontend/A64/translate/impl/impl.h index 8710f454..a021d5a5 100644 --- a/src/frontend/A64/translate/impl/impl.h +++ b/src/frontend/A64/translate/impl/impl.h @@ -933,6 +933,7 @@ struct TranslatorVisitor final { bool SHA512H2(Vec Vm, Vec Vn, Vec Vd); bool SHA512SU1(Vec Vm, Vec Vn, Vec Vd); bool RAX1(Vec Vm, Vec Vn, Vec Vd); + bool XAR(Vec Vm, Imm<6> imm6, Vec Vn, Vec Vd); bool SM3PARTW1(Vec Vm, Vec Vn, Vec Vd); bool SM3PARTW2(Vec Vm, Vec Vn, Vec Vd); bool SM4EKEY(Vec Vm, Vec Vn, Vec Vd); diff --git a/src/frontend/A64/translate/impl/simd_sha512.cpp b/src/frontend/A64/translate/impl/simd_sha512.cpp index 955092ee..976f14c4 100644 --- a/src/frontend/A64/translate/impl/simd_sha512.cpp +++ b/src/frontend/A64/translate/impl/simd_sha512.cpp @@ -167,6 +167,17 @@ bool TranslatorVisitor::RAX1(Vec Vm, Vec Vn, Vec Vd) { return true; } +bool TranslatorVisitor::XAR(Vec Vm, Imm<6> imm6, Vec Vn, Vec Vd) { + const IR::U128 m = ir.GetQ(Vm); + const IR::U128 n = ir.GetQ(Vn); + + const IR::U128 tmp = ir.VectorEor(m, n); + const IR::U128 result = ir.VectorRotateRight(64, tmp, imm6.ZeroExtend()); + + ir.SetQ(Vd, result); + return true; +} + bool TranslatorVisitor::SM3PARTW1(Vec Vm, Vec Vn, Vec Vd) { const IR::U128 d = ir.GetQ(Vd); const IR::U128 m = ir.GetQ(Vm);