emit_x64_vector_floating_point: AVX implementation of ForceToDefaultNaN
This commit is contained in:
parent
746dc521b9
commit
8252efd7b1
1 changed files with 10 additions and 5 deletions
|
@ -154,11 +154,16 @@ template<size_t fsize>
|
|||
void ForceToDefaultNaN(BlockOfCode& code, EmitContext& ctx, Xbyak::Xmm result) {
|
||||
if (ctx.FPSCR_DN()) {
|
||||
const Xbyak::Xmm nan_mask = ctx.reg_alloc.ScratchXmm();
|
||||
code.movaps(nan_mask, result);
|
||||
FCODE(cmpordp)(nan_mask, nan_mask);
|
||||
code.andps(result, nan_mask);
|
||||
code.andnps(nan_mask, GetNaNVector<fsize>(code));
|
||||
code.orps(result, nan_mask);
|
||||
if (code.DoesCpuSupport(Xbyak::util::Cpu::tAVX)) {
|
||||
FCODE(vcmpunordp)(nan_mask, result, result);
|
||||
FCODE(vblendvp)(result, result, GetNaNVector<fsize>(code), nan_mask);
|
||||
} else {
|
||||
code.movaps(nan_mask, result);
|
||||
FCODE(cmpordp)(nan_mask, nan_mask);
|
||||
code.andps(result, nan_mask);
|
||||
code.andnps(nan_mask, GetNaNVector<fsize>(code));
|
||||
code.orps(result, nan_mask);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue