Commit 416cfb9f by Nicolas Capens Committed by Nicolas Capens

Fix vector packing pseudo-instruction.

When the first source register is different from the destination register, but equal to the second source, we need to first narrow the second source to prevent overwriting data we still need. Similar when the destination is equal to the first source. Bug b/37496082 Change-Id: I908a8e125a77ec4bf1eb5eab9e48c6112ee4ca13 Reviewed-on: https://chromium-review.googlesource.com/696032Reviewed-by: 's avatarJim Stichnoth <stichnot@chromium.org> Reviewed-on: https://swiftshader-review.googlesource.com/12949Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 355a5dc1
...@@ -3731,16 +3731,15 @@ void AssemblerARM32::vqmovn2(Type DestElmtTy, const Operand *OpQd, ...@@ -3731,16 +3731,15 @@ void AssemblerARM32::vqmovn2(Type DestElmtTy, const Operand *OpQd,
VqmovnOpcode |= (encodeElmtType(DestElmtTy) << ElmtShift); VqmovnOpcode |= (encodeElmtType(DestElmtTy) << ElmtShift);
if (Qm != Qd) { if (Qm != Qd) {
// Narrow first source operand to lower half of destination.
emitSIMDBase(VqmovnOpcode, Dd + 0, 0, Dm, UseQRegs, IsFloatTy);
// Narrow second source operand to upper half of destination. // Narrow second source operand to upper half of destination.
emitSIMDBase(VqmovnOpcode, Dd + 1, 0, Dn, UseQRegs, IsFloatTy); emitSIMDBase(VqmovnOpcode, Dd + 1, 0, Dn, UseQRegs, IsFloatTy);
// Narrow first source operand to lower half of destination.
emitSIMDBase(VqmovnOpcode, Dd + 0, 0, Dm, UseQRegs, IsFloatTy);
} else if (Qn != Qd) { } else if (Qn != Qd) {
// Narrow second source operand to upper half of destination.
emitSIMDBase(VqmovnOpcode, Dd + 1, 0, Dn, UseQRegs, IsFloatTy);
// Narrow first source operand to lower half of destination. // Narrow first source operand to lower half of destination.
emitSIMDBase(VqmovnOpcode, Dd + 0, 0, Dm, UseQRegs, IsFloatTy); emitSIMDBase(VqmovnOpcode, Dd + 0, 0, Dm, UseQRegs, IsFloatTy);
// Narrow second source operand to upper half of destination.
emitSIMDBase(VqmovnOpcode, Dd + 1, 0, Dn, UseQRegs, IsFloatTy);
} else { } else {
// Narrow first source operand to lower half of destination. // Narrow first source operand to lower half of destination.
emitSIMDBase(VqmovnOpcode, Dd, 0, Dm, UseQRegs, IsFloatTy); emitSIMDBase(VqmovnOpcode, Dd, 0, Dm, UseQRegs, IsFloatTy);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment