| 25 | <h2>Gallium ABI description AMDHSA</h2> |
| 26 | <h3>Argument passing</h3> |
| 27 | <p>Argument is stored in memory which address is stored in s[6:7]. Argument begins from |
| 28 | the first dword in this memory. After kernel arguments are kernel dimensions. |
| 29 | List of data (number is dword offset after kernel argument):</p> |
| 30 | <ul> |
| 31 | <li>0 - number of dimensions</li> |
| 32 | <li>1-3 - global offsets for each dimensions</li> |
| 33 | </ul> |
| 34 | <p>Local sizes and other kernel setup is in memory which address is stored in s[4:5]. |
| 35 | List of data (number is dword offset after kernel argument):</p> |
| 36 | <ul> |
| 37 | <li>1 - low 16-bits is global local size for X dimension, higher 16-bits is for Y dimension</li> |
| 38 | <li>2 - low 16-bits is global size for Z dimension</li> |
| 39 | <li>3-5 - global size for each dimension</li> |
| 40 | </ul> |
| 41 | <p>Userdata tooks 8 first scalar registers and holds:</p> |
| 42 | <ul> |
| 43 | <li>s[0:3] - scratch buffer resource</li> |
| 44 | <li>s[4:5] - kernel setup</li> |
| 45 | <li>s[6:7] - address to argument list and kernel dimensions and global offsets</li> |
| 46 | </ul> |