| 437 | } |
| 438 | |
| 439 | DEF_OP(VFMinScalarInsert) { |
| 440 | const auto Op = IROp->C<IR::IROp_VFMinScalarInsert>(); |
| 441 | const auto ElementSize = Op->Header.ElementSize; |
| 442 | const auto SubRegSize = ConvertSubRegSizePair248(IROp); |
| 443 | |
| 444 | auto ScalarEmit = [this, SubRegSize](ARMEmitter::VRegister Dst, ARMEmitter::VRegister Src1, ARMEmitter::VRegister Src2) { |
| 445 | if (HostSupportsAFP) { |
| 446 | // AFP.AH lets fmin behave like x86 min |
| 447 | fmin(SubRegSize.Scalar, Dst, Src1, Src2); |
| 448 | } else { |
| 449 | // Only take the first operand if it is strictly less. Otherwise take |
| 450 | // the second. This emulates all the weird x86 rules for signed zero and |
| 451 | // NaNs. No, they're not IEEE-754 semantics. |
| 452 | fcmp(SubRegSize.Scalar, Src1, Src2); |
| 453 | fcsel(SubRegSize.Scalar, Dst, Src1, Src2, ARMEmitter::Condition::CC_MI); |
| 454 | } |
| 455 | }; |
| 456 | |
| 457 | // Bit of a tricky detail. |
| 458 | // The upper bits of the destination comes from the first source. |
| 459 | const auto Dst = GetVReg(Node); |
| 460 | const auto Vector1 = GetVReg(Op->Vector1); |
| 461 | const auto Vector2 = GetVReg(Op->Vector2); |
| 462 | |
| 463 | VFScalarOperation(IROp->Size, ElementSize, Op->ZeroUpperBits, ScalarEmit, Dst, Vector1, Vector2); |
| 464 | } |
| 465 | |
| 466 | DEF_OP(VFMaxScalarInsert) { |
| 467 | const auto Op = IROp->C<IR::IROp_VFMaxScalarInsert>(); |
nothing calls this directly
no test coverage detected