radeon/llvm: Expand fsub during ISel
authorTom Stellard <thomas.stellard@amd.com>
Thu, 17 May 2012 17:13:17 +0000 (13:13 -0400)
committerTom Stellard <thomas.stellard@amd.com>
Thu, 17 May 2012 18:48:09 +0000 (14:48 -0400)
src/gallium/drivers/radeon/R600ISelLowering.cpp
src/gallium/drivers/radeon/R600LowerInstructions.cpp

index 4db40f799ede6e79f7e44d55ac6d07e6d0014d54..1fffb99c601bf0b14c7952d43a909a645a96b7f1 100644 (file)
@@ -34,6 +34,8 @@ R600TargetLowering::R600TargetLowering(TargetMachine &TM) :
   setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v4f32, Legal);
   setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v4i32, Legal);
   setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v4i32, Legal);
+
+  setOperationAction(ISD::FSUB, MVT::f32, Expand);
 }
 
 MachineBasicBlock * R600TargetLowering::EmitInstrWithCustomInserter(
index 19c3aae1e61c938eb3235ddc1eb807015a18ded0..a5f57cc1d36e3e6b3ad808493dbff130820d92d2 100644 (file)
@@ -303,17 +303,6 @@ bool R600LowerInstructionsPass::runOnMachineFunction(MachineFunction &MF)
           break;
         }
 
-      case AMDIL::SUB_f32:
-        {
-          MI.getOperand(2).addTargetFlag(MO_FLAG_NEG);
-          BuildMI(MBB, I, MBB.findDebugLoc(I),
-                          TII->get(TII->getISAOpcode(AMDIL::ADD)))
-                  .addOperand(MI.getOperand(0))
-                  .addOperand(MI.getOperand(1))
-                  .addOperand(MI.getOperand(2));
-          break;
-        }
-
       case AMDIL::ULT:
         BuildMI(MBB, I, MBB.findDebugLoc(I), TII->get(AMDIL::SETGT_UINT))
                 .addOperand(MI.getOperand(0))