From 0c9f5f22d5cf3cad01ee3685116011ff7ff67140 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 6 Jun 2012 11:40:34 -0400 Subject: radeon/llvm: Remove some duplicate code in the R600 CodeEmitter --- src/gallium/drivers/radeon/R600CodeEmitter.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/radeon/R600CodeEmitter.cpp b/src/gallium/drivers/radeon/R600CodeEmitter.cpp index 42d79188289..3b7ca2c2398 100644 --- a/src/gallium/drivers/radeon/R600CodeEmitter.cpp +++ b/src/gallium/drivers/radeon/R600CodeEmitter.cpp @@ -162,6 +162,7 @@ bool R600CodeEmitter::runOnMachineFunction(MachineFunction &MF) { MachineInstr &MI = *I; isReduction = AMDGPU::isReductionOp(MI.getOpcode()); isVector = TII->isVector(MI); + isCube = AMDGPU::isCubeOp(MI.getOpcode()); if (MI.getNumOperands() > 1 && MI.getOperand(0).isReg() && MI.getOperand(0).isDead()) { continue; } @@ -169,7 +170,7 @@ bool R600CodeEmitter::runOnMachineFunction(MachineFunction &MF) { emitTexInstr(MI); } else if (AMDGPU::isFCOp(MI.getOpcode())){ emitFCInstr(MI); - } else if (isReduction || isVector) { + } else if (isReduction || isVector || isCube) { isLast = false; for (currentElement = 0; currentElement < 4; currentElement++) { isLast = (currentElement == 3); @@ -177,14 +178,7 @@ bool R600CodeEmitter::runOnMachineFunction(MachineFunction &MF) { } isReduction = false; isVector = false; - } else if (AMDGPU::isCubeOp(MI.getOpcode())) { - isCube = true; - isLast = false; - for (currentElement = 0; currentElement < 4; currentElement++) { - isLast = (currentElement == 3); - emitALUInstr(MI); - } - isCube = false; + isCube = false; } else if (MI.getOpcode() == AMDIL::RETURN || MI.getOpcode() == AMDIL::BUNDLE || MI.getOpcode() == AMDIL::KILL) { -- cgit v1.2.3