Path: blob/21.2-virgl/src/freedreno/isa/ir3-cat4.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<!--27Cat4 Instructions: SFU (aka EFU) instructions28-->2930<bitset name="#instruction-cat4" extends="#instruction">31<display>32{SY}{SS}{JP}{SAT}{REPEAT}{UL}{NAME} {DST_HALF}{DST}, {SRC}33</display>34<field name="SRC" low="0" high="15" type="#multisrc">35<param name="SRC_R"/>36<param name="FULL"/>37</field>38<pattern low="16" high="31">xxxxxxxxxxxxxxxx</pattern>39<field name="DST" low="32" high="39" type="#reg-gpr"/>40<field name="REPEAT" low="40" high="41" type="#rptN"/>41<field name="SAT" pos="42" type="bool" display="(sat)"/>42<field name="SRC_R" pos="43" type="bool" display="(r)"/>43<field name="SS" pos="44" type="bool" display="(ss)"/>44<field name="UL" pos="45" type="bool" display="(ul)"/>45<field name="DST_CONV" pos="46" type="bool">46<doc>47Destination register is opposite precision as source, ie.48if {FULL} is true then destination is half precision, and49visa versa.50</doc>51</field>52<derived name="DST_HALF" expr="#dest-half" type="bool" display="h"/>53<pattern low="47" high="51">xxxxx</pattern>54<field name="FULL" pos="52" type="bool">55<doc>Full precision source registers</doc>56</field>57<!-- 6b opc -->58<field name="JP" pos="59" type="bool" display="(jp)"/>59<field name="SY" pos="60" type="bool" display="(sy)"/>60<pattern low="61" high="63">100</pattern> <!-- cat4 -->61<encode>62<map name="SRC">src->srcs[0]</map>63<map name="DST_CONV">64((src->dsts[0]->num >> 2) == 62) ? 0 :65!!((src->srcs[0]->flags ^ src->dsts[0]->flags) & IR3_REG_HALF)66</map>67<map name="FULL">!(src->srcs[0]->flags & IR3_REG_HALF)</map>68<map name="SRC_R">!!(src->srcs[0]->flags & IR3_REG_R)</map>69</encode>70</bitset>7172<bitset name="rcp" extends="#instruction-cat4">73<pattern low="53" high="58">000000</pattern> <!-- OPC -->74</bitset>7576<bitset name="rsq" extends="#instruction-cat4">77<pattern low="53" high="58">000001</pattern> <!-- OPC -->78</bitset>7980<bitset name="log2" extends="#instruction-cat4">81<pattern low="53" high="58">000010</pattern> <!-- OPC -->82</bitset>8384<bitset name="exp2" extends="#instruction-cat4">85<pattern low="53" high="58">000011</pattern> <!-- OPC -->86</bitset>8788<bitset name="sin" extends="#instruction-cat4">89<pattern low="53" high="58">000100</pattern> <!-- OPC -->90</bitset>9192<bitset name="cos" extends="#instruction-cat4">93<pattern low="53" high="58">000101</pattern> <!-- OPC -->94</bitset>9596<bitset name="sqrt" extends="#instruction-cat4">97<pattern low="53" high="58">000110</pattern> <!-- OPC -->98</bitset>99100<!--101NOTE that these are 8+opc from their highp equivs, so it's possible102that the high order bit in the opc field has been repurposed for103half-precision use? But note that other ops (rcp/lsin/cos/sqrt)104still use the same opc as highp105-->106107<bitset name="hrsq" extends="#instruction-cat4">108<pattern low="53" high="58">001001</pattern> <!-- OPC -->109</bitset>110111<bitset name="hlog2" extends="#instruction-cat4">112<pattern low="53" high="58">001010</pattern> <!-- OPC -->113</bitset>114115<bitset name="hexp2" extends="#instruction-cat4">116<pattern low="53" high="58">001011</pattern> <!-- OPC -->117</bitset>118119</isa>120121122