mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-02 10:33:53 +00:00
R600: Use c++11 style for loop
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <tom@stellard.net> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230987 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a2541bd006
commit
e8676a29bb
@ -268,9 +268,8 @@ int R600InstrInfo::getSrcIdx(unsigned Opcode, unsigned SrcNum) const {
|
||||
return getOperandIdx(Opcode, OpTable[SrcNum]);
|
||||
}
|
||||
|
||||
#define SRC_SEL_ROWS 11
|
||||
int R600InstrInfo::getSelIdx(unsigned Opcode, unsigned SrcIdx) const {
|
||||
static const unsigned SrcSelTable[SRC_SEL_ROWS][2] = {
|
||||
static const unsigned SrcSelTable[][2] = {
|
||||
{AMDGPU::OpName::src0, AMDGPU::OpName::src0_sel},
|
||||
{AMDGPU::OpName::src1, AMDGPU::OpName::src1_sel},
|
||||
{AMDGPU::OpName::src2, AMDGPU::OpName::src2_sel},
|
||||
@ -284,14 +283,13 @@ int R600InstrInfo::getSelIdx(unsigned Opcode, unsigned SrcIdx) const {
|
||||
{AMDGPU::OpName::src1_W, AMDGPU::OpName::src1_sel_W}
|
||||
};
|
||||
|
||||
for (unsigned i = 0; i < SRC_SEL_ROWS; ++i) {
|
||||
if (getOperandIdx(Opcode, SrcSelTable[i][0]) == (int)SrcIdx) {
|
||||
return getOperandIdx(Opcode, SrcSelTable[i][1]);
|
||||
for (const auto &Row : SrcSelTable) {
|
||||
if (getOperandIdx(Opcode, Row[0]) == (int)SrcIdx) {
|
||||
return getOperandIdx(Opcode, Row[1]);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
#undef SRC_SEL_ROWS
|
||||
|
||||
SmallVector<std::pair<MachineOperand *, int64_t>, 3>
|
||||
R600InstrInfo::getSrcs(MachineInstr *MI) const {
|
||||
|
Loading…
x
Reference in New Issue
Block a user