emit_x64_vector: Emit PMINUD in EmitVectorMinU32 on SSE4.1-capable CPUs

This commit is contained in:
Lioncash 2018-04-20 13:52:56 -04:00 committed by MerryMage
parent 596a8dd1dd
commit f17702f608

View file

@ -938,6 +938,11 @@ void EmitX64::EmitVectorMinU16(EmitContext& ctx, IR::Inst* inst) {
} }
void EmitX64::EmitVectorMinU32(EmitContext& ctx, IR::Inst* inst) { void EmitX64::EmitVectorMinU32(EmitContext& ctx, IR::Inst* inst) {
if (code.DoesCpuSupport(Xbyak::util::Cpu::tSSE41)) {
EmitVectorOperation(code, ctx, inst, &Xbyak::CodeGenerator::pminud);
return;
}
EmitTwoArgumentFallback(code, ctx, inst, [](std::array<u32, 4>& result, const std::array<u32, 4>& a, const std::array<u32, 4>& b){ EmitTwoArgumentFallback(code, ctx, inst, [](std::array<u32, 4>& result, const std::array<u32, 4>& a, const std::array<u32, 4>& b){
std::transform(a.begin(), a.end(), b.begin(), result.begin(), [](auto x, auto y) { return std::min(x, y); }); std::transform(a.begin(), a.end(), b.begin(), result.begin(), [](auto x, auto y) { return std::min(x, y); });
}); });