diff options
author | Tom Stellard <[email protected]> | 2012-05-25 10:50:35 -0400 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2012-05-25 15:40:58 -0400 |
commit | d784bc77405012b442ae9d68f200e9d115030b3c (patch) | |
tree | 7d8b857f99d40f7e26e7f597385c53a6f7c227ee /src/gallium/drivers/radeon/SIISelLowering.cpp | |
parent | 17f852892346fdf3b1e9eec56b7a55c470279bc8 (diff) |
radeon/llvm: Use a custom inserter to lower CLAMP
Diffstat (limited to 'src/gallium/drivers/radeon/SIISelLowering.cpp')
-rw-r--r-- | src/gallium/drivers/radeon/SIISelLowering.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/SIISelLowering.cpp b/src/gallium/drivers/radeon/SIISelLowering.cpp index e192af091b6..2455b536f9f 100644 --- a/src/gallium/drivers/radeon/SIISelLowering.cpp +++ b/src/gallium/drivers/radeon/SIISelLowering.cpp @@ -46,6 +46,21 @@ MachineBasicBlock * SITargetLowering::EmitInstrWithCustomInserter( default: return AMDGPUTargetLowering::EmitInstrWithCustomInserter(MI, BB); + case AMDIL::CLAMP_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(0) // ABS + .addImm(1) // CLAMP + .addImm(0) // OMOD + .addImm(0); // NEG + MI->eraseFromParent(); + break; + case AMDIL::FABS_SI: BuildMI(*BB, I, BB->findDebugLoc(I), TII->get(AMDIL::V_MOV_B32_e64)) .addOperand(MI->getOperand(0)) |