From 0612a68f80fef40d1d5ea9036c2f63b07bdc5220 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Tue, 27 May 2014 13:02:38 -0700 Subject: [PATCH] Fixing encoding of vpextr*. --- src/alloy/backend/x64/x64_sequences.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/alloy/backend/x64/x64_sequences.cc b/src/alloy/backend/x64/x64_sequences.cc index 1f3c1efc8..93039b45e 100644 --- a/src/alloy/backend/x64/x64_sequences.cc +++ b/src/alloy/backend/x64/x64_sequences.cc @@ -4162,7 +4162,7 @@ EMITTER_OPCODE_TABLE( EMITTER(EXTRACT_I8, MATCH(I, V128<>, I8<>>)) { static void Emit(X64Emitter& e, const EmitArgType& i) { if (i.src2.is_constant) { - e.vpextrb(i.dest, i.src1, i.src2.constant()); + e.vpextrb(i.dest.reg().cvt64(), i.src1, i.src2.constant()); } else { XEASSERTALWAYS(); } @@ -4171,7 +4171,7 @@ EMITTER(EXTRACT_I8, MATCH(I, V128<>, I8<>>)) { EMITTER(EXTRACT_I16, MATCH(I, V128<>, I8<>>)) { static void Emit(X64Emitter& e, const EmitArgType& i) { if (i.src2.is_constant) { - e.vpextrw(i.dest, i.src1, i.src2.constant()); + e.vpextrw(i.dest.reg().cvt64(), i.src1, i.src2.constant()); } else { XEASSERTALWAYS(); } @@ -4186,9 +4186,9 @@ EMITTER(EXTRACT_I32, MATCH(I, V128<>, I8<>>)) { vec128b(15, 14, 13, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), }; if (i.src2.is_constant) { - e.vpextrd(i.dest, i.src1, i.src2.constant()); + e.vpextrd(i.dest.reg().cvt64(), i.src1, i.src2.constant()); } else { - // Get teh desired word in xmm0, then extract that. + // Get the desired word in xmm0, then extract that. // TODO(benvanik): find a better way, this sequence is terrible. e.xor(e.rax, e.rax); e.mov(e.al, i.src2); @@ -4197,7 +4197,7 @@ EMITTER(EXTRACT_I32, MATCH(I, V128<>, I8<>>)) { e.mov(e.rdx, reinterpret_cast(extract_table_32)); e.vmovaps(e.xmm0, e.ptr[e.rdx + e.rax]); e.vpshufb(e.xmm0, i.src1, e.xmm0); - e.vpextrd(i.dest, e.xmm0, 0); + e.vpextrd(i.dest.reg().cvt32(), e.xmm0, 0); e.ReloadEDX(); } }