A64: Handle half-precision floating point in scalar FNEG

With the half-precision variant of the FPNeg opcode added, we can
utilize it here to emulate the half-precision variant of FNEG.
This commit is contained in:
Lioncash 2019-03-23 13:23:31 -04:00 committed by MerryMage
parent c97efcb978
commit 10abc77fad

View file

@ -36,12 +36,12 @@ bool TranslatorVisitor::FABS_float(Imm<2> type, Vec Vn, Vec Vd) {
bool TranslatorVisitor::FNEG_float(Imm<2> type, Vec Vn, Vec Vd) {
const auto datasize = FPGetDataSize(type);
if (!datasize || *datasize == 16) {
if (!datasize) {
return UnallocatedEncoding();
}
const IR::U32U64 operand = V_scalar(*datasize, Vn);
const IR::U32U64 result = ir.FPNeg(operand);
const IR::U16U32U64 operand = V_scalar(*datasize, Vn);
const IR::U16U32U64 result = ir.FPNeg(operand);
V_scalar(*datasize, Vd, result);
return true;
}