From 54d051977f7a6af9c7596ba6a4e6eb467bd1e0bc Mon Sep 17 00:00:00 2001 From: MerryMage Date: Mon, 5 Dec 2016 00:56:56 +0000 Subject: [PATCH] emit_x64: Use movdqa instead of movaps in EmitPackedSubU8 While movaps and movdqa are behaviourly equivalent, using movaps may incur a domain crossing penalty on some microarchitectures. This is because movaps is an instruction in the floating-point domain while the following instructions are in the integer domain. --- src/backend_x64/emit_x64.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend_x64/emit_x64.cpp b/src/backend_x64/emit_x64.cpp index 1c567917..2b1ed94e 100644 --- a/src/backend_x64/emit_x64.cpp +++ b/src/backend_x64/emit_x64.cpp @@ -1314,7 +1314,7 @@ void EmitX64::EmitPackedSubU8(IR::Block& block, IR::Inst* inst) { code->movd(xmm_a, reg_a); code->movd(xmm_b, reg_b); if (ge_inst) { - code->movaps(xmm_ge, xmm_a); + code->movdqa(xmm_ge, xmm_a); code->pmaxub(xmm_ge, xmm_b); code->pcmpeqb(xmm_ge, xmm_a); code->movd(reg_ge, xmm_ge);