mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 12:43:36 +01:00
AMDGPU: Rename _RTN atomic instructions
Move the _RTN to the end of the name. It reads better if the other addressing mode components line up with the non-RTN version. It is also more convenient to define saddr variants of FLAT atomics to have the RTN last, and it is good to have a consistent naming scheme. llvm-svn: 308674
This commit is contained in:
parent
f1cce1cf54
commit
c6db825207
@ -1655,8 +1655,8 @@ void AMDGPUDAGToDAGISel::SelectATOMIC_CMP_SWAP(SDNode *N) {
|
||||
SDValue SRsrc, VAddr, SOffset, Offset, GLC, SLC;
|
||||
|
||||
if (SelectMUBUFAddr64(Mem->getBasePtr(), SRsrc, VAddr, SOffset, Offset, SLC)) {
|
||||
unsigned Opcode = Is32 ? AMDGPU::BUFFER_ATOMIC_CMPSWAP_RTN_ADDR64 :
|
||||
AMDGPU::BUFFER_ATOMIC_CMPSWAP_X2_RTN_ADDR64;
|
||||
unsigned Opcode = Is32 ? AMDGPU::BUFFER_ATOMIC_CMPSWAP_ADDR64_RTN :
|
||||
AMDGPU::BUFFER_ATOMIC_CMPSWAP_X2_ADDR64_RTN;
|
||||
SDValue CmpVal = Mem->getOperand(2);
|
||||
|
||||
// XXX - Do we care about glue operands?
|
||||
@ -1672,8 +1672,8 @@ void AMDGPUDAGToDAGISel::SelectATOMIC_CMP_SWAP(SDNode *N) {
|
||||
if (!CmpSwap) {
|
||||
SDValue SRsrc, SOffset, Offset, SLC;
|
||||
if (SelectMUBUFOffset(Mem->getBasePtr(), SRsrc, SOffset, Offset, SLC)) {
|
||||
unsigned Opcode = Is32 ? AMDGPU::BUFFER_ATOMIC_CMPSWAP_RTN_OFFSET :
|
||||
AMDGPU::BUFFER_ATOMIC_CMPSWAP_X2_RTN_OFFSET;
|
||||
unsigned Opcode = Is32 ? AMDGPU::BUFFER_ATOMIC_CMPSWAP_OFFSET_RTN :
|
||||
AMDGPU::BUFFER_ATOMIC_CMPSWAP_X2_OFFSET_RTN;
|
||||
|
||||
SDValue CmpVal = Mem->getOperand(2);
|
||||
SDValue Ops[] = {
|
||||
|
@ -617,21 +617,21 @@ multiclass MUBUF_Pseudo_Atomics <string opName,
|
||||
def _IDXEN : MUBUF_AtomicNoRet_Pseudo <opName, BUFAddrKind.IdxEn, vdataClass>;
|
||||
def _BOTHEN : MUBUF_AtomicNoRet_Pseudo <opName, BUFAddrKind.BothEn, vdataClass>;
|
||||
|
||||
def _RTN_OFFSET : MUBUF_AtomicRet_Pseudo <opName, BUFAddrKind.Offset, vdataClass,
|
||||
def _OFFSET_RTN : MUBUF_AtomicRet_Pseudo <opName, BUFAddrKind.Offset, vdataClass,
|
||||
[(set vdataType:$vdata,
|
||||
(atomic (MUBUFOffsetAtomic v4i32:$srsrc, i32:$soffset, i16:$offset, i1:$slc),
|
||||
vdataType:$vdata_in))]>,
|
||||
MUBUFAddr64Table <0, "_RTN">;
|
||||
|
||||
def _RTN_ADDR64 : MUBUF_AtomicRet_Pseudo <opName, BUFAddrKind.Addr64, vdataClass,
|
||||
def _ADDR64_RTN : MUBUF_AtomicRet_Pseudo <opName, BUFAddrKind.Addr64, vdataClass,
|
||||
[(set vdataType:$vdata,
|
||||
(atomic (MUBUFAddr64Atomic v4i32:$srsrc, i64:$vaddr, i32:$soffset, i16:$offset, i1:$slc),
|
||||
vdataType:$vdata_in))]>,
|
||||
MUBUFAddr64Table <1, "_RTN">;
|
||||
|
||||
def _RTN_OFFEN : MUBUF_AtomicRet_Pseudo <opName, BUFAddrKind.OffEn, vdataClass>;
|
||||
def _RTN_IDXEN : MUBUF_AtomicRet_Pseudo <opName, BUFAddrKind.IdxEn, vdataClass>;
|
||||
def _RTN_BOTHEN : MUBUF_AtomicRet_Pseudo <opName, BUFAddrKind.BothEn, vdataClass>;
|
||||
def _OFFEN_RTN : MUBUF_AtomicRet_Pseudo <opName, BUFAddrKind.OffEn, vdataClass>;
|
||||
def _IDXEN_RTN : MUBUF_AtomicRet_Pseudo <opName, BUFAddrKind.IdxEn, vdataClass>;
|
||||
def _BOTHEN_RTN : MUBUF_AtomicRet_Pseudo <opName, BUFAddrKind.BothEn, vdataClass>;
|
||||
}
|
||||
|
||||
|
||||
@ -951,7 +951,7 @@ multiclass BufferAtomicPatterns<SDPatternOperator name, string opcode> {
|
||||
(name i32:$vdata_in, v4i32:$rsrc, 0,
|
||||
(MUBUFIntrinsicOffset i32:$soffset, i16:$offset),
|
||||
imm:$slc),
|
||||
(!cast<MUBUF_Pseudo>(opcode # _RTN_OFFSET) $vdata_in, $rsrc, $soffset,
|
||||
(!cast<MUBUF_Pseudo>(opcode # _OFFSET_RTN) $vdata_in, $rsrc, $soffset,
|
||||
(as_i16imm $offset), (as_i1imm $slc))
|
||||
>;
|
||||
|
||||
@ -959,7 +959,7 @@ multiclass BufferAtomicPatterns<SDPatternOperator name, string opcode> {
|
||||
(name i32:$vdata_in, v4i32:$rsrc, i32:$vindex,
|
||||
(MUBUFIntrinsicOffset i32:$soffset, i16:$offset),
|
||||
imm:$slc),
|
||||
(!cast<MUBUF_Pseudo>(opcode # _RTN_IDXEN) $vdata_in, $vindex, $rsrc, $soffset,
|
||||
(!cast<MUBUF_Pseudo>(opcode # _IDXEN_RTN) $vdata_in, $vindex, $rsrc, $soffset,
|
||||
(as_i16imm $offset), (as_i1imm $slc))
|
||||
>;
|
||||
|
||||
@ -967,7 +967,7 @@ multiclass BufferAtomicPatterns<SDPatternOperator name, string opcode> {
|
||||
(name i32:$vdata_in, v4i32:$rsrc, 0,
|
||||
(MUBUFIntrinsicVOffset i32:$soffset, i16:$offset, i32:$voffset),
|
||||
imm:$slc),
|
||||
(!cast<MUBUF_Pseudo>(opcode # _RTN_OFFEN) $vdata_in, $voffset, $rsrc, $soffset,
|
||||
(!cast<MUBUF_Pseudo>(opcode # _OFFEN_RTN) $vdata_in, $voffset, $rsrc, $soffset,
|
||||
(as_i16imm $offset), (as_i1imm $slc))
|
||||
>;
|
||||
|
||||
@ -975,7 +975,7 @@ multiclass BufferAtomicPatterns<SDPatternOperator name, string opcode> {
|
||||
(name i32:$vdata_in, v4i32:$rsrc, i32:$vindex,
|
||||
(MUBUFIntrinsicVOffset i32:$soffset, i16:$offset, i32:$voffset),
|
||||
imm:$slc),
|
||||
(!cast<MUBUF_Pseudo>(opcode # _RTN_BOTHEN)
|
||||
(!cast<MUBUF_Pseudo>(opcode # _BOTHEN_RTN)
|
||||
$vdata_in,
|
||||
(REG_SEQUENCE VReg_64, $vindex, sub0, $voffset, sub1),
|
||||
$rsrc, $soffset, (as_i16imm $offset), (as_i1imm $slc))
|
||||
@ -999,7 +999,7 @@ def : Pat<
|
||||
(MUBUFIntrinsicOffset i32:$soffset, i16:$offset),
|
||||
imm:$slc),
|
||||
(EXTRACT_SUBREG
|
||||
(BUFFER_ATOMIC_CMPSWAP_RTN_OFFSET
|
||||
(BUFFER_ATOMIC_CMPSWAP_OFFSET_RTN
|
||||
(REG_SEQUENCE VReg_64, $data, sub0, $cmp, sub1),
|
||||
$rsrc, $soffset, (as_i16imm $offset), (as_i1imm $slc)),
|
||||
sub0)
|
||||
@ -1011,7 +1011,7 @@ def : Pat<
|
||||
(MUBUFIntrinsicOffset i32:$soffset, i16:$offset),
|
||||
imm:$slc),
|
||||
(EXTRACT_SUBREG
|
||||
(BUFFER_ATOMIC_CMPSWAP_RTN_IDXEN
|
||||
(BUFFER_ATOMIC_CMPSWAP_IDXEN_RTN
|
||||
(REG_SEQUENCE VReg_64, $data, sub0, $cmp, sub1),
|
||||
$vindex, $rsrc, $soffset, (as_i16imm $offset), (as_i1imm $slc)),
|
||||
sub0)
|
||||
@ -1023,7 +1023,7 @@ def : Pat<
|
||||
(MUBUFIntrinsicVOffset i32:$soffset, i16:$offset, i32:$voffset),
|
||||
imm:$slc),
|
||||
(EXTRACT_SUBREG
|
||||
(BUFFER_ATOMIC_CMPSWAP_RTN_OFFEN
|
||||
(BUFFER_ATOMIC_CMPSWAP_OFFEN_RTN
|
||||
(REG_SEQUENCE VReg_64, $data, sub0, $cmp, sub1),
|
||||
$voffset, $rsrc, $soffset, (as_i16imm $offset), (as_i1imm $slc)),
|
||||
sub0)
|
||||
@ -1035,7 +1035,7 @@ def : Pat<
|
||||
(MUBUFIntrinsicVOffset i32:$soffset, i16:$offset, i32:$voffset),
|
||||
imm:$slc),
|
||||
(EXTRACT_SUBREG
|
||||
(BUFFER_ATOMIC_CMPSWAP_RTN_BOTHEN
|
||||
(BUFFER_ATOMIC_CMPSWAP_BOTHEN_RTN
|
||||
(REG_SEQUENCE VReg_64, $data, sub0, $cmp, sub1),
|
||||
(REG_SEQUENCE VReg_64, $vindex, sub0, $voffset, sub1),
|
||||
$rsrc, $soffset, (as_i16imm $offset), (as_i1imm $slc)),
|
||||
@ -1361,11 +1361,11 @@ multiclass MUBUF_Real_AllAddr_si<bits<7> op> {
|
||||
}
|
||||
|
||||
multiclass MUBUF_Real_Atomic_si<bits<7> op> : MUBUF_Real_AllAddr_si<op> {
|
||||
def _RTN_OFFSET_si : MUBUF_Real_si <op, !cast<MUBUF_Pseudo>(NAME#"_RTN_OFFSET")>;
|
||||
def _RTN_ADDR64_si : MUBUF_Real_si <op, !cast<MUBUF_Pseudo>(NAME#"_RTN_ADDR64")>;
|
||||
def _RTN_OFFEN_si : MUBUF_Real_si <op, !cast<MUBUF_Pseudo>(NAME#"_RTN_OFFEN")>;
|
||||
def _RTN_IDXEN_si : MUBUF_Real_si <op, !cast<MUBUF_Pseudo>(NAME#"_RTN_IDXEN")>;
|
||||
def _RTN_BOTHEN_si : MUBUF_Real_si <op, !cast<MUBUF_Pseudo>(NAME#"_RTN_BOTHEN")>;
|
||||
def _OFFSET_RTN_si : MUBUF_Real_si <op, !cast<MUBUF_Pseudo>(NAME#"_OFFSET_RTN")>;
|
||||
def _ADDR64_RTN_si : MUBUF_Real_si <op, !cast<MUBUF_Pseudo>(NAME#"_ADDR64_RTN")>;
|
||||
def _OFFEN_RTN_si : MUBUF_Real_si <op, !cast<MUBUF_Pseudo>(NAME#"_OFFEN_RTN")>;
|
||||
def _IDXEN_RTN_si : MUBUF_Real_si <op, !cast<MUBUF_Pseudo>(NAME#"_IDXEN_RTN")>;
|
||||
def _BOTHEN_RTN_si : MUBUF_Real_si <op, !cast<MUBUF_Pseudo>(NAME#"_BOTHEN_RTN")>;
|
||||
}
|
||||
|
||||
defm BUFFER_LOAD_FORMAT_X : MUBUF_Real_AllAddr_si <0x00>;
|
||||
@ -1520,10 +1520,10 @@ multiclass MUBUF_Real_AllAddr_vi<bits<7> op> {
|
||||
|
||||
multiclass MUBUF_Real_Atomic_vi<bits<7> op> :
|
||||
MUBUF_Real_AllAddr_vi<op> {
|
||||
def _RTN_OFFSET_vi : MUBUF_Real_vi <op, !cast<MUBUF_Pseudo>(NAME#"_RTN_OFFSET")>;
|
||||
def _RTN_OFFEN_vi : MUBUF_Real_vi <op, !cast<MUBUF_Pseudo>(NAME#"_RTN_OFFEN")>;
|
||||
def _RTN_IDXEN_vi : MUBUF_Real_vi <op, !cast<MUBUF_Pseudo>(NAME#"_RTN_IDXEN")>;
|
||||
def _RTN_BOTHEN_vi : MUBUF_Real_vi <op, !cast<MUBUF_Pseudo>(NAME#"_RTN_BOTHEN")>;
|
||||
def _OFFSET_RTN_vi : MUBUF_Real_vi <op, !cast<MUBUF_Pseudo>(NAME#"_OFFSET_RTN")>;
|
||||
def _OFFEN_RTN_vi : MUBUF_Real_vi <op, !cast<MUBUF_Pseudo>(NAME#"_OFFEN_RTN")>;
|
||||
def _IDXEN_RTN_vi : MUBUF_Real_vi <op, !cast<MUBUF_Pseudo>(NAME#"_IDXEN_RTN")>;
|
||||
def _BOTHEN_RTN_vi : MUBUF_Real_vi <op, !cast<MUBUF_Pseudo>(NAME#"_BOTHEN_RTN")>;
|
||||
}
|
||||
|
||||
defm BUFFER_LOAD_FORMAT_X : MUBUF_Real_AllAddr_vi <0x00>;
|
||||
|
Loading…
Reference in New Issue
Block a user