AMDGPUModifierSyntax.rst 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583
  1. ======================================
  2. Syntax of AMDGPU Instruction Modifiers
  3. ======================================
  4. .. contents::
  5. :local:
  6. Conventions
  7. ===========
  8. The following notation is used throughout this document:
  9. =================== =============================================================
  10. Notation Description
  11. =================== =============================================================
  12. {0..N} Any integer value in the range from 0 to N (inclusive).
  13. <x> Syntax and meaning of *x* is explained elsewhere.
  14. =================== =============================================================
  15. .. _amdgpu_syn_modifiers:
  16. Modifiers
  17. =========
  18. DS Modifiers
  19. ------------
  20. .. _amdgpu_synid_ds_offset8:
  21. offset8
  22. ~~~~~~~
  23. Specifies an immediate unsigned 8-bit offset, in bytes. The default value is 0.
  24. Used with DS instructions which have 2 addresses.
  25. =================== ====================================================================
  26. Syntax Description
  27. =================== ====================================================================
  28. offset:{0..0xFF} Specifies an unsigned 8-bit offset as a positive
  29. :ref:`integer number <amdgpu_synid_integer_number>`
  30. or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
  31. =================== ====================================================================
  32. Examples:
  33. .. parsed-literal::
  34. offset:0xff
  35. offset:2-x
  36. offset:-x-y
  37. .. _amdgpu_synid_ds_offset16:
  38. offset16
  39. ~~~~~~~~
  40. Specifies an immediate unsigned 16-bit offset, in bytes. The default value is 0.
  41. Used with DS instructions which have 1 address.
  42. ==================== ====================================================================
  43. Syntax Description
  44. ==================== ====================================================================
  45. offset:{0..0xFFFF} Specifies an unsigned 16-bit offset as a positive
  46. :ref:`integer number <amdgpu_synid_integer_number>`
  47. or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
  48. ==================== ====================================================================
  49. Examples:
  50. .. parsed-literal::
  51. offset:65535
  52. offset:0xffff
  53. offset:-x-y
  54. .. _amdgpu_synid_sw_offset16:
  55. swizzle pattern
  56. ~~~~~~~~~~~~~~~
  57. This is a special modifier which may be used with *ds_swizzle_b32* instruction only.
  58. It specifies a swizzle pattern in numeric or symbolic form. The default value is 0.
  59. See AMD documentation for more information.
  60. ======================================================= ===========================================================
  61. Syntax Description
  62. ======================================================= ===========================================================
  63. offset:{0..0xFFFF} Specifies a 16-bit swizzle pattern.
  64. offset:swizzle(QUAD_PERM,{0..3},{0..3},{0..3},{0..3}) Specifies a quad permute mode pattern
  65. Each number is a lane *id*.
  66. offset:swizzle(BITMASK_PERM, "<mask>") Specifies a bitmask permute mode pattern.
  67. The pattern converts a 5-bit lane *id* to another
  68. lane *id* with which the lane interacts.
  69. *mask* is a 5 character sequence which
  70. specifies how to transform the bits of the
  71. lane *id*.
  72. The following characters are allowed:
  73. * "0" - set bit to 0.
  74. * "1" - set bit to 1.
  75. * "p" - preserve bit.
  76. * "i" - inverse bit.
  77. offset:swizzle(BROADCAST,{2..32},{0..N}) Specifies a broadcast mode.
  78. Broadcasts the value of any particular lane to
  79. all lanes in its group.
  80. The first numeric parameter is a group
  81. size and must be equal to 2, 4, 8, 16 or 32.
  82. The second numeric parameter is an index of the
  83. lane being broadcasted.
  84. The index must not exceed group size.
  85. offset:swizzle(SWAP,{1..16}) Specifies a swap mode.
  86. Swaps the neighboring groups of
  87. 1, 2, 4, 8 or 16 lanes.
  88. offset:swizzle(REVERSE,{2..32}) Specifies a reverse mode.
  89. Reverses the lanes for groups of 2, 4, 8, 16 or 32 lanes.
  90. ======================================================= ===========================================================
  91. Note: numeric values may be specified as either :ref:`integer numbers<amdgpu_synid_integer_number>` or
  92. :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
  93. Examples:
  94. .. parsed-literal::
  95. offset:255
  96. offset:0xffff
  97. offset:swizzle(QUAD_PERM, 0, 1, 2, 3)
  98. offset:swizzle(BITMASK_PERM, "01pi0")
  99. offset:swizzle(BROADCAST, 2, 0)
  100. offset:swizzle(SWAP, 8)
  101. offset:swizzle(REVERSE, 30 + 2)
  102. .. _amdgpu_synid_gds:
  103. gds
  104. ~~~
  105. Specifies whether to use GDS or LDS memory (LDS is the default).
  106. ======================================== ================================================
  107. Syntax Description
  108. ======================================== ================================================
  109. gds Use GDS memory.
  110. ======================================== ================================================
  111. EXP Modifiers
  112. -------------
  113. .. _amdgpu_synid_done:
  114. done
  115. ~~~~
  116. Specifies if this is the last export from the shader to the target. By default,
  117. *exp* instruction does not finish an export sequence.
  118. ======================================== ================================================
  119. Syntax Description
  120. ======================================== ================================================
  121. done Indicates the last export operation.
  122. ======================================== ================================================
  123. .. _amdgpu_synid_compr:
  124. compr
  125. ~~~~~
  126. Indicates if the data are compressed (data are not compressed by default).
  127. ======================================== ================================================
  128. Syntax Description
  129. ======================================== ================================================
  130. compr Data are compressed.
  131. ======================================== ================================================
  132. .. _amdgpu_synid_vm:
  133. vm
  134. ~~
  135. Specifies valid mask flag state (off by default).
  136. ======================================== ================================================
  137. Syntax Description
  138. ======================================== ================================================
  139. vm Set valid mask flag.
  140. ======================================== ================================================
  141. FLAT Modifiers
  142. --------------
  143. .. _amdgpu_synid_flat_offset12:
  144. offset12
  145. ~~~~~~~~
  146. Specifies an immediate unsigned 12-bit offset, in bytes. The default value is 0.
  147. Cannot be used with *global/scratch* opcodes. GFX9 only.
  148. ================= ====================================================================
  149. Syntax Description
  150. ================= ====================================================================
  151. offset:{0..4095} Specifies a 12-bit unsigned offset as a positive
  152. :ref:`integer number <amdgpu_synid_integer_number>`
  153. or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
  154. ================= ====================================================================
  155. Examples:
  156. .. parsed-literal::
  157. offset:4095
  158. offset:x-0xff
  159. .. _amdgpu_synid_flat_offset13s:
  160. offset13s
  161. ~~~~~~~~~
  162. Specifies an immediate signed 13-bit offset, in bytes. The default value is 0.
  163. Can be used with *global/scratch* opcodes only. GFX9 only.
  164. ===================== ====================================================================
  165. Syntax Description
  166. ===================== ====================================================================
  167. offset:{-4096..4095} Specifies a 13-bit signed offset as an
  168. :ref:`integer number <amdgpu_synid_integer_number>`
  169. or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
  170. ===================== ====================================================================
  171. Examples:
  172. .. parsed-literal::
  173. offset:-4000
  174. offset:0x10
  175. offset:-x
  176. .. _amdgpu_synid_flat_offset12s:
  177. offset12s
  178. ~~~~~~~~~
  179. Specifies an immediate signed 12-bit offset, in bytes. The default value is 0.
  180. Can be used with *global/scratch* opcodes only.
  181. GFX10 only.
  182. ===================== ====================================================================
  183. Syntax Description
  184. ===================== ====================================================================
  185. offset:{-2048..2047} Specifies a 12-bit signed offset as an
  186. :ref:`integer number <amdgpu_synid_integer_number>`
  187. or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
  188. ===================== ====================================================================
  189. Examples:
  190. .. parsed-literal::
  191. offset:-2000
  192. offset:0x10
  193. offset:-x+y
  194. .. _amdgpu_synid_flat_offset11:
  195. offset11
  196. ~~~~~~~~
  197. Specifies an immediate unsigned 11-bit offset, in bytes. The default value is 0.
  198. Cannot be used with *global/scratch* opcodes.
  199. GFX10 only.
  200. ================= ====================================================================
  201. Syntax Description
  202. ================= ====================================================================
  203. offset:{0..2047} Specifies an 11-bit unsigned offset as a positive
  204. :ref:`integer number <amdgpu_synid_integer_number>`
  205. or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
  206. ================= ====================================================================
  207. Examples:
  208. .. parsed-literal::
  209. offset:2047
  210. offset:x+0xff
  211. dlc
  212. ~~~
  213. See a description :ref:`here<amdgpu_synid_dlc>`. GFX10 only.
  214. glc
  215. ~~~
  216. See a description :ref:`here<amdgpu_synid_glc>`.
  217. lds
  218. ~~~
  219. See a description :ref:`here<amdgpu_synid_lds>`. GFX10 only.
  220. slc
  221. ~~~
  222. See a description :ref:`here<amdgpu_synid_slc>`.
  223. tfe
  224. ~~~
  225. See a description :ref:`here<amdgpu_synid_tfe>`.
  226. nv
  227. ~~
  228. See a description :ref:`here<amdgpu_synid_nv>`.
  229. MIMG Modifiers
  230. --------------
  231. .. _amdgpu_synid_dmask:
  232. dmask
  233. ~~~~~
  234. Specifies which channels (image components) are used by the operation. By default, no channels
  235. are used.
  236. =============== ====================================================================
  237. Syntax Description
  238. =============== ====================================================================
  239. dmask:{0..15} Specifies image channels as a positive
  240. :ref:`integer number <amdgpu_synid_integer_number>`
  241. or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
  242. Each bit corresponds to one of 4 image components (RGBA).
  243. If the specified bit value is 0, the component is not used,
  244. value 1 means that the component is used.
  245. =============== ====================================================================
  246. This modifier has some limitations depending on instruction kind:
  247. =================================================== ========================
  248. Instruction Kind Valid dmask Values
  249. =================================================== ========================
  250. 32-bit atomic *cmpswap* 0x3
  251. 32-bit atomic instructions except for *cmpswap* 0x1
  252. 64-bit atomic *cmpswap* 0xF
  253. 64-bit atomic instructions except for *cmpswap* 0x3
  254. *gather4* 0x1, 0x2, 0x4, 0x8
  255. Other instructions any value
  256. =================================================== ========================
  257. Examples:
  258. .. parsed-literal::
  259. dmask:0xf
  260. dmask:0b1111
  261. dmask:x|y|z
  262. .. _amdgpu_synid_unorm:
  263. unorm
  264. ~~~~~
  265. Specifies whether the address is normalized or not (the address is normalized by default).
  266. ======================== ========================================
  267. Syntax Description
  268. ======================== ========================================
  269. unorm Force the address to be unnormalized.
  270. ======================== ========================================
  271. glc
  272. ~~~
  273. See a description :ref:`here<amdgpu_synid_glc>`.
  274. slc
  275. ~~~
  276. See a description :ref:`here<amdgpu_synid_slc>`.
  277. .. _amdgpu_synid_r128:
  278. r128
  279. ~~~~
  280. Specifies texture resource size. The default size is 256 bits.
  281. GFX7, GFX8 and GFX10 only.
  282. =================== ================================================
  283. Syntax Description
  284. =================== ================================================
  285. r128 Specifies 128 bits texture resource size.
  286. =================== ================================================
  287. .. WARNING:: Using this modifier should descrease *rsrc* operand size from 8 to 4 dwords, but assembler does not currently support this feature.
  288. tfe
  289. ~~~
  290. See a description :ref:`here<amdgpu_synid_tfe>`.
  291. .. _amdgpu_synid_lwe:
  292. lwe
  293. ~~~
  294. Specifies LOD warning status (LOD warning is disabled by default).
  295. ======================================== ================================================
  296. Syntax Description
  297. ======================================== ================================================
  298. lwe Enables LOD warning.
  299. ======================================== ================================================
  300. .. _amdgpu_synid_da:
  301. da
  302. ~~
  303. Specifies if an array index must be sent to TA. By default, array index is not sent.
  304. ======================================== ================================================
  305. Syntax Description
  306. ======================================== ================================================
  307. da Send an array-index to TA.
  308. ======================================== ================================================
  309. .. _amdgpu_synid_d16:
  310. d16
  311. ~~~
  312. Specifies data size: 16 or 32 bits (32 bits by default). Not supported by GFX7.
  313. ======================================== ================================================
  314. Syntax Description
  315. ======================================== ================================================
  316. d16 Enables 16-bits data mode.
  317. On loads, convert data in memory to 16-bit
  318. format before storing it in VGPRs.
  319. For stores, convert 16-bit data in VGPRs to
  320. 32 bits before going to memory.
  321. Note that GFX8.0 does not support data packing.
  322. Each 16-bit data element occupies 1 VGPR.
  323. GFX8.1, GFX9 and GFX10 support data packing.
  324. Each pair of 16-bit data elements
  325. occupies 1 VGPR.
  326. ======================================== ================================================
  327. .. _amdgpu_synid_a16:
  328. a16
  329. ~~~
  330. Specifies size of image address components: 16 or 32 bits (32 bits by default).
  331. GFX9 and GFX10 only.
  332. ======================================== ================================================
  333. Syntax Description
  334. ======================================== ================================================
  335. a16 Enables 16-bits image address components.
  336. ======================================== ================================================
  337. .. _amdgpu_synid_dim:
  338. dim
  339. ~~~
  340. Specifies surface dimension. This is a mandatory modifier. There is no default value.
  341. GFX10 only.
  342. =============================== =========================================================
  343. Syntax Description
  344. =============================== =========================================================
  345. dim:1D One-dimensional image.
  346. dim:2D Two-dimensional image.
  347. dim:3D Three-dimensional image.
  348. dim:CUBE Cubemap array.
  349. dim:1D_ARRAY One-dimensional image array.
  350. dim:2D_ARRAY Two-dimensional image array.
  351. dim:2D_MSAA Two-dimensional multi-sample auto-aliasing image.
  352. dim:2D_MSAA_ARRAY Two-dimensional multi-sample auto-aliasing image array.
  353. =============================== =========================================================
  354. The following table defines an alternative syntax which is supported
  355. for compatibility with SP3 assembler:
  356. =============================== =========================================================
  357. Syntax Description
  358. =============================== =========================================================
  359. dim:SQ_RSRC_IMG_1D One-dimensional image.
  360. dim:SQ_RSRC_IMG_2D Two-dimensional image.
  361. dim:SQ_RSRC_IMG_3D Three-dimensional image.
  362. dim:SQ_RSRC_IMG_CUBE Cubemap array.
  363. dim:SQ_RSRC_IMG_1D_ARRAY One-dimensional image array.
  364. dim:SQ_RSRC_IMG_2D_ARRAY Two-dimensional image array.
  365. dim:SQ_RSRC_IMG_2D_MSAA Two-dimensional multi-sample auto-aliasing image.
  366. dim:SQ_RSRC_IMG_2D_MSAA_ARRAY Two-dimensional multi-sample auto-aliasing image array.
  367. =============================== =========================================================
  368. dlc
  369. ~~~
  370. See a description :ref:`here<amdgpu_synid_dlc>`. GFX10 only.
  371. Miscellaneous Modifiers
  372. -----------------------
  373. .. _amdgpu_synid_dlc:
  374. dlc
  375. ~~~
  376. Controls device level cache policy for memory operations. Used for synchronization.
  377. When specified, forces operation to bypass device level cache making the operation device
  378. level coherent. By default, instructions use device level cache.
  379. GFX10 only.
  380. ======================================== ================================================
  381. Syntax Description
  382. ======================================== ================================================
  383. dlc Bypass device level cache.
  384. ======================================== ================================================
  385. .. _amdgpu_synid_glc:
  386. glc
  387. ~~~
  388. This modifier has different meaning for loads, stores, and atomic operations.
  389. The default value is off (0).
  390. See AMD documentation for details.
  391. ======================================== ================================================
  392. Syntax Description
  393. ======================================== ================================================
  394. glc Set glc bit to 1.
  395. ======================================== ================================================
  396. .. _amdgpu_synid_lds:
  397. lds
  398. ~~~
  399. Specifies where to store the result: VGPRs or LDS (VGPRs by default).
  400. ======================================== ===========================
  401. Syntax Description
  402. ======================================== ===========================
  403. lds Store result in LDS.
  404. ======================================== ===========================
  405. .. _amdgpu_synid_nv:
  406. nv
  407. ~~
  408. Specifies if instruction is operating on non-volatile memory. By default, memory is volatile.
  409. GFX9 only.
  410. ======================================== ================================================
  411. Syntax Description
  412. ======================================== ================================================
  413. nv Indicates that instruction operates on
  414. non-volatile memory.
  415. ======================================== ================================================
  416. .. _amdgpu_synid_slc:
  417. slc
  418. ~~~
  419. Specifies cache policy. The default value is off (0).
  420. See AMD documentation for details.
  421. ======================================== ================================================
  422. Syntax Description
  423. ======================================== ================================================
  424. slc Set slc bit to 1.
  425. ======================================== ================================================
  426. .. _amdgpu_synid_tfe:
  427. tfe
  428. ~~~
  429. Controls access to partially resident textures. The default value is off (0).
  430. See AMD documentation for details.
  431. ======================================== ================================================
  432. Syntax Description
  433. ======================================== ================================================
  434. tfe Set tfe bit to 1.
  435. ======================================== ================================================
  436. MUBUF/MTBUF Modifiers
  437. ---------------------
  438. .. _amdgpu_synid_idxen:
  439. idxen
  440. ~~~~~
  441. Specifies whether address components include an index. By default, no components are used.
  442. Can be used together with :ref:`offen<amdgpu_synid_offen>`.
  443. Cannot be used with :ref:`addr64<amdgpu_synid_addr64>`.
  444. ======================================== ================================================
  445. Syntax Description
  446. ======================================== ================================================
  447. idxen Address components include an index.
  448. ======================================== ================================================
  449. .. _amdgpu_synid_offen:
  450. offen
  451. ~~~~~
  452. Specifies whether address components include an offset. By default, no components are used.
  453. Can be used together with :ref:`idxen<amdgpu_synid_idxen>`.
  454. Cannot be used with :ref:`addr64<amdgpu_synid_addr64>`.
  455. ======================================== ================================================
  456. Syntax Description
  457. ======================================== ================================================
  458. offen Address components include an offset.
  459. ======================================== ================================================
  460. .. _amdgpu_synid_addr64:
  461. addr64
  462. ~~~~~~
  463. Specifies whether a 64-bit address is used. By default, no address is used.
  464. GFX7 only. Cannot be used with :ref:`offen<amdgpu_synid_offen>` and
  465. :ref:`idxen<amdgpu_synid_idxen>` modifiers.
  466. ======================================== ================================================
  467. Syntax Description
  468. ======================================== ================================================
  469. addr64 A 64-bit address is used.
  470. ======================================== ================================================
  471. .. _amdgpu_synid_buf_offset12:
  472. offset12
  473. ~~~~~~~~
  474. Specifies an immediate unsigned 12-bit offset, in bytes. The default value is 0.
  475. ================== ====================================================================
  476. Syntax Description
  477. ================== ====================================================================
  478. offset:{0..0xFFF} Specifies a 12-bit unsigned offset as a positive
  479. :ref:`integer number <amdgpu_synid_integer_number>`
  480. or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
  481. ================== ====================================================================
  482. Examples:
  483. .. parsed-literal::
  484. offset:x+y
  485. offset:0x10
  486. glc
  487. ~~~
  488. See a description :ref:`here<amdgpu_synid_glc>`.
  489. slc
  490. ~~~
  491. See a description :ref:`here<amdgpu_synid_slc>`.
  492. lds
  493. ~~~
  494. See a description :ref:`here<amdgpu_synid_lds>`.
  495. dlc
  496. ~~~
  497. See a description :ref:`here<amdgpu_synid_dlc>`. GFX10 only.
  498. tfe
  499. ~~~
  500. See a description :ref:`here<amdgpu_synid_tfe>`.
  501. .. _amdgpu_synid_dfmt:
  502. dfmt
  503. ~~~~
  504. TBD
  505. .. _amdgpu_synid_nfmt:
  506. nfmt
  507. ~~~~
  508. TBD
  509. SMRD/SMEM Modifiers
  510. -------------------
  511. glc
  512. ~~~
  513. See a description :ref:`here<amdgpu_synid_glc>`.
  514. nv
  515. ~~
  516. See a description :ref:`here<amdgpu_synid_nv>`. GFX9 only.
  517. dlc
  518. ~~~
  519. See a description :ref:`here<amdgpu_synid_dlc>`. GFX10 only.
  520. VINTRP Modifiers
  521. ----------------
  522. .. _amdgpu_synid_high:
  523. high
  524. ~~~~
  525. Specifies which half of the LDS word to use. Low half of LDS word is used by default.
  526. GFX9 and GFX10 only.
  527. ======================================== ================================
  528. Syntax Description
  529. ======================================== ================================
  530. high Use high half of LDS word.
  531. ======================================== ================================
  532. DPP8 Modifiers
  533. --------------
  534. GFX10 only.
  535. .. _amdgpu_synid_dpp8_sel:
  536. dpp8_sel
  537. ~~~~~~~~
  538. Selects which lanes to pull data from, within a group of 8 lanes. This is a mandatory modifier.
  539. There is no default value.
  540. GFX10 only.
  541. The *dpp8_sel* modifier must specify exactly 8 values.
  542. First value selects which lane to read from to supply data into lane 0.
  543. Second value controls lane 1 and so on.
  544. Each value may be specified as either
  545. an :ref:`integer number<amdgpu_synid_integer_number>` or
  546. an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
  547. =============================================================== ===========================
  548. Syntax Description
  549. =============================================================== ===========================
  550. dpp8:[{0..7},{0..7},{0..7},{0..7},{0..7},{0..7},{0..7},{0..7}] Select lanes to read from.
  551. =============================================================== ===========================
  552. Examples:
  553. .. parsed-literal::
  554. dpp8:[7,6,5,4,3,2,1,0]
  555. dpp8:[0,1,0,1,0,1,0,1]
  556. .. _amdgpu_synid_fi8:
  557. fi
  558. ~~
  559. Controls interaction with inactive lanes for *dpp8* instructions. The default value is zero.
  560. Note: *inactive* lanes are those whose :ref:`exec<amdgpu_synid_exec>` mask bit is zero.
  561. GFX10 only.
  562. ==================================== =====================================================
  563. Syntax Description
  564. ==================================== =====================================================
  565. fi:0 Fetch zero when accessing data from inactive lanes.
  566. fi:1 Fetch pre-exist values from inactive lanes.
  567. ==================================== =====================================================
  568. Note: numeric values may be specified as either :ref:`integer numbers<amdgpu_synid_integer_number>` or
  569. :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
  570. DPP/DPP16 Modifiers
  571. -------------------
  572. GFX8, GFX9 and GFX10 only.
  573. .. _amdgpu_synid_dpp_ctrl:
  574. dpp_ctrl
  575. ~~~~~~~~
  576. Specifies how data are shared between threads. This is a mandatory modifier.
  577. There is no default value.
  578. GFX8 and GFX9 only. Use :ref:`dpp16_ctrl<amdgpu_synid_dpp16_ctrl>` for GFX10.
  579. Note: the lanes of a wavefront are organized in four *rows* and four *banks*.
  580. ======================================== ================================================
  581. Syntax Description
  582. ======================================== ================================================
  583. quad_perm:[{0..3},{0..3},{0..3},{0..3}] Full permute of 4 threads.
  584. row_mirror Mirror threads within row.
  585. row_half_mirror Mirror threads within 1/2 row (8 threads).
  586. row_bcast:15 Broadcast 15th thread of each row to next row.
  587. row_bcast:31 Broadcast thread 31 to rows 2 and 3.
  588. wave_shl:1 Wavefront left shift by 1 thread.
  589. wave_rol:1 Wavefront left rotate by 1 thread.
  590. wave_shr:1 Wavefront right shift by 1 thread.
  591. wave_ror:1 Wavefront right rotate by 1 thread.
  592. row_shl:{1..15} Row shift left by 1-15 threads.
  593. row_shr:{1..15} Row shift right by 1-15 threads.
  594. row_ror:{1..15} Row rotate right by 1-15 threads.
  595. ======================================== ================================================
  596. Note: numeric values may be specified as either
  597. :ref:`integer numbers<amdgpu_synid_integer_number>` or
  598. :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
  599. Examples:
  600. .. parsed-literal::
  601. quad_perm:[0, 1, 2, 3]
  602. row_shl:3
  603. .. _amdgpu_synid_dpp16_ctrl:
  604. dpp16_ctrl
  605. ~~~~~~~~~~
  606. Specifies how data are shared between threads. This is a mandatory modifier.
  607. There is no default value.
  608. GFX10 only. Use :ref:`dpp_ctrl<amdgpu_synid_dpp_ctrl>` for GFX8 and GFX9.
  609. Note: the lanes of a wavefront are organized in four *rows* and four *banks*.
  610. (There are only two rows in *wave32* mode.)
  611. ======================================== ====================================================
  612. Syntax Description
  613. ======================================== ====================================================
  614. quad_perm:[{0..3},{0..3},{0..3},{0..3}] Full permute of 4 threads.
  615. row_mirror Mirror threads within row.
  616. row_half_mirror Mirror threads within 1/2 row (8 threads).
  617. row_share:{0..15} Share the value from the specified lane with other
  618. lanes in the row.
  619. row_xmask:{0..15} Fetch from XOR(current lane id, specified lane id).
  620. row_shl:{1..15} Row shift left by 1-15 threads.
  621. row_shr:{1..15} Row shift right by 1-15 threads.
  622. row_ror:{1..15} Row rotate right by 1-15 threads.
  623. ======================================== ====================================================
  624. Note: numeric values may be specified as either
  625. :ref:`integer numbers<amdgpu_synid_integer_number>` or
  626. :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
  627. Examples:
  628. .. parsed-literal::
  629. quad_perm:[0, 1, 2, 3]
  630. row_shl:3
  631. .. _amdgpu_synid_row_mask:
  632. row_mask
  633. ~~~~~~~~
  634. Controls which rows are enabled for data sharing. By default, all rows are enabled.
  635. Note: the lanes of a wavefront are organized in four *rows* and four *banks*.
  636. (There are only two rows in *wave32* mode.)
  637. ================= ====================================================================
  638. Syntax Description
  639. ================= ====================================================================
  640. row_mask:{0..15} Specifies a *row mask* as a positive
  641. :ref:`integer number <amdgpu_synid_integer_number>`
  642. or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
  643. Each of 4 bits in the mask controls one row
  644. (0 - disabled, 1 - enabled).
  645. In *wave32* mode the values should be limited to 0..7.
  646. ================= ====================================================================
  647. Examples:
  648. .. parsed-literal::
  649. row_mask:0xf
  650. row_mask:0b1010
  651. row_mask:x|y
  652. .. _amdgpu_synid_bank_mask:
  653. bank_mask
  654. ~~~~~~~~~
  655. Controls which banks are enabled for data sharing. By default, all banks are enabled.
  656. Note: the lanes of a wavefront are organized in four *rows* and four *banks*.
  657. (There are only two rows in *wave32* mode.)
  658. ================== ====================================================================
  659. Syntax Description
  660. ================== ====================================================================
  661. bank_mask:{0..15} Specifies a *bank mask* as a positive
  662. :ref:`integer number <amdgpu_synid_integer_number>`
  663. or an :ref:`absolute expression<amdgpu_synid_absolute_expression>`.
  664. Each of 4 bits in the mask controls one bank
  665. (0 - disabled, 1 - enabled).
  666. ================== ====================================================================
  667. Examples:
  668. .. parsed-literal::
  669. bank_mask:0x3
  670. bank_mask:0b0011
  671. bank_mask:x&y
  672. .. _amdgpu_synid_bound_ctrl:
  673. bound_ctrl
  674. ~~~~~~~~~~
  675. Controls data sharing when accessing an invalid lane. By default, data sharing with
  676. invalid lanes is disabled.
  677. ======================================== ================================================
  678. Syntax Description
  679. ======================================== ================================================
  680. bound_ctrl:0 Enables data sharing with invalid lanes.
  681. Accessing data from an invalid lane will
  682. return zero.
  683. ======================================== ================================================
  684. .. _amdgpu_synid_fi16:
  685. fi
  686. ~~
  687. Controls interaction with *inactive* lanes for *dpp16* instructions. The default value is zero.
  688. Note: *inactive* lanes are those whose :ref:`exec<amdgpu_synid_exec>` mask bit is zero.
  689. GFX10 only.
  690. ======================================== ==================================================
  691. Syntax Description
  692. ======================================== ==================================================
  693. fi:0 Interaction with inactive lanes is controlled by
  694. :ref:`bound_ctrl<amdgpu_synid_bound_ctrl>`.
  695. fi:1 Fetch pre-exist values from inactive lanes.
  696. ======================================== ==================================================
  697. Note: numeric values may be specified as either :ref:`integer numbers<amdgpu_synid_integer_number>` or
  698. :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
  699. SDWA Modifiers
  700. --------------
  701. GFX8, GFX9 and GFX10 only.
  702. clamp
  703. ~~~~~
  704. See a description :ref:`here<amdgpu_synid_clamp>`.
  705. omod
  706. ~~~~
  707. See a description :ref:`here<amdgpu_synid_omod>`.
  708. GFX9 and GFX10 only.
  709. .. _amdgpu_synid_dst_sel:
  710. dst_sel
  711. ~~~~~~~
  712. Selects which bits in the destination are affected. By default, all bits are affected.
  713. ======================================== ================================================
  714. Syntax Description
  715. ======================================== ================================================
  716. dst_sel:DWORD Use bits 31:0.
  717. dst_sel:BYTE_0 Use bits 7:0.
  718. dst_sel:BYTE_1 Use bits 15:8.
  719. dst_sel:BYTE_2 Use bits 23:16.
  720. dst_sel:BYTE_3 Use bits 31:24.
  721. dst_sel:WORD_0 Use bits 15:0.
  722. dst_sel:WORD_1 Use bits 31:16.
  723. ======================================== ================================================
  724. .. _amdgpu_synid_dst_unused:
  725. dst_unused
  726. ~~~~~~~~~~
  727. Controls what to do with the bits in the destination which are not selected
  728. by :ref:`dst_sel<amdgpu_synid_dst_sel>`.
  729. By default, unused bits are preserved.
  730. ======================================== ================================================
  731. Syntax Description
  732. ======================================== ================================================
  733. dst_unused:UNUSED_PAD Pad with zeros.
  734. dst_unused:UNUSED_SEXT Sign-extend upper bits, zero lower bits.
  735. dst_unused:UNUSED_PRESERVE Preserve bits.
  736. ======================================== ================================================
  737. .. _amdgpu_synid_src0_sel:
  738. src0_sel
  739. ~~~~~~~~
  740. Controls which bits in the src0 are used. By default, all bits are used.
  741. ======================================== ================================================
  742. Syntax Description
  743. ======================================== ================================================
  744. src0_sel:DWORD Use bits 31:0.
  745. src0_sel:BYTE_0 Use bits 7:0.
  746. src0_sel:BYTE_1 Use bits 15:8.
  747. src0_sel:BYTE_2 Use bits 23:16.
  748. src0_sel:BYTE_3 Use bits 31:24.
  749. src0_sel:WORD_0 Use bits 15:0.
  750. src0_sel:WORD_1 Use bits 31:16.
  751. ======================================== ================================================
  752. .. _amdgpu_synid_src1_sel:
  753. src1_sel
  754. ~~~~~~~~
  755. Controls which bits in the src1 are used. By default, all bits are used.
  756. ======================================== ================================================
  757. Syntax Description
  758. ======================================== ================================================
  759. src1_sel:DWORD Use bits 31:0.
  760. src1_sel:BYTE_0 Use bits 7:0.
  761. src1_sel:BYTE_1 Use bits 15:8.
  762. src1_sel:BYTE_2 Use bits 23:16.
  763. src1_sel:BYTE_3 Use bits 31:24.
  764. src1_sel:WORD_0 Use bits 15:0.
  765. src1_sel:WORD_1 Use bits 31:16.
  766. ======================================== ================================================
  767. .. _amdgpu_synid_sdwa_operand_modifiers:
  768. SDWA Operand Modifiers
  769. ----------------------
  770. Operand modifiers are not used separately. They are applied to source operands.
  771. GFX8, GFX9 and GFX10 only.
  772. abs
  773. ~~~
  774. See a description :ref:`here<amdgpu_synid_abs>`.
  775. neg
  776. ~~~
  777. See a description :ref:`here<amdgpu_synid_neg>`.
  778. .. _amdgpu_synid_sext:
  779. sext
  780. ~~~~
  781. Sign-extends value of a (sub-dword) operand to fill all 32 bits.
  782. Has no effect for 32-bit operands.
  783. Valid for integer operands only.
  784. ======================================== ================================================
  785. Syntax Description
  786. ======================================== ================================================
  787. sext(<operand>) Sign-extend operand value.
  788. ======================================== ================================================
  789. Examples:
  790. .. parsed-literal::
  791. sext(v4)
  792. sext(v255)
  793. VOP3 Modifiers
  794. --------------
  795. .. _amdgpu_synid_vop3_op_sel:
  796. op_sel
  797. ~~~~~~
  798. Selects the low [15:0] or high [31:16] operand bits for source and destination operands.
  799. By default, low bits are used for all operands.
  800. The number of values specified with the op_sel modifier must match the number of instruction
  801. operands (both source and destination). First value controls src0, second value controls src1
  802. and so on, except that the last value controls destination.
  803. The value 0 selects the low bits, while 1 selects the high bits.
  804. Note: op_sel modifier affects 16-bit operands only. For 32-bit operands the value specified
  805. by op_sel must be 0.
  806. GFX9 and GFX10 only.
  807. ======================================== ============================================================
  808. Syntax Description
  809. ======================================== ============================================================
  810. op_sel:[{0..1},{0..1}] Select operand bits for instructions with 1 source operand.
  811. op_sel:[{0..1},{0..1},{0..1}] Select operand bits for instructions with 2 source operands.
  812. op_sel:[{0..1},{0..1},{0..1},{0..1}] Select operand bits for instructions with 3 source operands.
  813. ======================================== ============================================================
  814. Note: numeric values may be specified as either
  815. :ref:`integer numbers<amdgpu_synid_integer_number>` or
  816. :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
  817. Examples:
  818. .. parsed-literal::
  819. op_sel:[0,0]
  820. op_sel:[0,1]
  821. .. _amdgpu_synid_clamp:
  822. clamp
  823. ~~~~~
  824. Clamp meaning depends on instruction.
  825. For *v_cmp* instructions, clamp modifier indicates that the compare signals
  826. if a floating point exception occurs. By default, signaling is disabled.
  827. Not supported by GFX7.
  828. For integer operations, clamp modifier indicates that the result must be clamped
  829. to the largest and smallest representable value. By default, there is no clamping.
  830. Integer clamping is not supported by GFX7.
  831. For floating point operations, clamp modifier indicates that the result must be clamped
  832. to the range [0.0, 1.0]. By default, there is no clamping.
  833. Note: clamp modifier is applied after :ref:`output modifiers<amdgpu_synid_omod>` (if any).
  834. ======================================== ================================================
  835. Syntax Description
  836. ======================================== ================================================
  837. clamp Enables clamping (or signaling).
  838. ======================================== ================================================
  839. .. _amdgpu_synid_omod:
  840. omod
  841. ~~~~
  842. Specifies if an output modifier must be applied to the result.
  843. By default, no output modifiers are applied.
  844. Note: output modifiers are applied before :ref:`clamping<amdgpu_synid_clamp>` (if any).
  845. Output modifiers are valid for f32 and f64 floating point results only.
  846. They must not be used with f16.
  847. Note: *v_cvt_f16_f32* is an exception. This instruction produces f16 result
  848. but accepts output modifiers.
  849. ======================================== ================================================
  850. Syntax Description
  851. ======================================== ================================================
  852. mul:2 Multiply the result by 2.
  853. mul:4 Multiply the result by 4.
  854. div:2 Multiply the result by 0.5.
  855. ======================================== ================================================
  856. Note: numeric values may be specified as either :ref:`integer numbers<amdgpu_synid_integer_number>` or
  857. :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
  858. Examples:
  859. .. parsed-literal::
  860. mul:2
  861. mul:x // x must be equal to 2 or 4
  862. .. _amdgpu_synid_vop3_operand_modifiers:
  863. VOP3 Operand Modifiers
  864. ----------------------
  865. Operand modifiers are not used separately. They are applied to source operands.
  866. .. _amdgpu_synid_abs:
  867. abs
  868. ~~~
  869. Computes the absolute value of its operand. Must be applied before :ref:`neg<amdgpu_synid_neg>`
  870. (if any). Valid for floating point operands only.
  871. ======================================== ====================================================
  872. Syntax Description
  873. ======================================== ====================================================
  874. abs(<operand>) Get the absolute value of a floating-point operand.
  875. \|<operand>| The same as above (an SP3 syntax).
  876. ======================================== ====================================================
  877. Note: avoid using SP3 syntax with operands specified as expressions because the trailing '|'
  878. may be misinterpreted. Such operands should be enclosed into additional parentheses as shown
  879. in examples below.
  880. Examples:
  881. .. parsed-literal::
  882. abs(v36)
  883. \|v36|
  884. abs(x|y) // ok
  885. \|(x|y)| // additional parentheses are required
  886. .. _amdgpu_synid_neg:
  887. neg
  888. ~~~
  889. Computes the negative value of its operand. Must be applied after :ref:`abs<amdgpu_synid_abs>`
  890. (if any). Valid for floating point operands only.
  891. ================== ====================================================
  892. Syntax Description
  893. ================== ====================================================
  894. neg(<operand>) Get the negative value of a floating-point operand.
  895. The operand may include an optional
  896. :ref:`abs<amdgpu_synid_abs>` modifier.
  897. -<operand> The same as above (an SP3 syntax).
  898. ================== ====================================================
  899. Note: SP3 syntax is supported with limitations because of a potential ambiguity.
  900. Currently it is allowed in the following cases:
  901. * Before a register.
  902. * Before an :ref:`abs<amdgpu_synid_abs>` modifier.
  903. * Before an SP3 :ref:`abs<amdgpu_synid_abs>` modifier.
  904. In all other cases "-" is handled as a part of an expression that follows the sign.
  905. Examples:
  906. .. parsed-literal::
  907. // Operands with negate modifiers
  908. neg(v[0])
  909. neg(1.0)
  910. neg(abs(v0))
  911. -v5
  912. -abs(v5)
  913. -\|v5|
  914. // Operands without negate modifiers
  915. -1
  916. -x+y
  917. VOP3P Modifiers
  918. ---------------
  919. This section describes modifiers of *regular* VOP3P instructions.
  920. *v_mad_mix_f32*, *v_mad_mixhi_f16* and *v_mad_mixlo_f16*
  921. instructions use these modifiers :ref:`in a special manner<amdgpu_synid_mad_mix>`.
  922. GFX9 and GFX10 only.
  923. .. _amdgpu_synid_op_sel:
  924. op_sel
  925. ~~~~~~
  926. Selects the low [15:0] or high [31:16] operand bits as input to the operation
  927. which results in the lower-half of the destination.
  928. By default, low bits are used for all operands.
  929. The number of values specified by the *op_sel* modifier must match the number of source
  930. operands. First value controls src0, second value controls src1 and so on.
  931. The value 0 selects the low bits, while 1 selects the high bits.
  932. ================================= =============================================================
  933. Syntax Description
  934. ================================= =============================================================
  935. op_sel:[{0..1}] Select operand bits for instructions with 1 source operand.
  936. op_sel:[{0..1},{0..1}] Select operand bits for instructions with 2 source operands.
  937. op_sel:[{0..1},{0..1},{0..1}] Select operand bits for instructions with 3 source operands.
  938. ================================= =============================================================
  939. Note: numeric values may be specified as either
  940. :ref:`integer numbers<amdgpu_synid_integer_number>` or
  941. :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
  942. Examples:
  943. .. parsed-literal::
  944. op_sel:[0,0]
  945. op_sel:[0,1,0]
  946. .. _amdgpu_synid_op_sel_hi:
  947. op_sel_hi
  948. ~~~~~~~~~
  949. Selects the low [15:0] or high [31:16] operand bits as input to the operation
  950. which results in the upper-half of the destination.
  951. By default, high bits are used for all operands.
  952. The number of values specified by the *op_sel_hi* modifier must match the number of source
  953. operands. First value controls src0, second value controls src1 and so on.
  954. The value 0 selects the low bits, while 1 selects the high bits.
  955. =================================== =============================================================
  956. Syntax Description
  957. =================================== =============================================================
  958. op_sel_hi:[{0..1}] Select operand bits for instructions with 1 source operand.
  959. op_sel_hi:[{0..1},{0..1}] Select operand bits for instructions with 2 source operands.
  960. op_sel_hi:[{0..1},{0..1},{0..1}] Select operand bits for instructions with 3 source operands.
  961. =================================== =============================================================
  962. Note: numeric values may be specified as either
  963. :ref:`integer numbers<amdgpu_synid_integer_number>` or
  964. :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
  965. Examples:
  966. .. parsed-literal::
  967. op_sel_hi:[0,0]
  968. op_sel_hi:[0,0,1]
  969. .. _amdgpu_synid_neg_lo:
  970. neg_lo
  971. ~~~~~~
  972. Specifies whether to change sign of operand values selected by
  973. :ref:`op_sel<amdgpu_synid_op_sel>`. These values are then used
  974. as input to the operation which results in the upper-half of the destination.
  975. The number of values specified by this modifier must match the number of source
  976. operands. First value controls src0, second value controls src1 and so on.
  977. The value 0 indicates that the corresponding operand value is used unmodified,
  978. the value 1 indicates that negative value of the operand must be used.
  979. By default, operand values are used unmodified.
  980. This modifier is valid for floating point operands only.
  981. ================================ ==================================================================
  982. Syntax Description
  983. ================================ ==================================================================
  984. neg_lo:[{0..1}] Select affected operands for instructions with 1 source operand.
  985. neg_lo:[{0..1},{0..1}] Select affected operands for instructions with 2 source operands.
  986. neg_lo:[{0..1},{0..1},{0..1}] Select affected operands for instructions with 3 source operands.
  987. ================================ ==================================================================
  988. Note: numeric values may be specified as either
  989. :ref:`integer numbers<amdgpu_synid_integer_number>` or
  990. :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
  991. Examples:
  992. .. parsed-literal::
  993. neg_lo:[0]
  994. neg_lo:[0,1]
  995. .. _amdgpu_synid_neg_hi:
  996. neg_hi
  997. ~~~~~~
  998. Specifies whether to change sign of operand values selected by
  999. :ref:`op_sel_hi<amdgpu_synid_op_sel_hi>`. These values are then used
  1000. as input to the operation which results in the upper-half of the destination.
  1001. The number of values specified by this modifier must match the number of source
  1002. operands. First value controls src0, second value controls src1 and so on.
  1003. The value 0 indicates that the corresponding operand value is used unmodified,
  1004. the value 1 indicates that negative value of the operand must be used.
  1005. By default, operand values are used unmodified.
  1006. This modifier is valid for floating point operands only.
  1007. =============================== ==================================================================
  1008. Syntax Description
  1009. =============================== ==================================================================
  1010. neg_hi:[{0..1}] Select affected operands for instructions with 1 source operand.
  1011. neg_hi:[{0..1},{0..1}] Select affected operands for instructions with 2 source operands.
  1012. neg_hi:[{0..1},{0..1},{0..1}] Select affected operands for instructions with 3 source operands.
  1013. =============================== ==================================================================
  1014. Note: numeric values may be specified as either
  1015. :ref:`integer numbers<amdgpu_synid_integer_number>` or
  1016. :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
  1017. Examples:
  1018. .. parsed-literal::
  1019. neg_hi:[1,0]
  1020. neg_hi:[0,1,1]
  1021. clamp
  1022. ~~~~~
  1023. See a description :ref:`here<amdgpu_synid_clamp>`.
  1024. .. _amdgpu_synid_mad_mix:
  1025. VOP3P V_MAD_MIX Modifiers
  1026. -------------------------
  1027. *v_mad_mix_f32*, *v_mad_mixhi_f16* and *v_mad_mixlo_f16* instructions
  1028. use *op_sel* and *op_sel_hi* modifiers
  1029. in a manner different from *regular* VOP3P instructions.
  1030. See a description below.
  1031. GFX9 and GFX10 only.
  1032. .. _amdgpu_synid_mad_mix_op_sel:
  1033. m_op_sel
  1034. ~~~~~~~~
  1035. This operand has meaning only for 16-bit source operands as indicated by
  1036. :ref:`m_op_sel_hi<amdgpu_synid_mad_mix_op_sel_hi>`.
  1037. It specifies to select either the low [15:0] or high [31:16] operand bits
  1038. as input to the operation.
  1039. The number of values specified by the *op_sel* modifier must match the number of source
  1040. operands. First value controls src0, second value controls src1 and so on.
  1041. The value 0 indicates the low bits, the value 1 indicates the high 16 bits.
  1042. By default, low bits are used for all operands.
  1043. =============================== ================================================
  1044. Syntax Description
  1045. =============================== ================================================
  1046. op_sel:[{0..1},{0..1},{0..1}] Select location of each 16-bit source operand.
  1047. =============================== ================================================
  1048. Note: numeric values may be specified as either
  1049. :ref:`integer numbers<amdgpu_synid_integer_number>` or
  1050. :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
  1051. Examples:
  1052. .. parsed-literal::
  1053. op_sel:[0,1]
  1054. .. _amdgpu_synid_mad_mix_op_sel_hi:
  1055. m_op_sel_hi
  1056. ~~~~~~~~~~~
  1057. Selects the size of source operands: either 32 bits or 16 bits.
  1058. By default, 32 bits are used for all source operands.
  1059. The number of values specified by the *op_sel_hi* modifier must match the number of source
  1060. operands. First value controls src0, second value controls src1 and so on.
  1061. The value 0 indicates 32 bits, the value 1 indicates 16 bits.
  1062. The location of 16 bits in the operand may be specified by
  1063. :ref:`m_op_sel<amdgpu_synid_mad_mix_op_sel>`.
  1064. ======================================== ====================================
  1065. Syntax Description
  1066. ======================================== ====================================
  1067. op_sel_hi:[{0..1},{0..1},{0..1}] Select size of each source operand.
  1068. ======================================== ====================================
  1069. Note: numeric values may be specified as either
  1070. :ref:`integer numbers<amdgpu_synid_integer_number>` or
  1071. :ref:`absolute expressions<amdgpu_synid_absolute_expression>`.
  1072. Examples:
  1073. .. parsed-literal::
  1074. op_sel_hi:[1,1,1]
  1075. abs
  1076. ~~~
  1077. See a description :ref:`here<amdgpu_synid_abs>`.
  1078. neg
  1079. ~~~
  1080. See a description :ref:`here<amdgpu_synid_neg>`.
  1081. clamp
  1082. ~~~~~
  1083. See a description :ref:`here<amdgpu_synid_clamp>`.