From c03102ae772ca933efb3e5c65f5fc3e1dd852f6f Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Sat, 26 Sep 2015 02:25:48 +0000 Subject: [PATCH] AMDGPU: VOP3b definition cleanups git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248647 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/AMDGPU/SIInstrInfo.td | 35 ++++++++++++++++------------- lib/Target/AMDGPU/SIInstructions.td | 8 +++++-- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/lib/Target/AMDGPU/SIInstrInfo.td b/lib/Target/AMDGPU/SIInstrInfo.td index dcc44b82627..777d3a23c29 100644 --- a/lib/Target/AMDGPU/SIInstrInfo.td +++ b/lib/Target/AMDGPU/SIInstrInfo.td @@ -1190,6 +1190,21 @@ def VOP2b_I32_I1_I32_I32_I1 : VOPProfile<[i32, i32, i32, i1]> { let Ins32 = (ins Src0RC32:$src0, Src1RC32:$src1); } +class VOP3b_Profile : VOPProfile<[vt, vt, vt, vt]> { + let Outs64 = (outs DstRC:$vdst, SReg_64:$sdst); + let Asm64 = "$vdst, $sdst, $src0_modifiers, $src1_modifiers, $src2_modifiers"#"$clamp"#"$omod"; +} + +def VOP3b_F32_I1_F32_F32_F32 : VOP3b_Profile { + // FIXME: Hack to stop printing _e64 + let DstRC = RegisterOperand; +} + +def VOP3b_F64_I1_F64_F64_F64 : VOP3b_Profile { + // FIXME: Hack to stop printing _e64 + let DstRC = RegisterOperand; +} + // VOPC instructions are a special case because for the 32-bit // encoding, we want to display the implicit vcc write as if it were // an explicit $dst. @@ -1894,25 +1909,13 @@ multiclass VOP3_VCC_Inst ; -multiclass VOP3b_Helper pattern> : +multiclass VOP3bInst pattern = []> : VOP3b_2_3_m < - op, (outs vrc:$vdst, SReg_64:$sdst), - (ins InputModsNoDefault:$src0_modifiers, arc:$src0, - InputModsNoDefault:$src1_modifiers, arc:$src1, - InputModsNoDefault:$src2_modifiers, arc:$src2, - ClampMod:$clamp, omod:$omod), - opName#" $vdst, $sdst, $src0_modifiers, $src1_modifiers, $src2_modifiers"#"$clamp"#"$omod", pattern, - opName, opName, 1, 1 + op, P.Outs64, P.Ins64, + opName#" "#P.Asm64, pattern, + opName, "", 1, 1 >; -multiclass VOP3b_64 pattern> : - VOP3b_Helper ; - -multiclass VOP3b_32 pattern> : - VOP3b_Helper ; - - class Vop3ModPat : Pat< (node (P.Src0VT (VOP3Mods0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp, i32:$omod)), (P.Src1VT (VOP3Mods P.Src1VT:$src1, i32:$src1_modifiers)), diff --git a/lib/Target/AMDGPU/SIInstructions.td b/lib/Target/AMDGPU/SIInstructions.td index 796e21fdf6d..2a5047759b7 100644 --- a/lib/Target/AMDGPU/SIInstructions.td +++ b/lib/Target/AMDGPU/SIInstructions.td @@ -1768,12 +1768,16 @@ defm V_MUL_HI_I32 : VOP3Inst , "v_mul_hi_i32", } // isCommutable = 1, SchedRW = [WriteQuarterRate32] let SchedRW = [WriteFloatFMA, WriteSALU] in { -defm V_DIV_SCALE_F32 : VOP3b_32 , "v_div_scale_f32", []>; +defm V_DIV_SCALE_F32 : VOP3bInst , "v_div_scale_f32", + VOP3b_F32_I1_F32_F32_F32 +>; } let SchedRW = [WriteDouble, WriteSALU] in { // Double precision division pre-scale. -defm V_DIV_SCALE_F64 : VOP3b_64 , "v_div_scale_f64", []>; +defm V_DIV_SCALE_F64 : VOP3bInst , "v_div_scale_f64", + VOP3b_F64_I1_F64_F64_F64 +>; } // let SchedRW = [WriteDouble] let isCommutable = 1, Uses = [VCC, EXEC] in { -- 2.34.1