Changeset 1784 in CLRX


Ignore:
Timestamp:
Dec 5, 2015, 11:10:04 PM (4 years ago)
Author:
matszpk
Message:

CLRadeonExtender: Doc updates: Replace NAN comparison by ISNAN function.
Use ASTYPE function in OP16 description. Fixes in VOP1 instruction op's listings.

Location:
CLRadeonExtender/trunk/doc
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/doc/GcnInstrsVop1.md

    r1780 r1784  
    285285else if (ABS(SF)==INF)
    286286    VDST = -NAN
    287 else if (ABS(SF)==NAN)
     287else if (ISNAN(SF))
    288288    VDST = SRC0
    289289```
     
    441441```
    442442FLOAT SF = ASFLOAT(SF)
    443 if (ABS(SF)!=NAN)
     443if (!ISNAN(SF))
    444444    VDST = (INT32)MAX(MIN(FLOOR(SF), 2147483647.0), -2147483648.0)
    445445else
     
    459459```
    460460VDST = 0
    461 if (ABS(ASFLOAT(SRC0))!=NAN)
     461if (!ISNAN(ASFLOAT(SRC0)))
    462462    VDST = (INT32)MAX(MIN(RNDTZINT(ASFLOAT(SRC0)), 2147483647.0), -2147483648.0)
    463463```
     
    475475```
    476476VDST = 0
    477 if (ABS(ASDOUBLE(SRC0))!=NAN)
     477if (!ISNAN(ASDOUBLE(SRC0)))
    478478    VDST = (INT32)MAX(MIN(RNDTZINT(ASDOUBLE(SRC0)), 2147483647.0), -2147483648.0)
    479479```
     
    503503```
    504504FLOAT SF = ASFLOAT(SRC0)
    505 if (ABS(SF)!=NAN)
     505if (!ISNAN(SF))
    506506    VDST = (INT32)MAX(MIN(FLOOR(SF + 0.5), 2147483647.0), -2147483648.0)
    507507else
     
    521521```
    522522VDST = 0
    523 if (ABS(ASFLOAT(SRC0))!=NAN)
     523if (!ISNAN(ASFLOAT(SRC0)))
    524524    VDST = (UINT32)MIN(RNDTZINT(ASFLOAT(SRC0)), 4294967295.0)
    525525```
     
    537537```
    538538VDST = 0
    539 if (ABS(ASDOUBLE(SRC0))!=NAN)
     539if (!ISNAN(ASDOUBLE(SRC0)))
    540540    VDST = (UINT32)MIN(RNDTZINT(ASDOUBLE(SRC0)), 4294967295.0)
    541541```
     
    625625```
    626626FLOAT SF = ASFLOAT(SRC0)
    627 if (ABS(SF)!=NAN && SF!=-INF && SF!=INF)
     627if (!ISNAN(SF) && SF!=-INF && SF!=INF)
    628628    VDST = SF - FLOOR(ASFLOAT(SF))
    629629else
     
    642642```
    643643FLOAT SD = ASDOUBLE(SRC0)
    644 if (ABS(SD)!=NAN && SD!=-INF && SD!=INF)
     644if (!ISNAN(SD) && SD!=-INF && SD!=INF)
    645645    VDST = SD - FLOOR(ASDOUBLE(SD))
    646646else
     
    659659```
    660660FLOAT SF = ASFLOAT(SRC0)
    661 if (ABS(SF) != INF || ABS(SF) != NAN)
     661if (ABS(SF) != INF && !ISNAN(SF))
    662662    VDST = FREXP_EXP(SF)
    663663else
     
    676676```
    677677DOUBLE SD = ASDOUBLE(SRC0)
    678 if (ABS(SD) != INF || ABS(SD) != NAN)
     678if (ABS(SD) != INF && !ISNAN(SD))
    679679    VDST = FREXP_EXP(SD)
    680680else
     
    694694if (ABS(SF) == INF)
    695695    VDST = -NAN
    696 else if (ABS(SF) != NAN)
     696else if (!ISNAN(SF))
    697697    VDST = FREXP_MANT(SF) * SIGN(SF)
    698698else
     
    712712if (ABS(SD) == INF)
    713713    VDST = -NAN
    714 else if (ABS(SD) != NAN)
     714else if (!ISNAN(SD))
    715715    VDST = FREXP_MANT(SD) * SIGN(SD)
    716716else
     
    10341034else if (ABS(SF)==INF)
    10351035    VDST = -NAN
    1036 else if (ABS(SF)==NAN)
     1036else if (ISNAN(SF))
    10371037    VDST = SRC0
    10381038```
  • CLRadeonExtender/trunk/doc/GcnInstrsVop2.md

    r1781 r1784  
    295295FLOAT f = RNDINT(ASFLOAT(SRC0))
    296296UINT8 VAL8 = 0
    297 if (f == NaN)
     297if (ISNAN(f))
    298298    VAL8 = (UINT8)MAX(MIN(f, 255.0), 0.0)
    299299VDST = (VDST&~mask) | (((UINT32)VAL8) << byte)
     
    313313{
    314314    FLOAT f = RNDNEINT(S*32767)
    315     if (f == NaN)
     315    if (ISNAN(f))
    316316        return 0
    317317    return (INT16)MAX(MIN(f, 32767.0), -32767.0)
     
    333333{
    334334    FLOAT f = RNDNEINT(S*65535.0)
    335     if (f == NaN)
     335    if (ISNAN(f))
    336336        return 0
    337337    return (INT16)MAX(MIN(f, 65535.0), 0.0)
     
    494494Operation: 
    495495```
    496 if (ASFLOAT(SRC1)!=NaN)
     496if (!ISNAN(ASFLOAT(SRC1)))
    497497    VDST = MAX(ASFLOAT(SRC0), ASFLOAT(SRC1))
    498498else
     
    572572Operation: 
    573573```
    574 if (ASFLOAT(SRC1)!=NaN)
     574if (!ISNAN(ASFLOAT(SRC1)))
    575575    VDST = MIN(ASFLOAT(SRC0), ASFLOAT(SRC1))
    576576else
  • CLRadeonExtender/trunk/doc/GcnInstrsVop3.md

    r1783 r1784  
    461461#### V_MIN3_F32
    462462
    463 Opcode: 337 (0x151) for GCN 1.0/1.1; 465 (0x1d0) for GCN 1.2 
    464 Syntax: V_MIN3_B32 VDST, SRC0, SRC1, SRC2 
    465 
     463Opcode: 337 (0x151) for GCN 1.0/1.1; 465 (0x1d1) for GCN 1.2 
     464Syntax: V_MIN3_F32 VDST, SRC0, SRC1, SRC2 
     465Description: Choose smallest value from FP values SRC0, SRC1, SRC2, and store it to VDST. 
     466Operation: 
     467```
     468VDST = MIN3(ASFLOAT(SRC0), ASFLOAT(SRC1), ASFLOAT(SRC2))
     469```
     470
     471#### V_MULLIT_F32
     472
     473Opcode: 336 (0x150) for GCN 1.0/1.1; 464 (0x1d0) for GCN 1.2 
     474Syntax: V_MULLIT_F32 VDST, SRC0, SRC1, SRC2 
     475Description: Multiply FP value SRC0 and FP value SRC1, and store it to VDST if FP value in
     476SRC2 is greater than zero, otherwise, store -MAX_FLOAT to VDST.
     477If one of value is 0.0 and previous condition is satisfied then always store
     4780.0 to VDST (do not apply IEEE rules for 0.0*x). 
     479Operation: 
     480```
     481VDST = -MAX_FLOAT
     482if (ASFLOAT(SRC2) > 0.0 && !ISNAN(ASFLOAT(SRC2)))
     483{
     484    VDST = 0.0
     485    if (ASFLOAT(SRC0)!=0.0 && ASFLOAT(SRC1)!=0.0)
     486        VDST = ASFLOAT(SRC0) * ASFLOAT(SRC1)
     487}
     488```
  • CLRadeonExtender/trunk/doc/GcnInstrsVopc.md

    r1780 r1784  
    9797--------------|-----------|--------------------------
    98980 (0x0)       | F         | SDST(LANEID) = 0
    99 1 (0x1)       | LT        | SDST(LANEID) = (TYPE)SRC0 < (TYPE)SRC1
    100 2 (0x2)       | EQ        | SDST(LANEID) = (TYPE)SRC0 == (TYPE)SRC1
    101 3 (0x3)       | LE        | SDST(LANEID) = (TYPE)SRC0 <= (TYPE)SRC1
    102 4 (0x4)       | GT        | SDST(LANEID) = (TYPE)SRC0 > (TYPE)SRC1
    103 5 (0x5)       | LG        | SDST(LANEID) = (TYPE)SRC0 != (TYPE)SRC1
    104 6 (0x6)       | GE        | SDST(LANEID) = (TYPE)SRC0 >= (TYPE)SRC1
    105 7 (0x7)       | O         | SDST(LANEID) = ((TYPE)SRC0!=NAN && (TYPE)SRC1!=NAN)
    106 8 (0x8)       | U         | SDST(LANEID) = ((TYPE)SRC0!=NAN || (TYPE)SRC1!=NAN)
    107 9 (0x9)       | NGE       | SDST(LANEID) = !((TYPE)SRC0 >= (TYPE)SRC1)
    108 10 (0xa)      | NLG       | SDST(LANEID) = !((TYPE)SRC0 != (TYPE)SRC1)
    109 11 (0xb)      | NGT       | SDST(LANEID) = !((TYPE)SRC0 > (TYPE)SRC1)
    110 12 (0xc)      | NLE       | SDST(LANEID) = !((TYPE)SRC0 <= (TYPE)SRC1)
    111 13 (0xd)      | NEQ       | SDST(LANEID) = !((TYPE)SRC0 == (TYPE)SRC1)
    112 14 (0xe)      | NLT       | SDST(LANEID) = !((TYPE)SRC0 < (TYPE)SRC1)
     991 (0x1)       | LT        | SDST(LANEID) = ASTYPE(SRC0) < ASTYPE(SRC1_
     1002 (0x2)       | EQ        | SDST(LANEID) = ASTYPE(SRC0) == ASTYPE(SRC1)
     1013 (0x3)       | LE        | SDST(LANEID) = ASTYPE(SRC0) <= ASTYPE(SRC1)
     1024 (0x4)       | GT        | SDST(LANEID) = ASTYPE(SRC0) > ASTYPE(SRC1)
     1035 (0x5)       | LG        | SDST(LANEID) = ASTYPE(SRC0) != ASTYPE(SRC1)
     1046 (0x6)       | GE        | SDST(LANEID) = ASTYPE(SRC0) >= ASTYPE(SRC1)
     1057 (0x7)       | O         | SDST(LANEID) = (!ISNAN(ASTYPE(SRC0)) && !ISNAN(ASTYPE(SRC1))
     1068 (0x8)       | U         | SDST(LANEID) = (!ISNAN(ASTYPE(SRC0)) || !ISNAN(ASTYPE(SRC1)))
     1079 (0x9)       | NGE       | SDST(LANEID) = !(ASTYPE(SRC0) >= ASTYPE(SRC1))
     10810 (0xa)      | NLG       | SDST(LANEID) = !(ASTYPE(SRC0) != ASTYPE(SRC1))
     10911 (0xb)      | NGT       | SDST(LANEID) = !(ASTYPE(SRC0) > ASTYPE(SRC1))
     11012 (0xc)      | NLE       | SDST(LANEID) = !(ASTYPE(SRC0) <= ASTYPE(SRC1))
     11113 (0xd)      | NEQ       | SDST(LANEID) = !(ASTYPE(SRC0) == ASTYPE(SRC1))
     11214 (0xe)      | NLT       | SDST(LANEID) = !(ASTYPE(SRC0) < ASTYPE(SRC1))
    11311315 (0xf)      | TRU, T    | SDST(LANEID) = 1
    114114
     
    117117if any operand is NaN value. This feature distinguish for example NGE from LT. 
    118118
    119 LANEID in description is lane id. TYPE is type of compared values (FLOAT for _FP32,
    120 DOUBLE for _FP64).
     119LANEID in description is lane id. ASTYPE function that treat compared values
     120as value of type (ASFLOAT for _FP32, ASDOUBLE for _FP64).
    121121
    122122Sample instructions: 
Note: See TracChangeset for help on using the changeset viewer.