diff --git a/src/frontend/A64/translate/impl/impl.cpp b/src/frontend/A64/translate/impl/impl.cpp index 85c05b4d..68a9e859 100644 --- a/src/frontend/A64/translate/impl/impl.cpp +++ b/src/frontend/A64/translate/impl/impl.cpp @@ -161,6 +161,27 @@ void TranslatorVisitor::V_scalar(size_t /*bitsize*/, Vec vec, IR::UAny value) { ir.SetQ(vec, ir.ZeroExtendToQuad(value)); } +IR::UAny TranslatorVisitor::Vpart(size_t bitsize, Vec vec, size_t part) { + ASSERT(part == 0 || part == 1); + if (part == 0) { + ASSERT(bitsize == 8 || bitsize == 16 || bitsize == 32 || bitsize == 64); + } else { + ASSERT(bitsize == 64); + } + return ir.VectorGetElement(bitsize, V(128, vec), part); +} + +void TranslatorVisitor::Vpart(size_t bitsize, Vec vec, size_t part, IR::UAny value) { + ASSERT(part == 0 || part == 1); + if (part == 0) { + ASSERT(bitsize == 8 || bitsize == 16 || bitsize == 32 || bitsize == 64); + V(128, vec, ir.ZeroExtendToQuad(value)); + } else { + ASSERT(bitsize == 64); + V(128, vec, ir.VectorSetElement(64, V(128, vec), 1, value)); + } +} + IR::UAnyU128 TranslatorVisitor::Mem(IR::U64 address, size_t bytesize, AccType /*acctype*/) { switch (bytesize) { case 1: diff --git a/src/frontend/A64/translate/impl/impl.h b/src/frontend/A64/translate/impl/impl.h index aaa29dc3..a20ebc42 100644 --- a/src/frontend/A64/translate/impl/impl.h +++ b/src/frontend/A64/translate/impl/impl.h @@ -53,6 +53,9 @@ struct TranslatorVisitor final { IR::UAny V_scalar(size_t bitsize, Vec vec); void V_scalar(size_t bitsize, Vec vec, IR::UAny value); + IR::UAny Vpart(size_t bitsize, Vec vec, size_t part); + void Vpart(size_t bitsize, Vec vec, size_t part, IR::UAny value); + IR::UAnyU128 Mem(IR::U64 address, size_t size, AccType acctype); void Mem(IR::U64 address, size_t size, AccType acctype, IR::UAnyU128 value);