Changeset 1760 in CLRX


Ignore:
Timestamp:
Nov 28, 2015, 5:19:36 PM (4 years ago)
Author:
matszpk
Message:

CLRadeonExtender: Fixed operation's listings for some VOP1 instructions. Added V_CVT_U32_F64, V_CVT_F64_U32 and rounding instructions.

File:
1 edited

Legend:

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

    r1759 r1760  
    227227Alphabetically sorted instruction list:
    228228
     229#### V_CEIL_F32
     230
     231Opcode VOP1: 34 (0x22) for GCN 1.0/1.1; 29 (0x1d) for GCN 1.2 
     232Opcode VOP3A: 418 (0x1a2) for GCN 1.0/1.1; 349 (0x15d) for GCN 1.2 
     233Syntax: V_CEIL_F32 VDST, SRC0 
     234Description: Truncate floating point valu from SRC0 with rounding to positive infinity
     235(ceilling), and store result to VDST. Implemented by flooring.
     236If SRC0 is infinity or NaN then copy SRC0 to VDST. 
     237Operation:
     238```
     239FLOAT F = FLOOR(ASFLOAT(SRC0))
     240if (ASFLOAT(SRC0) > 0.0 && ASFLOAT(SRC0) != F)
     241    F += 1.0
     242VDST = F
     243```
     244
    229245#### V_CVT_F16_F32
    230246
     
    354370```
    355371VDST = (DOUBLE)(INT32)SRC0
     372```
     373
     374#### V_CVT_F64_U32
     375
     376Opcode VOP1: 22 (0x16) 
     377Opcode VOP3A: 406 (0x196) for GCN 1.0/1.1; 342 (0x156) for GCN 1.2 
     378Syntax: V_CVT_F64_U32 VDST(2), SRC0 
     379Description: Convert unsigned 32-bit integer to double FP value, and store it to VDST. 
     380Operation: 
     381```
     382VDST = (DOUBLE)SRC0
    356383```
    357384
     
    367394Operation: 
    368395```
    369 if (ABS(SRC0)!=NAN)
    370     VDST = (INT32)MAX(MIN(FLOOR(ASFLOAT(SRC0)), 2147483647.0), -2147483648.0)
     396FLOAT SF = ASFLOAT(SF)
     397if (ABS(SF)!=NAN)
     398    VDST = (INT32)MAX(MIN(FLOOR(SF), 2147483647.0), -2147483648.0)
    371399else
    372     VDST = (INT32)SRC0>=0 ? 2147483647 : -2147483648
     400    VDST = (INT32)SF>=0 ? 2147483647 : -2147483648
    373401```
    374402
     
    385413```
    386414VDST = 0
    387 if (SRC0!=NAN)
     415if (ABS(ASFLOAT(SRC0))!=NAN)
    388416    VDST = (INT32)MAX(MIN(RNDTZINT(ASFLOAT(SRC0)), 2147483647.0), -2147483648.0)
    389417```
     
    401429```
    402430VDST = 0
    403 if (SRC0!=NAN)
     431if (ABS(ASDOUBLE(SRC0))!=NAN)
    404432    VDST = (INT32)MAX(MIN(RNDTZINT(ASDOUBLE(SRC0)), 2147483647.0), -2147483648.0)
    405433```
     
    428456Description: 
    429457```
    430 if (ABS(SRC0)!=NAN)
    431     VDST = (INT32)MAX(MIN(FLOOR(ASFLOAT(SRC0) + 0.5), 2147483647.0), -2147483648.0)
     458FLOAT SF = ASFLOAT(SRC0)
     459if (ABS(SF)!=NAN)
     460    VDST = (INT32)MAX(MIN(FLOOR(SF + 0.5), 2147483647.0), -2147483648.0)
    432461else
    433     VDST = (INT32)SRC0>=0 ? 2147483647 : -2147483648
     462    VDST = (INT32)SF>=0 ? 2147483647 : -2147483648
    434463```
    435464
     
    446475```
    447476VDST = 0
    448 if (SRC0!=NAN)
     477if (ABS(ASFLOAT(SRC0))!=NAN)
    449478    VDST = (UINT32)MIN(RNDTZINT(ASFLOAT(SRC0)), 4294967295.0)
     479```
     480
     481#### V_CVT_U32_F64
     482
     483Opcode VOP1: 21 (0x15) 
     484Opcode VOP3A: 405 (0x195) for GCN 1.0/1.1; 341 (0x155) for GCN 1.2 
     485Syntax: V_CVT_U32_F64 VDST, SRC0(2) 
     486Description: Convert 64-bit floating point value from SRC0 to unsigned 32-bit integer, and
     487store result to VDST. Conversion uses rounding to zero. If value is higher than
     488maximal integer then store MAX_UINT32 to VDST.
     489If input value is NaN then store 0 to VDST. 
     490Operation: 
     491```
     492VDST = 0
     493if (ABS(ASDOUBLE(SRC0))!=NAN)
     494    VDST = (UINT32)MIN(RNDTZINT(ASDOUBLE(SRC0)), 4294967295.0)
     495```
     496
     497#### V_FLOOR_F32
     498
     499Opcode VOP1: 37 (0x25) for GCN 1.0/1.1; 31 (0x1f) for GCN 1.2 
     500Opcode VOP3A: 421 (0x1a5) for GCN 1.0/1.1; 351 (0x15f) for GCN 1.2 
     501Syntax: V_FLOOR_F32 VDST, SRC0 
     502Description: Truncate floating point valu from SRC0 with rounding to positive infinity
     503(flooring), and store result to VDST. If SRC0 is infinity or NaN then copy SRC0 to VDST. 
     504Operation:
     505```
     506VDST = FLOOR(ASFLOAT(SRC0))
     507```
     508
     509#### V_FRACT_F32
     510
     511Opcode VOP1: 32 (0x20) for GCN 1.0/1.1; 27 (0x1b) for GCN 1.2 
     512Opcode VOP3A: 416 (0x1a0) for GCN 1.0/1.1; 347 (0x15b) for GCN 1.2 
     513Syntax: V_FRACT VDST, SRC0 
     514Description: Get fractional from floating point value SRC0 and store it to VDST.
     515Fractional will be computed by subtracting floor(SRC0) from SRC0.
     516If SRC0 is infinity or NaN then NaN with proper sign is stored to VDST. 
     517Operation: 
     518```
     519FLOAT SF = ASFLOAT(SRC0)
     520if (ABS(SF)!=NAN && SF!=-INF && SF!=INF)
     521    VDST = SF - FLOOR(ASFLOAT(SF))
     522else
     523    VDST = NAN * SIGN(SF)
    450524```
    451525
     
    491565SDST = VSRC0[firstlane]
    492566```
     567
     568#### V_RNDNE_F32
     569
     570Opcode VOP1: 35 (0x23) for GCN 1.0/1.1; 30 (0x1e) for GCN 1.2 
     571Opcode VOP3A: 420 (0x1a4) for GCN 1.0/1.1; 350 (0x15e) for GCN 1.2 
     572Syntax: V_RNDNE_F32 VDST, SRC0 
     573Description: Round floating point value SRC0 to nearest even integer, and store result to
     574VDST. If SRC0 is infinity or NaN then copy SRC0 to VDST. 
     575Operation:
     576```
     577VDST = RNDNE(ASFLOAT(SRC0))
     578```
     579
     580#### V_TRUNC_F32
     581
     582Opcode VOP1: 33 (0x21) for GCN 1.0/1.1; 28 (0x1c) for GCN 1.2 
     583Opcode VOP3A: 417 (0x1a1) for GCN 1.0/1.1; 348 (0x15c) for GCN 1.2 
     584Syntax: V_TRUNC_F32 VDST, SRC0 
     585Description: Get integer value from floating point value SRC0, and store (as float)
     586it to VDST. If SRC0 is infinity or NaN then copy SRC0 to VDST. 
     587Operation: 
     588```
     589VDST = RNDTZ(ASFLOAT(SRC0))
     590```
Note: See TracChangeset for help on using the changeset viewer.