radeon/llvm: Fix lowering of SI_V_CNDLT
authorTom Stellard <thomas.stellard@amd.com>
Tue, 4 Sep 2012 15:20:01 +0000 (11:20 -0400)
committerTom Stellard <thomas.stellard@amd.com>
Tue, 4 Sep 2012 18:21:10 +0000 (14:21 -0400)
SREG_LIT_0 is a scalar register, so it can only be used in the
first argument of vector instructoins.

src/gallium/drivers/radeon/SIISelLowering.cpp

index a64e2a378ff2ef910c0bae06e14082638334417a..2c8167382c7bcd9f247b43643e965cf53a05e2b7 100644 (file)
@@ -235,10 +235,10 @@ void SITargetLowering::LowerSI_KIL(MachineInstr *MI, MachineBasicBlock &BB,
 void SITargetLowering::LowerSI_V_CNDLT(MachineInstr *MI, MachineBasicBlock &BB,
     MachineBasicBlock::iterator I, MachineRegisterInfo & MRI) const
 {
-  BuildMI(BB, I, BB.findDebugLoc(I), TII->get(AMDGPU::V_CMP_LT_F32_e32),
+  BuildMI(BB, I, BB.findDebugLoc(I), TII->get(AMDGPU::V_CMP_GT_F32_e32),
           AMDGPU::VCC)
-          .addOperand(MI->getOperand(1))
-          .addReg(AMDGPU::SREG_LIT_0);
+          .addReg(AMDGPU::SREG_LIT_0)
+          .addOperand(MI->getOperand(1));
 
   BuildMI(BB, I, BB.findDebugLoc(I), TII->get(AMDGPU::V_CNDMASK_B32))
           .addOperand(MI->getOperand(0))