From 352fa59ec3537ea37a834e5e0c38a3ed8c62beb3 Mon Sep 17 00:00:00 2001 From: Marek Olsak Date: Thu, 15 Jan 2015 18:42:55 +0000 Subject: [PATCH] R600/SI: Add V_READLANE_B32 and V_WRITELANE_B32 for VI These are VOP3-only on VI. The new multiclass doesn't define VOP3 versions of VOP2 instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226189 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/R600/SIInstrInfo.td | 17 +++++++++++++++++ lib/Target/R600/SIInstructions.td | 22 +++++++++++----------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/lib/Target/R600/SIInstrInfo.td b/lib/Target/R600/SIInstrInfo.td index 542ed161bcc..a2efd9441c0 100644 --- a/lib/Target/R600/SIInstrInfo.td +++ b/lib/Target/R600/SIInstrInfo.td @@ -998,6 +998,23 @@ multiclass VOP3_C_m pattern = []> { + let isPseudo = 1 in { + def "" : VOPAnyCommon , + SIMCInstr; + } + + def _si : VOP2 , + SIMCInstr ; + + def _vi : VOP3Common , + VOP3e_vi , + VOP3DisableFields <1, 0, 0>, + SIMCInstr ; +} + multiclass VOP1_Helper pat32, dag ins64, string asm64, list pat64, diff --git a/lib/Target/R600/SIInstructions.td b/lib/Target/R600/SIInstructions.td index 668999c8360..c5c9306e991 100644 --- a/lib/Target/R600/SIInstructions.td +++ b/lib/Target/R600/SIInstructions.td @@ -1525,25 +1525,25 @@ defm V_SUBBREV_U32 : VOP2bInst , "v_subbrev_u32", } // End Uses = [VCC] } // End isCommutable = 1, Defs = [VCC] -// These instructions only exist on SI and CI -let SubtargetPredicate = isSICI in { - -def V_READLANE_B32 : VOP2 < - 0x00000001, +defm V_READLANE_B32 : VOP2SI_3VI_m < + vop3 <0x001, 0x289>, + "v_readlane_b32", (outs SReg_32:$vdst), (ins VGPR_32:$src0, SSrc_32:$vsrc1), - "v_readlane_b32 $vdst, $src0, $vsrc1", - [] + "v_readlane_b32 $vdst, $src0, $vsrc1" >; -def V_WRITELANE_B32 : VOP2 < - 0x00000002, +defm V_WRITELANE_B32 : VOP2SI_3VI_m < + vop3 <0x002, 0x28a>, + "v_writelane_b32", (outs VGPR_32:$vdst), (ins SReg_32:$src0, SSrc_32:$vsrc1), - "v_writelane_b32 $vdst, $src0, $vsrc1", - [] + "v_writelane_b32 $vdst, $src0, $vsrc1" >; +// These instructions only exist on SI and CI +let SubtargetPredicate = isSICI in { + let isCommutable = 1 in { defm V_MAC_LEGACY_F32 : VOP2Inst , "v_mac_legacy_f32", VOP_F32_F32_F32