emit_x64_vector: bug: VectorGetElement8 returning incorrect values for non-SSE4.1
This bug wasn't discovered earlier because we previously only used index == 0.
This commit is contained in:
parent
ebfc51c609
commit
6414736a8d
1 changed files with 4 additions and 1 deletions
|
@ -41,7 +41,10 @@ void EmitX64::EmitVectorGetElement8(EmitContext& ctx, IR::Inst* inst) {
|
||||||
ctx.reg_alloc.DefineValue(inst, dest);
|
ctx.reg_alloc.DefineValue(inst, dest);
|
||||||
} else {
|
} else {
|
||||||
Xbyak::Reg32 dest = ctx.reg_alloc.ScratchGpr().cvt32();
|
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);
|
ctx.reg_alloc.DefineValue(inst, dest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue