A64: Implement CMHS (register, scalar)

This commit is contained in:
Lioncash 2018-04-15 05:32:22 -04:00 committed by MerryMage
parent 78bb12276a
commit 5b8c9e5146
2 changed files with 9 additions and 2 deletions

View file

@ -457,7 +457,7 @@ INST(ADD_1, "ADD (vector)", "01011
//INST(UQADD_1, "UQADD", "01111110zz1mmmmm000011nnnnnddddd") //INST(UQADD_1, "UQADD", "01111110zz1mmmmm000011nnnnnddddd")
//INST(UQSUB_1, "UQSUB", "01111110zz1mmmmm001011nnnnnddddd") //INST(UQSUB_1, "UQSUB", "01111110zz1mmmmm001011nnnnnddddd")
INST(CMHI_1, "CMHI (register)", "01111110zz1mmmmm001101nnnnnddddd") INST(CMHI_1, "CMHI (register)", "01111110zz1mmmmm001101nnnnnddddd")
//INST(CMHS_1, "CMHS (register)", "01111110zz1mmmmm001111nnnnnddddd") INST(CMHS_1, "CMHS (register)", "01111110zz1mmmmm001111nnnnnddddd")
//INST(USHL_1, "USHL", "01111110zz1mmmmm010001nnnnnddddd") //INST(USHL_1, "USHL", "01111110zz1mmmmm010001nnnnnddddd")
//INST(UQSHL_reg_1, "UQSHL (register)", "01111110zz1mmmmm010011nnnnnddddd") //INST(UQSHL_reg_1, "UQSHL (register)", "01111110zz1mmmmm010011nnnnnddddd")
//INST(URSHL_1, "URSHL", "01111110zz1mmmmm010101nnnnnddddd") //INST(URSHL_1, "URSHL", "01111110zz1mmmmm010101nnnnnddddd")

View file

@ -13,6 +13,7 @@ enum class ComparisonType {
GE, GE,
GT, GT,
HI, HI,
HS,
}; };
bool ScalarCompare(TranslatorVisitor& v, Imm<2> size, Vec Vm, Vec Vn, Vec Vd, ComparisonType type) { bool ScalarCompare(TranslatorVisitor& v, Imm<2> size, Vec Vm, Vec Vn, Vec Vd, ComparisonType type) {
@ -33,8 +34,10 @@ bool ScalarCompare(TranslatorVisitor& v, Imm<2> size, Vec Vm, Vec Vn, Vec Vd, Co
case ComparisonType::GT: case ComparisonType::GT:
return v.ir.VectorGreaterSigned(esize, operand1, operand2); return v.ir.VectorGreaterSigned(esize, operand1, operand2);
case ComparisonType::HI: case ComparisonType::HI:
default:
return v.ir.VectorGreaterUnsigned(esize, operand1, operand2); return v.ir.VectorGreaterUnsigned(esize, operand1, operand2);
case ComparisonType::HS:
default:
return v.ir.VectorGreaterEqualUnsigned(esize, operand1, operand2);
} }
}(); }();
@ -69,6 +72,10 @@ bool TranslatorVisitor::CMHI_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) {
return ScalarCompare(*this, size, Vm, Vn, Vd, ComparisonType::HI); return ScalarCompare(*this, size, Vm, Vn, Vd, ComparisonType::HI);
} }
bool TranslatorVisitor::CMHS_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) {
return ScalarCompare(*this, size, Vm, Vn, Vd, ComparisonType::HS);
}
bool TranslatorVisitor::SUB_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { bool TranslatorVisitor::SUB_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) {
if (size != 0b11) { if (size != 0b11) {
return ReservedValue(); return ReservedValue();