Changes between Version 12 and Version 13 of GcnInstrsVop2


Ignore:
Timestamp:
Nov 23, 2015, 12:00:17 AM (5 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GcnInstrsVop2

    v12 v13  
    618618<code>UINT8 byte = ((SRC1&amp;3) * 8)
    619619UINT32 mask = 0xff &lt;&lt; byte
     620FLOAT f = RNDINT(ASFLOAT(SRC0))
    620621UINT8 VAL8 = 0
    621 FLOAT f = RNDINT(ASFLOAT(SRC0))
    622 if (f &gt; 255.0)
    623     VAL8 = 255
    624 else if (f &lt; 0.0 || f == NaN)
    625     VAL8 = 0
    626 else
    627     VAL8 = f
     622if (f == NaN)
     623    VAL8 = (UINT8)MAX(MIN(f, 255.0), 0.0)
    628624VDST = (VDST&amp;~mask) | (((UINT32)VAL8) &lt;&lt; byte)</code></p>
    629625<h4>V_CVT_PKNORM_I16_F32</h4>
     
    638634{
    639635    FLOAT f = RNDNEINT(S*32767)
    640     if (f &gt; 32767.0)
    641          return 0x7fff
    642     else if (f &lt; -32767.0)
    643         return -0x7fff
    644     else if (f == NaN)
     636    if (f == NaN)
    645637        return 0
    646     return (INT16)f
     638    return (INT16)MAX(MIN(f, 32767.0), -32767.0)
    647639}
    648640VDST = roundNorm(ASFLOAT(SRC0)) | ((UINT32)roundNorm(ASFLOAT(SRC1)) &lt;&lt; 16)</code></p>
     
    658650{
    659651    FLOAT f = RNDNEINT(S*65535.0)
    660     INT16 VAL16 = 0
    661     if (f &gt; 65535.0)
    662         return 0x7fff
    663     else if (f &lt; 0.0 || f == NaN)
     652    if (f == NaN)
    664653        return 0
    665     return (UINT16)f
     654    return (INT16)MAX(MIN(f, 65535.0), 0.0)
    666655}
    667656VDST = roundNorm(ASFLOAT(SRC0)) | ((UINT32)roundNorm(ASFLOAT(SRC1)) &lt;&lt; 16)</code></p>
     
    704693SRC1 is signed integer, SRC0 is floating point value.<br />
    705694Operation:<br />
    706 <code>VDST = ASFLOAT(SRC0) * POW(2.0,SRC1)</code></p>
     695<code>VDST = ASFLOAT(SRC0) * POW(2.0, (INT32)SRC1)</code></p>
    707696<h4>V_LSHL_B32</h4>
    708697<p>Opcode VOP2: 25 (0x19) for GCN 1.0/1.1<br />