From ef8e66bc165ea2ef9987ab6406268ce195f74eb0 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Thu, 17 May 2012 14:34:40 -0400 Subject: radeon/llvm: Remove AMDIL MAD instruction defs --- src/gallium/drivers/radeon/AMDGPUGenInstrEnums.pl | 1 - src/gallium/drivers/radeon/AMDGPUISelLowering.cpp | 3 +++ src/gallium/drivers/radeon/AMDILInstructions.td | 2 -- src/gallium/drivers/radeon/R600Instructions.td | 6 +++--- src/gallium/drivers/radeon/SIInstrInfo.cpp | 1 - src/gallium/drivers/radeon/SIInstructions.td | 8 ++++++++ 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/radeon/AMDGPUGenInstrEnums.pl b/src/gallium/drivers/radeon/AMDGPUGenInstrEnums.pl index df532eb94b0..52b79bd5353 100644 --- a/src/gallium/drivers/radeon/AMDGPUGenInstrEnums.pl +++ b/src/gallium/drivers/radeon/AMDGPUGenInstrEnums.pl @@ -34,7 +34,6 @@ use strict; my @F32_MULTICLASSES = qw { UnaryIntrinsicFloat UnaryIntrinsicFloatScalar - TernaryIntrinsicFloat }; my @I32_MULTICLASSES = qw { diff --git a/src/gallium/drivers/radeon/AMDGPUISelLowering.cpp b/src/gallium/drivers/radeon/AMDGPUISelLowering.cpp index 921daa69dce..53f04c57de1 100644 --- a/src/gallium/drivers/radeon/AMDGPUISelLowering.cpp +++ b/src/gallium/drivers/radeon/AMDGPUISelLowering.cpp @@ -45,6 +45,9 @@ SDValue AMDGPUTargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op, default: return Op; case AMDGPUIntrinsic::AMDIL_abs: return LowerIntrinsicIABS(Op, DAG); + case AMDGPUIntrinsic::AMDIL_mad: + return DAG.getNode(AMDILISD::MAD, DL, VT, Op.getOperand(1), + Op.getOperand(2), Op.getOperand(3)); case AMDGPUIntrinsic::AMDIL_max: return DAG.getNode(AMDGPUISD::FMAX, DL, VT, Op.getOperand(1), Op.getOperand(2)); diff --git a/src/gallium/drivers/radeon/AMDILInstructions.td b/src/gallium/drivers/radeon/AMDILInstructions.td index 725ac29d4ba..629a2c0299a 100644 --- a/src/gallium/drivers/radeon/AMDILInstructions.td +++ b/src/gallium/drivers/radeon/AMDILInstructions.td @@ -251,7 +251,6 @@ defm POW : BinaryIntrinsicFloat; let hasIEEEFlag = 1 in { let mayLoad = 0, mayStore=0 in { defm MIN : BinaryIntrinsicFloat; -defm MAD : TernaryIntrinsicFloat; } defm MOD : BinaryOpMCf32; } @@ -270,7 +269,6 @@ defm LERP : TernaryIntrinsicFloat; } defm SUB : BinaryOpMCf32; defm FABS : UnaryOpMCf32; -defm FMAD : TernaryOpMCf32; defm NEAR : UnaryOpMCf32; defm RND_Z : UnaryOpMCf32; diff --git a/src/gallium/drivers/radeon/R600Instructions.td b/src/gallium/drivers/radeon/R600Instructions.td index 75ccca235de..df2d56bbde0 100644 --- a/src/gallium/drivers/radeon/R600Instructions.td +++ b/src/gallium/drivers/radeon/R600Instructions.td @@ -521,9 +521,9 @@ class MUL_LIT_Common inst> : R600_3OP < class MULADD_Common inst> : R600_3OP < inst, "MULADD", - []> { - let AMDILOp = AMDILInst.MAD_f32; -} + [(set (f32 R600_Reg32:$dst), + (IL_mad R600_Reg32:$src0, R600_Reg32:$src1, R600_Reg32:$src2))] +>; class CNDE_Common inst> : R600_3OP < inst, "CNDE", diff --git a/src/gallium/drivers/radeon/SIInstrInfo.cpp b/src/gallium/drivers/radeon/SIInstrInfo.cpp index 0cb97643a7f..553ac363b78 100644 --- a/src/gallium/drivers/radeon/SIInstrInfo.cpp +++ b/src/gallium/drivers/radeon/SIInstrInfo.cpp @@ -106,7 +106,6 @@ MachineInstr * SIInstrInfo::convertToISA(MachineInstr & MI, MachineFunction &MF, unsigned SIInstrInfo::getISAOpcode(unsigned AMDILopcode) const { switch (AMDILopcode) { - case AMDIL::MAD_f32: return AMDIL::V_MAD_LEGACY_F32; //XXX We need a better way of detecting end of program case AMDIL::RETURN: return AMDIL::S_ENDPGM; default: return AMDGPUInstrInfo::getISAOpcode(AMDILopcode); diff --git a/src/gallium/drivers/radeon/SIInstructions.td b/src/gallium/drivers/radeon/SIInstructions.td index c1c96999b0e..1818e472c60 100644 --- a/src/gallium/drivers/radeon/SIInstructions.td +++ b/src/gallium/drivers/radeon/SIInstructions.td @@ -964,4 +964,12 @@ def : Pat < /* XXX: We are using IEEE MUL, not the 0 * anything = 0 MUL, is this correct? */ def : POW_Common ; +/********** ================== **********/ +/********** VOP3 Patterns **********/ +/********** ================== **********/ + +def : Pat <(f32 (IL_mad AllReg_32:$src0, AllReg_32:$src1, AllReg_32:$src2)), + (V_MAD_LEGACY_F32 AllReg_32:$src0, AllReg_32:$src1, AllReg_32:$src2, + 0, 0, 0, 0)>; + } // End isSI predicate -- cgit v1.2.3