OSDN Git Service

[mips][msa] Prevent output operand from commuting for dpadd_[su].df ins
authorPetar Jovanovic <petar.jovanovic@imgtec.com>
Fri, 31 Mar 2017 14:31:55 +0000 (14:31 +0000)
committerPetar Jovanovic <petar.jovanovic@imgtec.com>
Fri, 31 Mar 2017 14:31:55 +0000 (14:31 +0000)
commit7fb9f75fc3cb240b19cbc7a219e2f64d668a3f38
tree69e032b79026d163a92bee89ca00d1c0b7180f0e
parent1cbe5a4d1dccd9bd478e98a335088365d0c3bdb6
[mips][msa] Prevent output operand from commuting for dpadd_[su].df ins

Implementation of TargetInstrInfo::findCommutedOpIndices for MIPS target,
restricting commutativity to second and third operand only for
dpaadd_[su].df instructions therein.

Prior to this change, there were cases where the vector that is to be added
to the dot product of the other two could take a position other than the
first one in the instruction, generating false output in the destination
vector.

Such behavior has been noticed in the two functions generating v2i64 output
values so far. Other ones may exhibit such behavior as well, just not for
the vector operands which are present in the test at the moment.

Tests altered so that the function's first operand is a constant splat so
that it can be loaded with a ldi instruction, since that is the case in
which the erroneous instruction operand placement has occurred. We check
that the register which is present in the ldi instruction is placed as the
first operand in the corresponding dpadd instruction.

Patch by Stefan Maksimovic.

Differential Revision: https://reviews.llvm.org/D30827

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299223 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/MipsInstrInfo.cpp
lib/Target/Mips/MipsInstrInfo.h
test/CodeGen/Mips/msa/3r_4r_widen.ll