Merge pull request #438 from lioncash/fmulx

A64: Implement scalar double/single precision FMULX (by element)
This commit is contained in:
Merry 2019-03-03 14:42:45 +00:00 committed by MerryMage
commit d91192681a
2 changed files with 11 additions and 2 deletions

View file

@ -549,7 +549,7 @@ INST(FMUL_elt_2, "FMUL (by element)", "01011
//INST(SQRDMLAH_elt_1, "SQRDMLAH (by element)", "01111111zzLMmmmm1101H0nnnnnddddd")
//INST(SQRDMLSH_elt_1, "SQRDMLSH (by element)", "01111111zzLMmmmm1111H0nnnnnddddd")
//INST(FMULX_elt_1, "FMULX (by element)", "0111111100LMmmmm1001H0nnnnnddddd")
//INST(FMULX_elt_2, "FMULX (by element)", "011111111zLMmmmm1001H0nnnnnddddd")
INST(FMULX_elt_2, "FMULX (by element)", "011111111zLMmmmm1001H0nnnnnddddd")
// Data Processing - FP and SIMD - SIMD Table Lookup
INST(TBL, "TBL", "0Q001110000mmmmm0LL000nnnnnddddd")

View file

@ -12,7 +12,8 @@ namespace {
enum class ExtraBehavior {
None,
Accumulate,
Subtract
Subtract,
MultiplyExtended,
};
bool MultiplyByElement(TranslatorVisitor& v, bool sz, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H,
@ -34,6 +35,10 @@ bool MultiplyByElement(TranslatorVisitor& v, bool sz, Imm<1> L, Imm<1> M, Imm<4>
return v.ir.FPMul(operand1, element, true);
}
if (extra_behavior == ExtraBehavior::MultiplyExtended) {
return v.ir.FPMulX(operand1, element);
}
if (extra_behavior == ExtraBehavior::Subtract) {
operand1 = v.ir.FPNeg(operand1);
}
@ -59,6 +64,10 @@ bool TranslatorVisitor::FMUL_elt_2(bool sz, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm
return MultiplyByElement(*this, sz, L, M, Vmlo, H, Vn, Vd, ExtraBehavior::None);
}
bool TranslatorVisitor::FMULX_elt_2(bool sz, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, Vec Vd) {
return MultiplyByElement(*this, sz, L, M, Vmlo, H, Vn, Vd, ExtraBehavior::MultiplyExtended);
}
bool TranslatorVisitor::SQDMULH_elt_1(Imm<2> size, Imm<1> L, Imm<1> M, Imm<4> Vmlo, Imm<1> H, Vec Vn, Vec Vd) {
if (size == 0b00 || size == 0b11) {
return UnallocatedEncoding();