summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/SIISelLowering.cpp
diff options
context:
space:
mode:
authorTom Stellard <[email protected]>2012-05-25 10:29:09 -0400
committerTom Stellard <[email protected]>2012-05-25 15:40:58 -0400
commit17f852892346fdf3b1e9eec56b7a55c470279bc8 (patch)
treef5ff63b1fde8173bff34d757bcdeb1c71311cad8 /src/gallium/drivers/radeon/SIISelLowering.cpp
parent2df2c31087770a6e4e79f90fe096e370cd632e00 (diff)
radeon/llvm: Use a custom inserter to lower FABS
Diffstat (limited to 'src/gallium/drivers/radeon/SIISelLowering.cpp')
-rw-r--r--src/gallium/drivers/radeon/SIISelLowering.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/SIISelLowering.cpp b/src/gallium/drivers/radeon/SIISelLowering.cpp
index 4615db24266..e192af091b6 100644
--- a/src/gallium/drivers/radeon/SIISelLowering.cpp
+++ b/src/gallium/drivers/radeon/SIISelLowering.cpp
@@ -45,6 +45,22 @@ MachineBasicBlock * SITargetLowering::EmitInstrWithCustomInserter(
switch (MI->getOpcode()) {
default:
return AMDGPUTargetLowering::EmitInstrWithCustomInserter(MI, BB);
+
+ case AMDIL::FABS_SI:
+ BuildMI(*BB, I, BB->findDebugLoc(I), TII->get(AMDIL::V_MOV_B32_e64))
+ .addOperand(MI->getOperand(0))
+ .addOperand(MI->getOperand(1))
+ /* VSRC1-2 are unused, but we still need to fill all the
+ * operand slots, so we just reuse the VSRC0 operand */
+ .addOperand(MI->getOperand(1))
+ .addOperand(MI->getOperand(1))
+ .addImm(1) // ABS
+ .addImm(0) // CLAMP
+ .addImm(0) // OMOD
+ .addImm(0); // NEG
+ MI->eraseFromParent();
+ break;
+
case AMDIL::SI_INTERP:
LowerSI_INTERP(MI, *BB, I, MRI);
break;