From f56c55d003f1333977f325f154fa48aa05baa609 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Mon, 11 Aug 2014 22:18:14 +0000 Subject: [PATCH] R600/SI: Add an _OFFEN variant MUBUF_STORE_* and use it for scratch writes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215398 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/R600/SIInstrInfo.td | 35 +++++++++++++++++++++---------- lib/Target/R600/SIInstructions.td | 18 +++++++--------- 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/lib/Target/R600/SIInstrInfo.td b/lib/Target/R600/SIInstrInfo.td index dfc7a598f3f..9214ecc1e25 100644 --- a/lib/Target/R600/SIInstrInfo.td +++ b/lib/Target/R600/SIInstrInfo.td @@ -967,17 +967,30 @@ multiclass MUBUF_Load_Helper op, string asm, RegisterClass regClass, multiclass MUBUF_Store_Helper op, string name, RegisterClass vdataClass, ValueType store_vt, SDPatternOperator st> { - def "" : MUBUF < - op, (outs), - (ins vdataClass:$vdata, SReg_128:$srsrc, VReg_32:$vaddr, SSrc_32:$soffset, - mbuf_offset:$offset, offen:$offen, idxen:$idxen, glc:$glc, slc:$slc, - tfe:$tfe), - name#" $vdata, $vaddr, $srsrc, $soffset"#"$offen"#"$idxen"#"$offset"#"$glc"#"$slc"#"$tfe", - [] - > { - let lds = 0; - let addr64 = 0; - } + let addr64 = 0, lds = 0 in { + + def "" : MUBUF < + op, (outs), + (ins vdataClass:$vdata, SReg_128:$srsrc, VReg_32:$vaddr, SSrc_32:$soffset, + mbuf_offset:$offset, offen:$offen, idxen:$idxen, glc:$glc, slc:$slc, + tfe:$tfe), + name#" $vdata, $vaddr, $srsrc, $soffset"#"$offen"#"$idxen"#"$offset"# + "$glc"#"$slc"#"$tfe", + [] + >; + + let offen = 1, idxen = 0 in { + def _OFFEN : MUBUF < + op, (outs), + (ins vdataClass:$vdata, SReg_128:$srsrc, VReg_32:$vaddr, SSrc_32:$soffset, + mbuf_offset:$offset, glc:$glc, slc:$slc, tfe:$tfe), + name#" $vdata, $vaddr, $srsrc, $soffset offen"#"$offset"# + "$glc"#"$slc"#"$tfe", + [] + >; + } // end offen = 1, idxen = 0 + + } // End addr64 = 0, lds = 0 def _ADDR64 : MUBUF < op, (outs), diff --git a/lib/Target/R600/SIInstructions.td b/lib/Target/R600/SIInstructions.td index 4d4abcd2032..7371365f103 100644 --- a/lib/Target/R600/SIInstructions.td +++ b/lib/Target/R600/SIInstructions.td @@ -2717,18 +2717,16 @@ defm : MUBUF_Load_Dword ; class MUBUFScratchStorePat : Pat < - (st vt:$value, (MUBUFAddr32 v4i32:$srsrc, i32:$vaddr, i32:$soffset, - u16imm:$offset, i1imm:$offen, i1imm:$idxen, - i1imm:$glc, i1imm:$slc, i1imm:$tfe)), - (Instr $value, $srsrc, $vaddr, $soffset, $offset, $offen, $idxen, - $glc, $slc, $tfe) + (st vt:$value, (MUBUFScratch v4i32:$srsrc, i32:$vaddr, i32:$soffset, + u16imm:$offset)), + (Instr $value, $srsrc, $vaddr, $soffset, $offset, 0, 0, 0) >; -def : MUBUFScratchStorePat ; -def : MUBUFScratchStorePat ; -def : MUBUFScratchStorePat ; -def : MUBUFScratchStorePat ; -def : MUBUFScratchStorePat ; +def : MUBUFScratchStorePat ; +def : MUBUFScratchStorePat ; +def : MUBUFScratchStorePat ; +def : MUBUFScratchStorePat ; +def : MUBUFScratchStorePat ; /* class MUBUFStore_Pattern : Pat <