From 63fab54fac2b31f32b7f8bde035c296bfb9b11bf Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Sat, 2 Aug 2014 01:10:28 +0000 Subject: [PATCH] R600/SI: Fix formatting. Avoid weird line wrapping of BuildMI dest register. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214608 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/R600/SIISelLowering.cpp | 50 +++++++++++++++++------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/lib/Target/R600/SIISelLowering.cpp b/lib/Target/R600/SIISelLowering.cpp index 36afe5792a3..f031e6e53a4 100644 --- a/lib/Target/R600/SIISelLowering.cpp +++ b/lib/Target/R600/SIISelLowering.cpp @@ -587,14 +587,16 @@ MachineBasicBlock * SITargetLowering::EmitInstrWithCustomInserter( MachineRegisterInfo &MRI = BB->getParent()->getRegInfo(); const SIInstrInfo *TII = static_cast(getTargetMachine().getInstrInfo()); + + DebugLoc DL = MI->getDebugLoc(); + unsigned DestReg = MI->getOperand(0).getReg(); unsigned Reg = MRI.createVirtualRegister(&AMDGPU::VReg_32RegClass); - BuildMI(*BB, I, MI->getDebugLoc(), TII->get(AMDGPU::V_MOV_B32_e32), - Reg) - .addImm(0x7fffffff); - BuildMI(*BB, I, MI->getDebugLoc(), TII->get(AMDGPU::V_AND_B32_e32), - MI->getOperand(0).getReg()) - .addReg(MI->getOperand(1).getReg()) - .addReg(Reg); + + BuildMI(*BB, I, DL, TII->get(AMDGPU::V_MOV_B32_e32), Reg) + .addImm(0x7fffffff); + BuildMI(*BB, I, DL, TII->get(AMDGPU::V_AND_B32_e32), DestReg) + .addReg(MI->getOperand(1).getReg()) + .addReg(Reg); MI->eraseFromParent(); break; } @@ -602,28 +604,32 @@ MachineBasicBlock * SITargetLowering::EmitInstrWithCustomInserter( MachineRegisterInfo &MRI = BB->getParent()->getRegInfo(); const SIInstrInfo *TII = static_cast(getTargetMachine().getInstrInfo()); + + DebugLoc DL = MI->getDebugLoc(); + unsigned DestReg = MI->getOperand(0).getReg(); unsigned Reg = MRI.createVirtualRegister(&AMDGPU::VReg_32RegClass); - BuildMI(*BB, I, MI->getDebugLoc(), TII->get(AMDGPU::V_MOV_B32_e32), - Reg) - .addImm(0x80000000); - BuildMI(*BB, I, MI->getDebugLoc(), TII->get(AMDGPU::V_XOR_B32_e32), - MI->getOperand(0).getReg()) - .addReg(MI->getOperand(1).getReg()) - .addReg(Reg); + + BuildMI(*BB, I, DL, TII->get(AMDGPU::V_MOV_B32_e32), Reg) + .addImm(0x80000000); + BuildMI(*BB, I, DL, TII->get(AMDGPU::V_XOR_B32_e32), DestReg) + .addReg(MI->getOperand(1).getReg()) + .addReg(Reg); MI->eraseFromParent(); break; } case AMDGPU::FCLAMP_SI: { const SIInstrInfo *TII = static_cast(getTargetMachine().getInstrInfo()); - BuildMI(*BB, I, MI->getDebugLoc(), TII->get(AMDGPU::V_ADD_F32_e64), - MI->getOperand(0).getReg()) - .addImm(0) // SRC0 modifiers - .addOperand(MI->getOperand(1)) - .addImm(0) // SRC1 modifiers - .addImm(0) // SRC1 - .addImm(1) // CLAMP - .addImm(0); // OMOD + + DebugLoc DL = MI->getDebugLoc(); + unsigned DestReg = MI->getOperand(0).getReg(); + BuildMI(*BB, I, DL, TII->get(AMDGPU::V_ADD_F32_e64), DestReg) + .addImm(0) // SRC0 modifiers + .addOperand(MI->getOperand(1)) + .addImm(0) // SRC1 modifiers + .addImm(0) // SRC1 + .addImm(1) // CLAMP + .addImm(0); // OMOD MI->eraseFromParent(); } }