[CPU] Support for const value in src1 for OPCODE_PACK
This commit is contained in:
parent
a7ece0ac8f
commit
354d42135d
|
@ -2895,12 +2895,17 @@ struct PACK : Sequence<PACK, I<OPCODE_PACK, V128Op, V128Op, V128Op>> {
|
||||||
if (IsPackOutSaturate(flags)) {
|
if (IsPackOutSaturate(flags)) {
|
||||||
// signed -> unsigned + saturate
|
// signed -> unsigned + saturate
|
||||||
// PACKUSWB / SaturateSignedWordToUnsignedByte
|
// PACKUSWB / SaturateSignedWordToUnsignedByte
|
||||||
Xbyak::Xmm src2 = i.src2.is_constant ? e.xmm0 : i.src2;
|
Xbyak::Xmm src1 = i.src1.is_constant ? e.xmm0 : i.src1;
|
||||||
|
if (i.src1.is_constant) {
|
||||||
|
e.LoadConstantXmm(src1, i.src1.constant());
|
||||||
|
}
|
||||||
|
|
||||||
|
Xbyak::Xmm src2 = i.src2.is_constant ? e.xmm1 : i.src2;
|
||||||
if (i.src2.is_constant) {
|
if (i.src2.is_constant) {
|
||||||
e.LoadConstantXmm(src2, i.src2.constant());
|
e.LoadConstantXmm(src2, i.src2.constant());
|
||||||
}
|
}
|
||||||
|
|
||||||
e.vpackuswb(i.dest, i.src1, src2);
|
e.vpackuswb(i.dest, src1, src2);
|
||||||
e.vpshufb(i.dest, i.dest, e.GetXmmConstPtr(XMMByteOrderMask));
|
e.vpshufb(i.dest, i.dest, e.GetXmmConstPtr(XMMByteOrderMask));
|
||||||
} else {
|
} else {
|
||||||
// signed -> unsigned
|
// signed -> unsigned
|
||||||
|
|
Loading…
Reference in New Issue