From 48873e2d242458a28fea136b5ae371b987bce264 Mon Sep 17 00:00:00 2001 From: Valery Pykhtin Date: Fri, 23 Sep 2016 21:21:21 +0000 Subject: [PATCH] [AMDGPU] Fix for bz30427: wrong MTBUF encoding on VI Differential revision: https://reviews.llvm.org/D24875 llvm-svn: 282296 --- lib/Target/AMDGPU/BUFInstructions.td | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/Target/AMDGPU/BUFInstructions.td b/lib/Target/AMDGPU/BUFInstructions.td index 4a1e1e645be..220dd8deeb6 100644 --- a/lib/Target/AMDGPU/BUFInstructions.td +++ b/lib/Target/AMDGPU/BUFInstructions.td @@ -81,7 +81,7 @@ class MTBUF_Pseudo op, MTBUF_Pseudo ps> : +class MTBUF_Real : InstSI , Enc64 { @@ -113,8 +113,6 @@ class MTBUF_Real op, MTBUF_Pseudo ps> : let Inst{12} = offen; let Inst{13} = idxen; let Inst{14} = glc; - let Inst{15} = addr64; - let Inst{18-16} = op; let Inst{22-19} = dfmt; let Inst{25-23} = nfmt; let Inst{31-26} = 0x3a; //encoding @@ -1171,10 +1169,14 @@ def BUFFER_WBINVL1_SC_si : MUBUF_Real_si <0x70, BUFFER_WBINVL1_SC>; def BUFFER_WBINVL1_si : MUBUF_Real_si <0x71, BUFFER_WBINVL1>; class MTBUF_Real_si op, MTBUF_Pseudo ps> : - MTBUF_Real, + MTBUF_Real, SIMCInstr { let AssemblerPredicate=isSICI; let DecoderNamespace="SICI"; + + bits<1> addr64; + let Inst{15} = addr64; + let Inst{18-16} = op; } def TBUFFER_LOAD_FORMAT_XYZW_si : MTBUF_Real_si <3, TBUFFER_LOAD_FORMAT_XYZW>; @@ -1290,11 +1292,13 @@ defm BUFFER_ATOMIC_DEC_X2 : MUBUF_Real_Atomic_vi <0x6c>; def BUFFER_WBINVL1_vi : MUBUF_Real_vi <0x3e, BUFFER_WBINVL1>; def BUFFER_WBINVL1_VOL_vi : MUBUF_Real_vi <0x3f, BUFFER_WBINVL1_VOL>; -class MTBUF_Real_vi op, MTBUF_Pseudo ps> : - MTBUF_Real, +class MTBUF_Real_vi op, MTBUF_Pseudo ps> : + MTBUF_Real, SIMCInstr { let AssemblerPredicate=isVI; let DecoderNamespace="VI"; + + let Inst{18-15} = op; } def TBUFFER_LOAD_FORMAT_XYZW_vi : MTBUF_Real_vi <3, TBUFFER_LOAD_FORMAT_XYZW>;