Path: blob/21.2-virgl/src/freedreno/isa/ir3-cat0.xml
4564 views
<?xml version="1.0" encoding="UTF-8"?>1<!--2Copyright © 2020 Google, Inc.34Permission is hereby granted, free of charge, to any person obtaining a5copy of this software and associated documentation files (the "Software"),6to deal in the Software without restriction, including without limitation7the rights to use, copy, modify, merge, publish, distribute, sublicense,8and/or sell copies of the Software, and to permit persons to whom the9Software is furnished to do so, subject to the following conditions:1011The above copyright notice and this permission notice (including the next12paragraph) shall be included in all copies or substantial portions of the13Software.1415THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL18THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER19LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,20OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE21SOFTWARE.22-->2324<isa>2526<!--27Cat0 Instructions:28-->2930<bitset name="#instruction-cat0" extends="#instruction">31<!--32TODO immed size is 16b for a3xx, 20b for a4xx, 32b for a5xx+.. should we33try to express this? Also, not all cat0 take an immed, so maybe push34this further down the hierarchy?35-->36<field name="IMMED" low="0" high="31" type="branch"/>3738<field name="REPEAT" low="40" high="42" type="#rptN"/>39<pattern pos="43">x</pattern>40<field name="SS" pos="44" type="bool" display="(ss)"/>41<field name="EQ" pos="48" type="bool" display="(eq)"/>42<field name="JP" pos="59" type="bool" display="(jp)"/>43<field name="SY" pos="60" type="bool" display="(sy)"/>44<pattern low="61" high="63">000</pattern> <!-- cat0 -->45<encode>46<map name="IMMED">src->cat0.immed</map>47<map name="COMP1">src->cat0.comp1</map>48<map name="COMP2">src->cat0.comp2</map>49<map name="INV1">src->cat0.inv1</map>50<map name="INV2">src->cat0.inv2</map>51</encode>52</bitset>535455<bitset name="#instruction-cat0-0src" extends="#instruction-cat0">56<display>57{SY}{SS}{EQ}{JP}{REPEAT}{NAME}58</display>59<pattern low="32" high="36">00000</pattern>60<pattern low="37" high="39">000</pattern> <!-- BRTYPE -->61<pattern low="45" high="47">000</pattern> <!-- src1 -->62<pattern low="52" high="54">000</pattern> <!-- src0 -->63</bitset>6465<bitset name="nop" extends="#instruction-cat0-0src">66<pattern low="49" high="51">xx0</pattern> <!-- OPC_HI -->67<pattern low="55" high="58">0000</pattern> <!-- OPC -->68</bitset>6970<bitset name="end" extends="#instruction-cat0-0src">71<pattern low="49" high="51">xx0</pattern> <!-- OPC_HI -->72<pattern low="55" high="58">0110</pattern> <!-- OPC -->73</bitset>7475<bitset name="ret" extends="#instruction-cat0-0src">76<pattern low="49" high="51">xx0</pattern> <!-- OPC_HI -->77<pattern low="55" high="58">0100</pattern> <!-- OPC -->78</bitset>7980<bitset name="emit" extends="#instruction-cat0-0src">81<pattern low="49" high="51">xx0</pattern> <!-- OPC_HI -->82<pattern low="55" high="58">0111</pattern> <!-- OPC -->83</bitset>8485<bitset name="cut" extends="#instruction-cat0-0src">86<pattern low="49" high="51">xx0</pattern> <!-- OPC_HI -->87<pattern low="55" high="58">1000</pattern> <!-- OPC -->88</bitset>8990<bitset name="chmask" extends="#instruction-cat0-0src">91<pattern low="49" high="51">xx0</pattern> <!-- OPC_HI -->92<pattern low="55" high="58">1001</pattern> <!-- OPC -->93</bitset>9495<bitset name="chsh" extends="#instruction-cat0-0src">96<pattern low="49" high="51">xx0</pattern> <!-- OPC_HI -->97<pattern low="55" high="58">1010</pattern> <!-- OPC -->98</bitset>99100<bitset name="flow_rev" extends="#instruction-cat0-0src">101<pattern low="49" high="51">xx0</pattern> <!-- OPC_HI -->102<pattern low="55" high="58">1011</pattern> <!-- OPC -->103</bitset>104105<bitset name="shpe" extends="#instruction-cat0-0src">106<doc>SHader Prologue End</doc>107<pattern low="49" high="51">xx1</pattern> <!-- OPC_HI -->108<pattern low="55" high="58">1000</pattern> <!-- OPC -->109</bitset>110111<bitset name="prede" extends="#instruction-cat0-0src">112<pattern low="49" high="51">xx1</pattern> <!-- OPC_HI -->113<pattern low="55" high="58">1111</pattern> <!-- OPC -->114</bitset>115116117<bitset name="#instruction-cat0-1src" extends="#instruction-cat0">118<display>119{SY}{SS}{EQ}{JP}{NAME} {INV1}p0.{COMP1}120</display>121<pattern low="32" high="36">00000</pattern>122<pattern low="37" high="39">000</pattern> <!-- BRTYPE -->123<pattern low="45" high="47">000</pattern> <!-- src1 -->124<field name="INV1" pos="52" type="bool" display="!">125<doc>Invert source condition</doc>126</field>127<field name="COMP1" low="53" high="54" type="#swiz">128<doc>Predicate register (p0.c) component for source</doc>129</field>130</bitset>131132<bitset name="kill" extends="#instruction-cat0-1src">133<pattern low="49" high="51">xx0</pattern> <!-- OPC_HI -->134<pattern low="55" high="58">0101</pattern> <!-- OPC -->135</bitset>136137<bitset name="predt" extends="#instruction-cat0-1src">138<pattern low="49" high="51">xx1</pattern> <!-- OPC_HI -->139<pattern low="55" high="58">1101</pattern> <!-- OPC -->140</bitset>141142<bitset name="predf" extends="#instruction-cat0-1src">143<pattern low="49" high="51">xx1</pattern> <!-- OPC_HI -->144<pattern low="55" high="58">1110</pattern> <!-- OPC -->145</bitset>146147148<bitset name="#instruction-cat0-immed" extends="#instruction-cat0">149<display>150{SY}{SS}{JP}{NAME} #{IMMED}151</display>152<pattern low="32" high="36">xxxxx</pattern> <!-- INDEX -->153<pattern low="37" high="39">xxx</pattern> <!-- BRTYPE -->154<pattern low="45" high="47">xxx</pattern> <!-- src1 -->155<pattern low="52" high="54">xxx</pattern> <!-- src0 -->156</bitset>157158<bitset name="jump" extends="#instruction-cat0-immed">159<pattern low="49" high="51">xx0</pattern> <!-- OPC_HI -->160<pattern low="55" high="58">0010</pattern> <!-- OPC -->161</bitset>162163<bitset name="call" extends="#instruction-cat0-immed">164<pattern low="49" high="51">xx0</pattern> <!-- OPC_HI -->165<pattern low="55" high="58">0011</pattern> <!-- OPC -->166</bitset>167168<bitset name="bkt" extends="#instruction-cat0-immed">169<pattern low="49" high="51">xx1</pattern> <!-- OPC_HI -->170<pattern low="55" high="58">0000</pattern> <!-- OPC -->171</bitset>172173<bitset name="getone" extends="#instruction-cat0-immed">174<pattern low="49" high="51">xx1</pattern> <!-- OPC_HI -->175<pattern low="55" high="58">0101</pattern> <!-- OPC -->176</bitset>177178<bitset name="shps" extends="#instruction-cat0-immed">179<doc>SHader Prologue Start</doc>180<pattern low="49" high="51">xx1</pattern> <!-- OPC_HI -->181<pattern low="55" high="58">0111</pattern> <!-- OPC -->182</bitset>183184<bitset name="#instruction-cat0-branch" extends="#instruction-cat0">185<pattern low="49" high="51">xx0</pattern> <!-- OPC_HI -->186<pattern low="55" high="58">0001</pattern> <!-- OPC -->187</bitset>188189<bitset name="brac" extends="#instruction-cat0-branch">190<display>191{SY}{SS}{EQ}{JP}{NAME}.{INDEX} #{IMMED}192</display>193<field name="INDEX" low="32" high="36" type="uint"/>194<pattern low="37" high="39">011</pattern> <!-- BRTYPE -->195<pattern low="45" high="47">xxx</pattern> <!-- src1 -->196<pattern low="52" high="54">xxx</pattern> <!-- src0 -->197<encode>198<map name="INDEX">src->cat0.idx</map>199</encode>200</bitset>201202<bitset name="brax" extends="#instruction-cat0-branch">203<pattern low="32" high="36">xxxxx</pattern>204<pattern low="37" high="39">110</pattern> <!-- BRTYPE -->205<pattern low="45" high="47">xxx</pattern> <!-- src1 -->206<pattern low="52" high="54">xxx</pattern> <!-- src0 -->207</bitset>208209<bitset name="#instruction-cat0-branch-1src" extends="#instruction-cat0-branch">210<display>211{SY}{SS}{EQ}{JP}{NAME} {INV1}p0.{COMP1}, #{IMMED}212</display>213<pattern low="32" high="36">xxxxx</pattern>214<pattern low="45" high="47">xxx</pattern> <!-- src1 -->215<field name="INV1" pos="52" type="bool" display="!">216<doc>Invert source condition</doc>217</field>218<field name="COMP1" low="53" high="54" type="#swiz">219<doc>Predicate register (p0.c) component for source</doc>220</field>221</bitset>222223<bitset name="br" extends="#instruction-cat0-branch-1src">224<pattern low="37" high="39">000</pattern> <!-- BRTYPE -->225</bitset>226227<bitset name="bany" extends="#instruction-cat0-branch-1src">228<pattern low="37" high="39">100</pattern> <!-- BRTYPE -->229</bitset>230231<bitset name="ball" extends="#instruction-cat0-branch-1src">232<pattern low="37" high="39">101</pattern> <!-- BRTYPE -->233</bitset>234235<bitset name="#instruction-cat0-branch-2src" extends="#instruction-cat0-branch">236<display>237{SY}{SS}{EQ}{JP}{NAME} {INV1}p0.{COMP1}, {INV2}p0.{COMP2}, #{IMMED}238</display>239<pattern low="32" high="36">xxxxx</pattern>240<!-- src1: -->241<field name="INV2" pos="45" type="bool" display="!">242<doc>Invert source 2 condition</doc>243</field>244<field name="COMP2" low="46" high="47" type="#swiz">245<doc>Predicate register (p0.c) component for source 2</doc>246</field>247<!-- src0: -->248<field name="INV1" pos="52" type="bool" display="!">249<doc>Invert source 1 condition</doc>250</field>251<field name="COMP1" low="53" high="54" type="#swiz">252<doc>Predicate register (p0.c) component for source 1</doc>253</field>254</bitset>255256<bitset name="brao" extends="#instruction-cat0-branch-2src">257<pattern low="37" high="39">001</pattern> <!-- BRTYPE -->258</bitset>259260<bitset name="braa" extends="#instruction-cat0-branch-2src">261<pattern low="37" high="39">010</pattern> <!-- BRTYPE -->262</bitset>263264<!-- TODO rest of cat0 -->265266</isa>267268