A64: Implement ABS (vector)

This commit is contained in:
Lioncash 2018-04-02 17:11:56 -04:00 committed by MerryMage
parent e33dcce14a
commit 7bcb1c115a
2 changed files with 16 additions and 1 deletions

View file

@ -576,7 +576,7 @@ INST(CNT, "CNT", "0Q001
INST(CMGT_zero_2, "CMGT (zero)", "0Q001110zz100000100010nnnnnddddd") INST(CMGT_zero_2, "CMGT (zero)", "0Q001110zz100000100010nnnnnddddd")
INST(CMEQ_zero_2, "CMEQ (zero)", "0Q001110zz100000100110nnnnnddddd") INST(CMEQ_zero_2, "CMEQ (zero)", "0Q001110zz100000100110nnnnnddddd")
INST(CMLT_2, "CMLT (zero)", "0Q001110zz100000101010nnnnnddddd") INST(CMLT_2, "CMLT (zero)", "0Q001110zz100000101010nnnnnddddd")
//INST(ABS_2, "ABS", "0Q001110zz100000101110nnnnnddddd") INST(ABS_2, "ABS", "0Q001110zz100000101110nnnnnddddd")
INST(XTN, "XTN, XTN2", "0Q001110zz100001001010nnnnnddddd") INST(XTN, "XTN, XTN2", "0Q001110zz100001001010nnnnnddddd")
//INST(SQXTN_2, "SQXTN, SQXTN2", "0Q001110zz100001010010nnnnnddddd") //INST(SQXTN_2, "SQXTN, SQXTN2", "0Q001110zz100001010010nnnnnddddd")
//INST(FCVTN, "FCVTN, FCVTN2", "0Q0011100z100001011010nnnnnddddd") //INST(FCVTN, "FCVTN, FCVTN2", "0Q0011100z100001011010nnnnnddddd")

View file

@ -52,6 +52,21 @@ bool TranslatorVisitor::CMEQ_zero_2(bool Q, Imm<2> size, Vec Vn, Vec Vd) {
return true; return true;
} }
bool TranslatorVisitor::ABS_2(bool Q, Imm<2> size, Vec Vn, Vec Vd) {
if (!Q && size == 0b11) {
return ReservedValue();
}
const size_t datasize = Q ? 128 : 64;
const size_t esize = 8 << size.ZeroExtend();
const IR::U128 data = V(datasize, Vn);
const IR::U128 result = ir.VectorAbs(esize, data);
V(datasize, Vd, result);
return true;
}
bool TranslatorVisitor::CMLT_2(bool Q, Imm<2> size, Vec Vn, Vec Vd) { bool TranslatorVisitor::CMLT_2(bool Q, Imm<2> size, Vec Vn, Vec Vd) {
if (size == 0b11 && !Q) { if (size == 0b11 && !Q) {
return ReservedValue(); return ReservedValue();