Changes between Version 2 and Version 3 of GcnInstrsFlat


Ignore:
Timestamp:
05/02/16 23:00:23 (8 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GcnInstrsFlat

    v2 v3  
    33#!html
    44<h2>GCN ISA FLAT instructions</h2>
    5 <p>These instructions allow to access to main memory, LDS and VGPRS registers.
     5<p>These instructions allow to access to main memory, LDS and VGPR registers.
    66FLAT instructions fetch address from 2 vector registers that hold 64-bit address.
    77FLAT instruction presents only in GCN 1.1 architecture.</p>
     
    470470<h3>Instruction set</h3>
    471471<p>Alphabetically sorted instruction list:</p>
    472 <h4>BUFFER_ATOMIC_CMPSWAP</h4>
     472<h4>FLAT_ATOMIC_ADD</h4>
     473<p>Opcode: 50 (0x32) for GCN 1.0/1.1; 66 (0x42) for GCN 1.2<br />
     474Syntax: FLAT_ATOMIC_ADD VDST, VADDR(2), VDATA<br />
     475Description: Add VDATA to value of VADDR address, and store result to this address.
     476If GLC flag is set then return previous value from this address to VDST,
     477otherwise keep VDST value. Operation is atomic.<br />
     478Operation:<br />
     479<code>UINT32* VM = (UINT32*)VADDR
     480UINT32 P = *VM; *VM = *VM + VDATA; VDST = (GLC) ? P : VDST // atomic</code></p>
     481<h4>FLAT_ATOMIC_ADD_X2</h4>
     482<p>Opcode: 82 (0x52) for GCN 1.0/1.1; 98 (0x62) for GCN 1.2<br />
     483Syntax: FLAT_ATOMIC_ADD_X2 VDST(2), VADDR(2), VDATA(2)<br />
     484Description: Add 64-bit VDATA to 64-bit value of VADDR address, and store result
     485to this address. If GLC flag is set then return previous value from resource to VDST,
     486otherwise keep VDST value. Operation is atomic.<br />
     487Operation:<br />
     488<code>UINT64* VM = (UINT64*)VADDR
     489UINT64 P = *VM; *VM = *VM + VDATA; VDST = (GLC) ? P : VDST // atomic</code></p>
     490<h4>FLAT_ATOMIC_AND</h4>
     491<p>Opcode: 57 (0x39) for GCN 1.0/1.1; 72 (0x48) for GCN 1.2<br />
     492Syntax: FLAT_ATOMIC_AND VDST, VADDR(2), VDATA<br />
     493Description: Do bitwise AND on VDATA and value of VADDR address,
     494and store result to this address. If GLC flag is set then return previous value
     495from this address to VDST, otherwise keep VDST value. Operation is atomic.<br />
     496Operation:<br />
     497<code>UINT32* VM = (UINT32*)VADDR
     498UINT32 P = *VM; *VM = *VM &amp; VDATA; VDST = (GLC) ? P : VDST // atomic</code></p>
     499<h4>FLAT_ATOMIC_AND_X2</h4>
     500<p>Opcode: 89 (0x59) for GCN 1.0/1.1; 104 (0x68) for GCN 1.2<br />
     501Syntax: FLAT_ATOMIC_AND_X2 VDST(2), VADDR(2), VDATA(2)<br />
     502Description: Do 64-bit bitwise AND on VDATA and value of VADDR address,
     503and store result to this address. If GLC flag is set then return previous value
     504from this address to VDST, otherwise keep VDST value. Operation is atomic.<br />
     505Operation:<br />
     506<code>UINT64* VM = (UINT64*)VADDR
     507UINT64 P = *VM; *VM = *VM &amp; VDATA; VDST = (GLC) ? P : VDST // atomic</code></p>
     508<h4>FLAT_ATOMIC_CMPSWAP</h4>
    473509<p>Opcode: 49 (0x31) for GCN 1.0/1.1; 65 (0x41) for GCN 1.2<br />
    474510Syntax: FLAT_ATOMIC_CMPSWAP VDST, VADDR(2), VDATA(2)<br />
     
    481517UINT32 P = *VM; *VM = *VM==(VDATA&gt;&gt;32) ? VDATA&amp;0xffffffff : *VM // part of atomic
    482518VDST = (GLC) ? P : VDST // last part of atomic</code></p>
    483 <h4>BUFFER_ATOMIC_CMPSWAP_X2</h4>
     519<h4>FLAT_ATOMIC_CMPSWAP_X2</h4>
    484520<p>Opcode: 81 (0x51) for GCN 1.0/1.1; 97 (0x61) for GCN 1.2<br />
    485521Syntax: FLAT_ATOMIC_CMPSWAP_X2 VDST(2), VADDR(2), VDATA(4)<br />
     
    492528UINT64 P = *VM; *VM = *VM==(VDATA[2:3]) ? VDATA[0:1] : *VM // part of atomic
    493529VDST = (GLC) ? P : VDST // last part of atomic</code></p>
     530<h4>FLAT_ATOMIC_OR</h4>
     531<p>Opcode: 58 (0x3a) for GCN 1.0/1.1; 73 (0x49) for GCN 1.2<br />
     532Syntax: FLAT_ATOMIC_OR VDST, VADDR(2), VDATA<br />
     533Description: Do bitwise OR on VDATA and value of VADDR address,
     534and store result to this address. If GLC flag is set then return previous value
     535from this address to VDST, otherwise keep VDST value. Operation is atomic.<br />
     536Operation:<br />
     537<code>UINT32* VM = (UINT32*)VADDR
     538UINT32 P = *VM; *VM = *VM | VDATA; VDST = (GLC) ? P : VDST // atomic</code></p>
     539<h4>FLAT_ATOMIC_OR_X2</h4>
     540<p>Opcode: 90 (0x5a) for GCN 1.0/1.1; 105 (0x69) for GCN 1.2<br />
     541Syntax: FLAT_ATOMIC_OR_X2 VDST(2), VADDR(2), VDATA(2)<br />
     542Description: Do 64-bit bitwise OR on VDATA and value of VADDR address,
     543and store result to this address. If GLC flag is set then return previous value
     544from this address to VDST, otherwise keep VDST value. Operation is atomic.<br />
     545Operation:<br />
     546<code>UINT64* VM = (UINT64*)VADDR
     547UINT64 P = *VM; *VM = *VM | VDATA; VDST = (GLC) ? P : VDST // atomic</code></p>
     548<h4>FLAT_ATOMIC_SMAX</h4>
     549<p>Opcode: 55 (0x37) for GCN 1.0/1.1; 70 (0x46) for GCN 1.2<br />
     550Syntax: FLAT_ATOMIC_SMAX VDST, VADDR(2), VDATA<br />
     551Description: Choose greatest signed 32-bit value from VDATA and from VADDR address,
     552and store result to this address.
     553If GLC flag is set then return previous value from this address to VDST, otherwise keep
     554VDST value. Operation is atomic.<br />
     555Operation:<br />
     556<code>INT32* VM = (INT32*)VADDR
     557UINT32 P = *VM; *VM = MAX(*VM, (INT32)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p>
     558<h4>FLAT_ATOMIC_SMAX_X2</h4>
     559<p>Opcode: 87 (0x57) for GCN 1.0/1.1; 102 (0x66) for GCN 1.2<br />
     560Syntax: FLAT_ATOMIC_SMAX_X2 VDST(2), VADDR(2), VDATA(2)<br />
     561Description: Choose greatest signed 64-bit value from VDATA and from VADDR address,
     562and store result to this address.
     563If GLC flag is set then return previous value from this address to VDST, otherwise keep
     564VDST value. Operation is atomic.<br />
     565Operation:<br />
     566<code>INT64* VM = (INT64*)VADDR
     567UINT64 P = *VM; *VM = MAX(*VM, (INT64)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p>
     568<h4>FLAT_ATOMIC_SMIN</h4>
     569<p>Opcode: 53 (0x35) for GCN 1.0/1.1; 68 (0x44) for GCN 1.2<br />
     570Syntax: FLAT_ATOMIC_SMIN VDST, VADDR(2), VDATA<br />
     571Description: Choose smallest signed 32-bit value from VDATA and from VADDR address,
     572and store result to this address.
     573If GLC flag is set then return previous value from this address to VDST, otherwise keep
     574VDST value. Operation is atomic.<br />
     575Operation:<br />
     576<code>INT32* VM = (INT32*)VADDR
     577UINT32 P = *VM; *VM = MIN(*VM, (INT32)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p>
     578<h4>FLAT_ATOMIC_SMIN_X2</h4>
     579<p>Opcode: 85 (0x55) for GCN 1.0/1.1; 100 (0x64) for GCN 1.2<br />
     580Syntax: FLAT_ATOMIC_SMIN_X2 VDST(2), VADDR(2), VDATA(2)<br />
     581Description: Choose smallest signed 64-bit value from VDATA and from VADDR address,
     582and store result to this address.
     583If GLC flag is set then return previous value from this address to VDST, otherwise keep
     584VDST value. Operation is atomic.<br />
     585Operation:<br />
     586<code>INT64* VM = (INT64*)VADDR
     587UINT64 P = *VM; *VM = MIN(*VM, (INT64)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p>
     588<h4>FLAT_ATOMIC_SUB</h4>
     589<p>Opcode: 51 (0x33) for GCN 1.0/1.1; 67 (0x43) for GCN 1.2<br />
     590Syntax: FLAT_ATOMIC_SUB VDST, VADDR(2), VDATA<br />
     591Description: Subtract VDATA from value of VADDR address, and store result to this address.
     592If GLC flag is set then return previous value from this address to VDST,
     593otherwise keep VDST value. Operation is atomic.<br />
     594Operation:<br />
     595<code>UINT32* VM = (UINT32*)VADDR
     596UINT32 P = *VM; *VM = *VM - VDATA; VDST = (GLC) ? P : VDST // atomic</code></p>
     597<h4>FLAT_ATOMIC_SUB_X2</h4>
     598<p>Opcode: 83 (0x53) for GCN 1.0/1.1; 99 (0x63) for GCN 1.2<br />
     599Syntax: FLAT_ATOMIC_SUB_X2 VDST(2), VADDR(2), VDATA(2)<br />
     600Description: Subtract 64-bit VDATA from 64-bit value of VADDR address, and store result
     601to this address. If GLC flag is set then return previous value from resource to VDST,
     602otherwise keep VDST value. Operation is atomic.<br />
     603Operation:<br />
     604<code>UINT64* VM = (UINT64*)VADDR
     605UINT64 P = *VM; *VM = *VM - VDATA; VDST = (GLC) ? P : VDST // atomic</code></p>
    494606<h4>FLAT_ATOMIC_SWAP</h4>
    495607<p>Opcode: 48 (0x30) for GCN 1.0/1.1; 64 (0x40) for GCN 1.2<br />
     
    510622<code>UINT64* VM = (UINT64*)VADDR
    511623UINT64 P = *VM; *VM = VDATA; VDST = (GLC) ? P : VDST // atomic</code></p>
     624<h4>FLAT_ATOMIC_UMAX</h4>
     625<p>Opcode: 56 (0x38) for GCN 1.0/1.1; 71 (0x47) for GCN 1.2<br />
     626Syntax: FLAT_ATOMIC_UMAX VDST, VADDR(2), VDATA<br />
     627Description: Choose greatest unsigned 32-bit value from VDATA and from VADDR address,
     628and store result to this address.
     629If GLC flag is set then return previous value from this address to VDST, otherwise keep
     630VDST value. Operation is atomic.<br />
     631Operation:<br />
     632<code>UINT32* VM = (UINT32*)VADDR
     633UINT32 P = *VM; *VM = MAX(*VM, (UINT32)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p>
     634<h4>FLAT_ATOMIC_UMAX_X2</h4>
     635<p>Opcode: 88 (0x58) for GCN 1.0/1.1; 103 (0x67) for GCN 1.2<br />
     636Syntax: FLAT_ATOMIC_UMAX_X2 VDST(2), VADDR(2), VDATA(2)<br />
     637Description: Choose greatest unsigned 64-bit value from VDATA and from VADDR address,
     638and store result to this address.
     639If GLC flag is set then return previous value from this address to VDST, otherwise keep
     640VDST value. Operation is atomic.<br />
     641Operation:<br />
     642<code>UINT64* VM = (UINT64*)VADDR
     643UINT64 P = *VM; *VM = MAX(*VM, (UINT64)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p>
     644<h4>FLAT_ATOMIC_UMIN</h4>
     645<p>Opcode: 54 (0x36) for GCN 1.0/1.1; 69 (0x45) for GCN 1.2<br />
     646Syntax: FLAT_ATOMIC_UMIN VDST, VADDR(2), VDATA<br />
     647Description: Choose smallest unsigned 32-bit value from VDATA and from VADDR address,
     648and store result to this address.
     649If GLC flag is set then return previous value from this address to VDST, otherwise keep
     650VDST value. Operation is atomic.<br />
     651Operation:<br />
     652<code>UINT32* VM = (UINT32*)VADDR
     653UINT32 P = *VM; *VM = MIN(*VM, (UINT32)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p>
     654<h4>FLAT_ATOMIC_UMIN_X2</h4>
     655<p>Opcode: 86 (0x56) for GCN 1.0/1.1; 101 (0x65) for GCN 1.2<br />
     656Syntax: FLAT_ATOMIC_UMIN_X2 VDST(2), VADDR(2), VDATA(2)<br />
     657Description: Choose smallest unsigned 64-bit value from VDATA and from VADDR address,
     658and store result to this address.
     659If GLC flag is set then return previous value from this address to VDST, otherwise keep
     660VDST value. Operation is atomic.<br />
     661Operation:<br />
     662<code>UINT64* VM = (UINT64*)VADDR
     663UINT64 P = *VM; *VM = MIN(*VM, (UINT64)VDATA); VDST = (GLC) ? P : VDST // atomic</code></p>
     664<h4>FLAT_ATOMIC_XOR</h4>
     665<p>Opcode: 59 (0x3b) for GCN 1.0/1.1; 73 (0x4a) for GCN 1.2<br />
     666Syntax: FLAT_ATOMIC_XOR VDST, VADDR(2), VDATA<br />
     667Description: Do bitwise XOR on VDATA and value of VADDR address,
     668and store result to this address. If GLC flag is set then return previous value
     669from this address to VDST, otherwise keep VDST value. Operation is atomic.<br />
     670Operation:<br />
     671<code>UINT32* VM = (UINT32*)VADDR
     672UINT32 P = *VM; *VM = *VM ^ VDATA; VDST = (GLC) ? P : VDST // atomic</code></p>
     673<h4>FLAT_ATOMIC_XOR_X2</h4>
     674<p>Opcode: 91 (0x5b) for GCN 1.0/1.1; 106 (0x6a) for GCN 1.2<br />
     675Syntax: FLAT_ATOMIC_XOR_X2 VDST(2), VADDR(2), VDATA(2)<br />
     676Description: Do 64-bit bitwise XOR on VDATA and value of VADDR address,
     677and store result to this address. If GLC flag is set then return previous value
     678from this address to VDST, otherwise keep VDST value. Operation is atomic.<br />
     679Operation:<br />
     680<code>UINT64* VM = (UINT64*)VADDR
     681UINT64 P = *VM; *VM = *VM ^ VDATA; VDST = (GLC) ? P : VDST // atomic</code></p>
    512682<h4>FLAT_LOAD_DWORD</h4>
    513683<p>Opcode: 12 (0xc) for GCN 1.1; 20 (0x14) for GCN 1.2<br />