A64: Implement EXT

This commit is contained in:
MerryMage
2018-07-15 17:47:32 +01:00
parent d50eaedaa7
commit 5563bbbd79
3 changed files with 5 additions and 5 deletions

View File

@@ -722,14 +722,14 @@ void EmitX64::EmitVectorExtractLower(EmitContext& ctx, IR::Inst* inst) {
auto args = ctx.reg_alloc.GetArgumentInfo(inst);
const Xbyak::Xmm xmm_a = ctx.reg_alloc.UseScratchXmm(args[0]);
const Xbyak::Xmm xmm_b = ctx.reg_alloc.UseScratchXmm(args[1]);
const Xbyak::Xmm xmm_b = ctx.reg_alloc.UseXmm(args[1]);
const u8 position = args[2].GetImmediateU8();
ASSERT(position % 8 == 0);
code.punpcklqdq(xmm_a, xmm_b);
code.psrldq(xmm_a, position / 8);
code.pslldq(xmm_b, (64 - position) / 8);
code.por(xmm_a, xmm_b);
code.movq(xmm_a, xmm_a);
ctx.reg_alloc.DefineValue(inst, xmm_a);
}