diff options
author | Tom Stellard <[email protected]> | 2012-07-26 17:10:47 +0000 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2012-08-15 18:35:25 +0000 |
commit | f3480f92349c90f55e2e80d9a4536ab048fb5652 (patch) | |
tree | 2c0e222b5962c449ab1a8806a2e0b8d6f0518d7a /src/gallium/drivers/radeon/R600ISelLowering.cpp | |
parent | a76a0f74225802f4d3f11028ab54afe98b26302b (diff) |
radeon/llvm: Lower store_output intrinsic during DAG lowering
Diffstat (limited to 'src/gallium/drivers/radeon/R600ISelLowering.cpp')
-rw-r--r-- | src/gallium/drivers/radeon/R600ISelLowering.cpp | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/src/gallium/drivers/radeon/R600ISelLowering.cpp b/src/gallium/drivers/radeon/R600ISelLowering.cpp index 7f79359fb21..4f2bfe3a714 100644 --- a/src/gallium/drivers/radeon/R600ISelLowering.cpp +++ b/src/gallium/drivers/radeon/R600ISelLowering.cpp @@ -37,6 +37,8 @@ R600TargetLowering::R600TargetLowering(TargetMachine &TM) : setOperationAction(ISD::FSUB, MVT::f32, Expand); + setOperationAction(ISD::INTRINSIC_VOID, MVT::Other, Custom); + setOperationAction(ISD::ROTL, MVT::i32, Custom); setOperationAction(ISD::SELECT_CC, MVT::f32, Custom); @@ -175,20 +177,6 @@ MachineBasicBlock * R600TargetLowering::EmitInstrWithCustomInserter( break; } - case AMDGPU::STORE_OUTPUT: - { - int64_t OutputIndex = MI->getOperand(1).getImm(); - unsigned OutputReg = AMDGPU::R600_TReg32RegClass.getRegister(OutputIndex); - - BuildMI(*BB, I, BB->findDebugLoc(I), TII->get(AMDGPU::COPY), OutputReg) - .addOperand(MI->getOperand(0)); - - if (!MRI.isLiveOut(OutputReg)) { - MRI.addLiveOut(OutputReg); - } - break; - } - case AMDGPU::RESERVE_REG: { R600MachineFunctionInfo * MFI = MF->getInfo<R600MachineFunctionInfo>(); @@ -285,6 +273,25 @@ SDValue R600TargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) const case ISD::ROTL: return LowerROTL(Op, DAG); case ISD::SELECT_CC: return LowerSELECT_CC(Op, DAG); case ISD::SETCC: return LowerSETCC(Op, DAG); + case ISD::INTRINSIC_VOID: { + SDValue Chain = Op.getOperand(0); + unsigned IntrinsicID = + cast<ConstantSDNode>(Op.getOperand(1))->getZExtValue(); + switch (IntrinsicID) { + case AMDGPUIntrinsic::AMDGPU_store_output: { + MachineFunction &MF = DAG.getMachineFunction(); + MachineRegisterInfo &MRI = MF.getRegInfo(); + int64_t RegIndex = cast<ConstantSDNode>(Op.getOperand(3))->getZExtValue(); + unsigned Reg = AMDGPU::R600_TReg32RegClass.getRegister(RegIndex); + if (!MRI.isLiveOut(Reg)) { + MRI.addLiveOut(Reg); + } + return DAG.getCopyToReg(Chain, Op.getDebugLoc(), Reg, Op.getOperand(2)); + } + default: return SDValue(); + } + break; + } } } |