Changes between Version 4 and Version 5 of GcnInstrsSop2


Ignore:
Timestamp:
Nov 13, 2015, 10:00:17 PM (5 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GcnInstrsSop2

    v4 v5  
    128128<h3>Instruction set</h3>
    129129<p>Alphabetically sorted instruction list:</p>
     130<h4>S_ABSDIFF_I32</h4>
     131<p>Opcode: 44 (0x2c)<br />
     132Syntax: S_ABSDIFF_I32 SDST, SSRC0, SSRC1<br />
     133Description: Compute absolute difference from SSRC0 and SSRC1 and store result to SDST.
     134If result is non-zero store 1 to SCC, otherwise store 0 to SCC.<br />
     135Operation:<br />
     136<code>INT32 temp = SSRC0-SSRC1
     137SDST = temp&gt;=0 ? temp : -temp
     138SCC = SDST!=0</code></p>
    130139<h4>S_ADDC_U32</h4>
    131140<p>Opcode: 4 (0x4)<br />
     
    134143carry-out flag into SCC.<br />
    135144Operation:<br />
    136 <code>temp = (UINT64)SSRC0 + (UINT64)SSRC1 + SCC
     145<code>UINT64 temp = (UINT64)SSRC0 + (UINT64)SSRC1 + SCC
    137146SDST = temp
    138147SCC = temp&gt;&gt;32</code></p>
     
    143152Operation:<br />
    144153<code>SDST = SSRC0 + SSRC1
    145 temp = (UINT64)SSRC0 + (UINT64)SSRC1
    146 SCC = temp &gt; ((1LL&lt;&lt;31)-1) || temp &gt; (-1LL&lt;&lt;31)</code></p>
     154INT64 temp = (INT64)SSRC0 + (INT64)SSRC1
     155SCC = temp &gt; ((1LL&lt;&lt;31)-1) || temp &lt; (-1LL&lt;&lt;31)</code></p>
    147156<h4>S_ADD_U32</h4>
    148157<p>Opcode: 0 (0x0)<br />
     
    202211<code>SDST = (INT64)SSRC0 &gt;&gt; (SSRC1 &amp; 63)
    203212SCC = SDST!=0</code></p>
     213<h4>S_BFE_I32</h4>
     214<p>Opcode: 40 (0x28)<br />
     215Syntax: S_BFE_I32 SDST, SSRC0, SSRC1<br />
     216Description: Extracts bits in SSRC0 from range (SSRC1&amp;31) with length ((SSRC1&gt;&gt;16)&amp;0x7f)
     217and extend sign from last bit of extracted value.
     218If result is non-zero store 1 to SCC, otherwise store 0 to SCC.<br />
     219Operation:<br />
     220<code>UINT8 shift = length&amp;31
     221UINT8 length = (SSRC1&gt;&gt;16) &amp; 0x7f
     222if (length==0)
     223    SDST = 0
     224if (shift+length &lt; 32)
     225    SDST = (INT32)(SSRC0 &lt;&lt; (32 - shift - length)) &gt;&gt; (32 - length)
     226else
     227    SDST = (INT32)SSRC0 &gt;&gt; shift
     228SCC = SDST!=0</code></p>
    204229<h4>S_BFE_U32</h4>
    205230<p>Opcode: 39 (0x27)<br />
     
    208233If result is non-zero store 1 to SCC, otherwise store 0 to SCC.<br />
    209234Operation:<br />
    210 <code>shift = length &amp; 31
    211 length = (SSRC1&gt;&gt;16) &amp; 0x7f
     235<code>UINT8 shift = length &amp; 31
     236UINT8 length = (SSRC1&gt;&gt;16) &amp; 0x7f
    212237if (length==0)
    213238    SDST = 0
     
    217242    SDST = SSRC0 &gt;&gt; shift
    218243SCC = SDST!=0</code></p>
    219 <h4>S_BFE_I32</h4>
    220 <p>Opcode: 40 (0x28)<br />
    221 Syntax: S_BFE_I32 SDST, SSRC0, SSRC1<br />
    222 Description: Extracts bits in SSRC0 from range (SSRC1&amp;31) with length ((SSRC1&gt;&gt;16)&amp;0x7f)
     244<h4>S_BFE_I64</h4>
     245<p>Opcode: 42 (0x2a)<br />
     246Syntax: S_BFE_I64 SDST, SSRC0, SSRC1<br />
     247Description: Extracts bits in SSRC0 from range (SSRC1&amp;63) with length ((SSRC1&gt;&gt;16)&amp;0x7f)
    223248and extend sign from last bit of extracted value.
    224249If result is non-zero store 1 to SCC, otherwise store 0 to SCC.<br />
    225250Operation:<br />
    226 <code>shift = length&amp;31
    227 length = (SSRC1&gt;&gt;16) &amp; 0x7f
     251<code>UINT8 shift = length&amp;63
     252UINT8 length = (SSRC1&gt;&gt;16) &amp; 0x7f
    228253if (length==0)
    229254    SDST = 0
    230 if (shift+length &lt; 32)
    231     SDST = (INT32)(SSRC0 &lt;&lt; (32 - shift - length)) &gt;&gt; (32 - length)
     255if (shift+length &lt; 64)
     256    SDST = (INT64)(SSRC0 &lt;&lt; (64 - shift - length)) &gt;&gt; (64 - length)
    232257else
    233     SDST = (INT32)SSRC0 &gt;&gt; shift
     258    SDST = (INT64)SSRC0 &gt;&gt; shift
     259SCC = SDST!=0</code></p>
     260<h4>S_BFE_U64</h4>
     261<p>Opcode: 41 (0x29)<br />
     262Syntax: S_BFE_U64 SDST(2), SSRC0(2), SSRC1<br />
     263Description: Extracts bits in SSRC0 from range (SSRC1&amp;63) with length ((SSRC1&gt;&gt;16)&amp;0x7f).
     264If result is non-zero store 1 to SCC, otherwise store 0 to SCC.
     265SDST, SSRC0 are 64-bit, SSRC1 is 32-bit.<br />
     266Operation:<br />
     267<code>UINT8 shift = length &amp; 63
     268UINT8 length = (SSRC1&gt;&gt;16) &amp; 0x7f
     269if (length==0)
     270    SDST = 0
     271if (shift+length &lt; 64)
     272    SDST = SSRC0 &lt;&lt; (64 - shift - length) &gt;&gt; (64 - length)
     273else
     274    SDST = SSRC0 &gt;&gt; shift
    234275SCC = SDST!=0</code></p>
    235276<h4>S_BFM_B32</h4>
     
    404445carry-out flag into SCC.<br />
    405446Operation:<br />
    406 <code>temp = (UINT64)SSRC0 - (UINT64)SSRC1 - SCC
     447<code>UINT64 temp = (UINT64)SSRC0 - (UINT64)SSRC1 - SCC
    407448SDST = temp
    408449SCC = temp&gt;&gt;32</code></p>
     
    415456Operation:<br />
    416457<code>SDST = SSRC0 - SSRC1
    417 temp = (UINT64)SSRC0 - (UINT64)SSRC1
    418 SCC = temp&gt;((1LL&lt;&lt;31)-1) || temp&gt;(-1LL&lt;&lt;31)</code></p>
     458INT64 temp = (INT64)SSRC0 - (INT64)SSRC1
     459SCC = temp &gt; ((1LL&lt;&lt;31)-1) || temp &lt; (-1LL&lt;&lt;31)</code></p>
    419460<h4>S_SUB_U32</h4>
    420461<p>Opcode: 1 (0x1)<br />