AVX512_VBMI2: Fixed shift count from register source for VBMI2 shift instructions (VPSHRDVD/VPSHLDVD/VPSHRDVQ/VPSHLDVQ)

This commit is contained in:
Stanislav Shwartsman 2019-12-19 21:55:46 +00:00
parent 1b9e0081b4
commit 9c98d68f87

View File

@ -706,7 +706,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPSHLDVD_MASK_VdqHdqWdqR(bxInstruction_c *
unsigned len = i->getVL();
for (unsigned n=0; n < DWORD_ELEMENTS(len); n++) {
unsigned count = op2.vmm16u(n) & 31;
unsigned count = op2.vmm32u(n) & 31;
if (count) {
dst.vmm32u(n) = (dst.vmm32u(n) << count) | (op1.vmm32u(n) >> (32 - count));
}
@ -746,7 +746,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPSHLDVQ_MASK_VdqHdqWdqR(bxInstruction_c *
unsigned len = i->getVL();
for (unsigned n=0; n < QWORD_ELEMENTS(len); n++) {
unsigned count = op2.vmm16u(n) & 63;
unsigned count = op2.vmm64u(n) & 63;
if (count) {
dst.vmm64u(n) = (dst.vmm64u(n) << count) | (op1.vmm64u(n) >> (64 - count));
}
@ -826,7 +826,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPSHRDVD_MASK_VdqHdqWdqR(bxInstruction_c *
unsigned len = i->getVL();
for (unsigned n=0; n < DWORD_ELEMENTS(len); n++) {
unsigned count = op2.vmm16u(n) & 31;
unsigned count = op2.vmm32u(n) & 31;
if (count) {
dst.vmm32u(n) = (dst.vmm32u(n) >> count) | (op1.vmm32u(n) << (32 - count));
}
@ -866,7 +866,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::VPSHRDVQ_MASK_VdqHdqWdqR(bxInstruction_c *
unsigned len = i->getVL();
for (unsigned n=0; n < QWORD_ELEMENTS(len); n++) {
unsigned count = op2.vmm16u(n) & 63;
unsigned count = op2.vmm64u(n) & 63;
if (count) {
dst.vmm64u(n) = (dst.vmm64u(n) >> count) | (op1.vmm64u(n) << (64 - count));
}