diff --git a/src/backend_x64/emit_x64_vector.cpp b/src/backend_x64/emit_x64_vector.cpp index f5fe6503..455d0296 100644 --- a/src/backend_x64/emit_x64_vector.cpp +++ b/src/backend_x64/emit_x64_vector.cpp @@ -41,7 +41,10 @@ void EmitX64::EmitVectorGetElement8(EmitContext& ctx, IR::Inst* inst) { ctx.reg_alloc.DefineValue(inst, dest); } else { Xbyak::Reg32 dest = ctx.reg_alloc.ScratchGpr().cvt32(); - code->pextrw(dest, source, index); + code->pextrw(dest, source, index / 2); + if (index % 2 == 1) { + code->shr(dest, 8); + } ctx.reg_alloc.DefineValue(inst, dest); } }