17ec681f3Smrg<?xml version="1.0" encoding="UTF-8"?>
27ec681f3Smrg<!--
37ec681f3SmrgCopyright © 2020 Google, Inc.
47ec681f3Smrg
57ec681f3SmrgPermission is hereby granted, free of charge, to any person obtaining a
67ec681f3Smrgcopy of this software and associated documentation files (the "Software"),
77ec681f3Smrgto deal in the Software without restriction, including without limitation
87ec681f3Smrgthe rights to use, copy, modify, merge, publish, distribute, sublicense,
97ec681f3Smrgand/or sell copies of the Software, and to permit persons to whom the
107ec681f3SmrgSoftware is furnished to do so, subject to the following conditions:
117ec681f3Smrg
127ec681f3SmrgThe above copyright notice and this permission notice (including the next
137ec681f3Smrgparagraph) shall be included in all copies or substantial portions of the
147ec681f3SmrgSoftware.
157ec681f3Smrg
167ec681f3SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
177ec681f3SmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
187ec681f3SmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
197ec681f3SmrgTHE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
207ec681f3SmrgLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
217ec681f3SmrgOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
227ec681f3SmrgSOFTWARE.
237ec681f3Smrg -->
247ec681f3Smrg
257ec681f3Smrg<isa>
267ec681f3Smrg
277ec681f3Smrg<!--
287ec681f3Smrg	Cat4 Instructions:  SFU (aka EFU) instructions
297ec681f3Smrg -->
307ec681f3Smrg
317ec681f3Smrg<bitset name="#instruction-cat4" extends="#instruction">
327ec681f3Smrg	<display>
337ec681f3Smrg		{SY}{SS}{JP}{SAT}{REPEAT}{UL}{NAME} {DST_HALF}{DST}, {SRC}
347ec681f3Smrg	</display>
357ec681f3Smrg	<field name="SRC" low="0" high="15" type="#multisrc">
367ec681f3Smrg		<param name="SRC_R"/>
377ec681f3Smrg		<param name="FULL"/>
387ec681f3Smrg	</field>
397ec681f3Smrg	<pattern low="16" high="31">xxxxxxxxxxxxxxxx</pattern>
407ec681f3Smrg	<field name="DST" low="32" high="39" type="#reg-gpr"/>
417ec681f3Smrg	<field name="REPEAT" low="40" high="41" type="#rptN"/>
427ec681f3Smrg	<field name="SAT" pos="42" type="bool" display="(sat)"/>
437ec681f3Smrg	<field name="SRC_R" pos="43" type="bool" display="(r)"/>
447ec681f3Smrg	<field name="SS" pos="44" type="bool" display="(ss)"/>
457ec681f3Smrg	<field name="UL" pos="45" type="bool" display="(ul)"/>
467ec681f3Smrg	<field name="DST_CONV" pos="46" type="bool">
477ec681f3Smrg		<doc>
487ec681f3Smrg			Destination register is opposite precision as source, ie.
497ec681f3Smrg			if {FULL} is true then destination is half precision, and
507ec681f3Smrg			visa versa.
517ec681f3Smrg		</doc>
527ec681f3Smrg	</field>
537ec681f3Smrg	<derived name="DST_HALF" expr="#dest-half" type="bool" display="h"/>
547ec681f3Smrg	<pattern low="47" high="51">xxxxx</pattern>
557ec681f3Smrg	<field name="FULL" pos="52" type="bool">
567ec681f3Smrg		<doc>Full precision source registers</doc>
577ec681f3Smrg	</field>
587ec681f3Smrg	<!-- 6b opc -->
597ec681f3Smrg	<field name="JP" pos="59" type="bool" display="(jp)"/>
607ec681f3Smrg	<field name="SY" pos="60" type="bool" display="(sy)"/>
617ec681f3Smrg	<pattern low="61" high="63">100</pattern>  <!-- cat4 -->
627ec681f3Smrg	<encode>
637ec681f3Smrg		<map name="SRC">src->srcs[0]</map>
647ec681f3Smrg		<map name="DST_CONV">
657ec681f3Smrg			((src->dsts[0]->num >> 2) == 62) ? 0 :
667ec681f3Smrg			!!((src->srcs[0]->flags ^ src->dsts[0]->flags) &amp; IR3_REG_HALF)
677ec681f3Smrg		</map>
687ec681f3Smrg		<map name="FULL">!(src->srcs[0]->flags &amp; IR3_REG_HALF)</map>
697ec681f3Smrg		<map name="SRC_R">!!(src->srcs[0]->flags &amp; IR3_REG_R)</map>
707ec681f3Smrg	</encode>
717ec681f3Smrg</bitset>
727ec681f3Smrg
737ec681f3Smrg<bitset name="rcp" extends="#instruction-cat4">
747ec681f3Smrg	<pattern low="53" high="58">000000</pattern> <!-- OPC -->
757ec681f3Smrg</bitset>
767ec681f3Smrg
777ec681f3Smrg<bitset name="rsq" extends="#instruction-cat4">
787ec681f3Smrg	<pattern low="53" high="58">000001</pattern> <!-- OPC -->
797ec681f3Smrg</bitset>
807ec681f3Smrg
817ec681f3Smrg<bitset name="log2" extends="#instruction-cat4">
827ec681f3Smrg	<pattern low="53" high="58">000010</pattern> <!-- OPC -->
837ec681f3Smrg</bitset>
847ec681f3Smrg
857ec681f3Smrg<bitset name="exp2" extends="#instruction-cat4">
867ec681f3Smrg	<pattern low="53" high="58">000011</pattern> <!-- OPC -->
877ec681f3Smrg</bitset>
887ec681f3Smrg
897ec681f3Smrg<bitset name="sin" extends="#instruction-cat4">
907ec681f3Smrg	<pattern low="53" high="58">000100</pattern> <!-- OPC -->
917ec681f3Smrg</bitset>
927ec681f3Smrg
937ec681f3Smrg<bitset name="cos" extends="#instruction-cat4">
947ec681f3Smrg	<pattern low="53" high="58">000101</pattern> <!-- OPC -->
957ec681f3Smrg</bitset>
967ec681f3Smrg
977ec681f3Smrg<bitset name="sqrt" extends="#instruction-cat4">
987ec681f3Smrg	<pattern low="53" high="58">000110</pattern> <!-- OPC -->
997ec681f3Smrg</bitset>
1007ec681f3Smrg
1017ec681f3Smrg<!--
1027ec681f3Smrg	NOTE that these are 8+opc from their highp equivs, so it's possible
1037ec681f3Smrg	that the high order bit in the opc field has been repurposed for
1047ec681f3Smrg	half-precision use?  But note that other ops (rcp/lsin/cos/sqrt)
1057ec681f3Smrg	still use the same opc as highp
1067ec681f3Smrg -->
1077ec681f3Smrg
1087ec681f3Smrg<bitset name="hrsq" extends="#instruction-cat4">
1097ec681f3Smrg	<pattern low="53" high="58">001001</pattern> <!-- OPC -->
1107ec681f3Smrg</bitset>
1117ec681f3Smrg
1127ec681f3Smrg<bitset name="hlog2" extends="#instruction-cat4">
1137ec681f3Smrg	<pattern low="53" high="58">001010</pattern> <!-- OPC -->
1147ec681f3Smrg</bitset>
1157ec681f3Smrg
1167ec681f3Smrg<bitset name="hexp2" extends="#instruction-cat4">
1177ec681f3Smrg	<pattern low="53" high="58">001011</pattern> <!-- OPC -->
1187ec681f3Smrg</bitset>
1197ec681f3Smrg
1207ec681f3Smrg</isa>
121