Skip to content

Commit 5948fdf

Browse files
authored
Documentation updates.
1 parent 7558dd1 commit 5948fdf

1 file changed

Lines changed: 50 additions & 31 deletions

File tree

documentation/spec_documentation.md

Lines changed: 50 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,33 @@
11
# AMD XML ISA Specification
22
## Motivation
3-
This documentation gives a detailed description of AMD’s machine-readable instruction set architecture.
3+
This documentation gives a detailed description of AMD’s machine-readable GPU instruction set architecture specification.
44

55
## Machine-readable ISA specification
6-
AMD took an effort to develop a fully machine-readable version of their GPU instruction set architecture specification (ISA). This specification is specifically designed to be easily and efficiently read by a computer program. The ISA is specified in XML format and auto generated directly from the hardware description files of AMD GPUs.
6+
This specification is specifically designed to be easily and efficiently read by a computer program.
7+
8+
The top-level XML schema is divided into two main elements:
9+
* Document: contains metadata about the current specification XML file.
10+
* ISA: describes the Instruction Set Architecture itself for the relevant GPU architecture.
11+
12+
Here is a top-level view of the schema:
13+
```
14+
<Spec>
15+
<Document>
16+
<ISA>
17+
<Architecture>
18+
<Instructions>
19+
<Encodings>
20+
<DataFormats>
21+
<OperandTypes>
22+
<FunctionalGroups>
23+
```
24+
25+
A detailed description of each of the XML elements in the schema is provided below.
726

827
## AMD GPUs XML ISA Specification
928
In this section, we will take a deep dive into the XML specification and break down every single element. The description of elements will be in a breadth first order. Every subsection will describe a single element by stating its parent element and list of child elements.
1029

11-
### Spec element
30+
### \<Spec\>
1231
Hierarchy: **\<Spec\>**
1332

1433
Description: top level element which holds information about the ISA specification.
@@ -19,7 +38,7 @@ List of child elements:
1938
| 1. | Document | [\<Document\>](#document-element) | XML document related information. |
2039
| 2. | Instruction Set Architecture | [\<ISA\>](#isa-element) | ISA related information. |
2140

22-
### Document element
41+
### \<Document\>
2342
Hierarchy: \<Spec\>**\<Document\>**
2443

2544
Description: encapsulates generic information about the XML document.
@@ -32,7 +51,7 @@ List of child elements:
3251
| 3. | Release date | \<ReleaseDate\> | The date when the specification was released. |
3352
| 4. | Schema version | \<SchemaVersion\> | The version of the schema. |
3453

35-
### ISA element
54+
### \<ISA\>
3655
Hierarchy: \<Spec\>**\<ISA\>**
3756

3857
Description: contains ISA related information.
@@ -47,7 +66,7 @@ List of child elements:
4766
| 5. | Operand types | [\<OperandTypes\>](#operandtypes-element) | Lists all operand types in the architecture. The sub-elements of this element are referenced by an instruction element. It provides information on the types of the operands used by the instruction. Examples of provided information are: is the operand a scalar or a vector register? What is the name of this operand when represented in assembly?|
4867
| 6. | Functional groups | [\<FunctionalGroups\>](#functionalgroups-element) | Lists all functional groups in the architecture. A function group provides high-level classification of the instructions, such as: vector memory, vector ALU, scalar memory, etc. |
4968

50-
### Architecture element
69+
### \<Architecture\>
5170
Hierarchy: \<Spec\>\<ISA\>**\<Architecture\>**
5271

5372
Description: contains information about architecture specific meta data.
@@ -59,7 +78,7 @@ List of child elements:
5978

6079
---
6180

62-
### Instructions element
81+
### \<Instructions\>
6382
Hierarchy: \<Spec\>\<ISA\>**\<Instructions\>**
6483

6584
Description: lists all instructions in the architecture. This is the core element of the specification. Every instruction references other XML elements. Examples of provided information by this element: different ways to encode the instruction, the type of operands, the data format of the operand, etc.
@@ -69,7 +88,7 @@ List of child elements:
6988
| -- | ---------------------- | ---------------- | - |
7089
| 1. | Instruction (singular) | [\<Instruction\>](#instruction-element) | Information about a single instruction in this architecture.|
7190

72-
### Instruction element
91+
### \<Instruction\>
7392
Hierarchy: \<Spec\>\<ISA\>\<Instructions\>**\<Instruction\>**
7493

7594
Description: information about a single instruction in this architecture, including its name, operation, and associated parameters.
@@ -82,7 +101,7 @@ List of child elements:
82101
| 3. | Description | \<Description\> | Description of the operation performed by the instruction. |
83102
| 4. | Instruction encodings | [\<InstructionEncodings\>](#instructionencodings-element) | Lists all encodings this instruction can be represented in. |
84103

85-
### InstructionFlags element
104+
### \<InstructionFlags\>
86105
Hierarchy: \<Spec\>\<ISA\>\<Instructions\>\<Instruction\>**\<InstructionFlags\>**
87106

88107
Description: information about basic features of the instruction. For example, is the instruction a branch? Does it terminate the program?
@@ -94,7 +113,7 @@ List of child elements:
94113
| 2. | Is program terminator | \<IsProgramTerminator\> | `True` if the instruction is a program terminator, `False` otherwise. |
95114
| 3. | Is immediately executed | \<IsImmediatelyExecuted\> | `True` if the instruction does NOT go through the execution unit, `False` otherwise. |
96115

97-
### InstructionEncodings element
116+
### \<InstructionEncodings\>
98117
Hierarchy: \<Spec\>\<ISA\>\<Instructions\>\<Instruction\>**\<InstructionEncodings\>**
99118

100119
Description: lists all encodings this instruction can be represented in.
@@ -104,7 +123,7 @@ List of child elements:
104123
| -- | -------------------- | --------------------- | - |
105124
| 1. | Instruction encoding (singular) | [\<InstructionEncoding\>](#instructionencoding-element) | One possible encoding version given instruction can be represented in. |
106125

107-
### InstructionEncoding element
126+
### \<InstructionEncoding\>
108127
Hierarchy: \<Spec\>\<ISA\>\<Instructions\>\<Instruction\>\<InstructionEncodings\>**\<InstructionEncoding\>**
109128

110129
Description: one possible encoding version given instruction can be represented in.
@@ -117,7 +136,7 @@ List of child elements:
117136
| 2. | Opcode | \<Opcode\> | The opcode value of the instruction when represented in this encoding. |
118137
| 3. | Operands | [\<Operands\>](#operands-element) | Lists all operands of the instruction when represented in this encoding. |
119138

120-
### Operands element
139+
### \<Operands\>
121140
Hierarchy: \<Spec\>\<ISA\>\<Instructions\>\<Instruction\>\<InstructionEncodings\>\<InstructionEncoding\>**\<Operands\>**
122141

123142
Description: lists all operands of the instruction when represented in this encoding.
@@ -127,7 +146,7 @@ List of child elements:
127146
| -- | ------- | ---------------- | - |
128147
| 1. | Operand (singular) | [\<Operand\>](#operand-element) | Information about a single operand in the instruction. |
129148

130-
### Operand element
149+
### \<Operand\>
131150
Hierarchy: \<Spec\>\<ISA\>\<Instructions\>\<Instruction\>\<InstructionEncodings\>\<InstructionEncoding\>\<Operands\>**\<Operand\>**
132151

133152
Description: Information about a single operand in the instruction.
@@ -151,7 +170,7 @@ List of attributes:
151170

152171
---
153172

154-
### Encodings element
173+
### \<Encodings\>
155174
Hierarchy: \<Spec\>\<ISA\>**\<Encodings\>**
156175

157176
Description: lists all encodings supported by the architecture. Examples of the provided information by this element: instruction sizes, fields of the binary instruction, general description of the encoding.
@@ -161,7 +180,7 @@ List of child elements:
161180
|-- | ------------------- | ---------------- | - |
162181
|1. | Encoding (singular) | [\<Encoding\>](#encoding-element) | Information about a single encoding in this architecture. |
163182

164-
### Encoding element
183+
### \<Encoding\>
165184
Hierarchy: \<Spec\>\<ISA\>\<Encodings\>**\<Encoding\>**
166185

167186
Description: information about a single encoding in this architecture.
@@ -183,7 +202,7 @@ List of attributes:
183202
| -- | -------------- | -------------- | - |
184203
| 1. | Encoding order | Order | Dictates the order in which encodings should be picked when decoding machine code, with the search halting at the first match of the identifier. |
185204

186-
### EncodingIdentifiers element
205+
### \<EncodingIdentifiers\>
187206
Hierarchy: \<Spec\>\<ISA\>\<Encodings\>\<Encoding\>**\<EncodingIdentifiers\>**
188207

189208
Description: lists all unique identifiers which are used to map to the encoding.
@@ -193,7 +212,7 @@ List of child elements:
193212
| -- | ------------------- | -------------------- | -|
194213
| 1. | Encoding Identifier (singular) | \<EncodingIdentifier\> | Single unique identifier used to map to the specific encoding. This is the unique identifier of the instruction. The identifier is the combination of the encoding and opcode bits. |
195214

196-
### EncodingConditions element
215+
### \<EncodingConditions\>
197216
Hierarchy: \<Spec\>\<ISA\>\<Encodings\>\<Encoding\>**\<EncodingConditions\>**
198217

199218
Description: lists all encoding conditions. A condition specifies cases when the encoding can be extended with extra fields such as literal constant, DPP, etc.
@@ -203,7 +222,7 @@ List of child elements:
203222
| -- | ------------------ | ------------------- | -|
204223
| 1. | Encoding Condition (singular) | [\<EncodingCondition\>](#encodingcondition-element) | A single condition. |
205224

206-
### EncodingCondition element
225+
### \<EncodingCondition\>
207226
Hierarchy: \<Spec\>\<ISA\>\<Encodings\>\<Encoding\>\<EncodingConditions\>**\<EncodingCondition\>**
208227

209228
Description: a single condition from the list of conditions of the encoding. A condition specifies cases when the encoding can be extended with extra fields such as literal constant, DPP, etc.
@@ -214,7 +233,7 @@ List of child elements:
214233
| 1. | Condition name | \<ConditionName\> | Name of the condition. Used as a reference when decoding an instruction and determining which encoding to use.|
215234
| 2. | Condition expression | \<ConditionExpression\> | An abstract syntax tree. The tree encodes a boolean expression, which if evaluated to true signals that the extended version of the encoding must be used.|
216235

217-
### BitMap element (MicrocodeFormat)
236+
### \<BitMap\> (MicrocodeFormat)
218237
Hierarchy: \<Spec\>\<ISA\>\<Encodings\>\<Encoding\>\<MicrocodeFormat\>**\<BitMap\>**
219238

220239
Description: a bitmap holds a detailed breakdown of the fields in the given encoding.
@@ -224,7 +243,7 @@ List of child elements:
224243
| -- | ------- | ---------------- | - |
225244
| 1. | Field | [\<Field\>](#field-element-microcodeformat--bitmap) | A single field from the list of fields in the bitmap. The field specifies the raw binary instruction must be broken down and interpreted.|
226245

227-
### Field element (MicrocodeFormat → BitMap)
246+
### \<Field\> (MicrocodeFormat → BitMap)
228247
Hierarchy: \<Spec\>\<ISA\>\<Encodings\>\<Encoding\>\<MicrocodeFormat\>\<BitMap\>**\<Field\>**
229248

230249
Description: a single field from the list of fields in the bitmap. The field specifies the raw binary instruction must be broken down and interpreted.
@@ -237,7 +256,7 @@ List of child elements:
237256

238257
---
239258

240-
### DataFormats element
259+
### \<DataFormats\>
241260
Hierarchy: \<Spec\>\<ISA\>**\<DataFormats\>**
242261

243262
Description: lists all data fromats in the architecture. It provides additional information on how the values in the registers should be treated. This element is referenced by the instruction element. Examples of provided information by this element: is the value integer or float? If it is float where is mantissa, exponent and sign?
@@ -247,7 +266,7 @@ List of child elements:
247266
| -- | ---------------------- | ---------------- | - |
248267
| 1. | Data format (singular) | [\<DataFormat\>](#dataformat-element) | Information about a single data format in this architecture. |
249268

250-
### DataFormat element
269+
### \<DataFormat\>
251270
Hierarchy: \<Spec\>\<ISA\>\<DataFormats\>**\<DataFormat\>**
252271

253272
Description: information about a single data format in this architecture including a data type (descriptor, bits, float), the number of components packed into the given bits, and additional attributes.
@@ -261,7 +280,7 @@ List of child elements:
261280
| 4. | Component count | \<ComponentCount\> | Indicates the number of components this format packs into the given bits if data is packed. |
262281
| 5. | Data attributes | [\<DataAttributes\>\<BitMap\>](#bitmap-element-dataattributes) | Information about each component in the data format. |
263282

264-
### BitMap element (DataAttributes)
283+
### \<BitMap\> (DataAttributes)
265284
Hierarchy: \<Spec\>\<ISA\>\<DataFormats\>\<DataFormat\>\<DataAttributes\>**\<BitMap\>**
266285

267286
Description: information about each component in the data format.
@@ -271,7 +290,7 @@ List of child elements:
271290
| -- | ------- | ---------------- | - |
272291
| 1. | Field | [\<Field\>](#field-element-dataattributes--bitmap) | Describes a single compoent field of the data format. |
273292

274-
### Field element (DataAttributes → BitMap)
293+
### \<Field\> (DataAttributes → BitMap)
275294
Hierarchy: \<Spec\>\<ISA\>\<DataFormats\>\<DataFormat\>\<DataAttributes\>\<BitMap\>**\<Field\>**
276295

277296
Description: the data format can be broken down into several fields. This element describes a single field from the list of fields in the bitmap.
@@ -290,7 +309,7 @@ List of attributes:
290309

291310
---
292311

293-
### OperandTypes element
312+
### \<OperandTypes\>
294313
Hierarchy: \<Spec\>\<ISA\>**\<OperandTypes\>**
295314

296315
Description: the sub-elements of this element are referenced by an instruction element. It provides information on the types of the operands used by the instruction. Examples of provided information are: is the operand a scalar or a vector register? What is the name of this operand when represented in assembly?
@@ -300,7 +319,7 @@ List of child elements:
300319
| -- | ----------------------- | ---------------- | - |
301320
| 1. | Operand type (singular) | [\<OperandType\>](#operandtype-element) | Information about a single operand type in the architecture. |
302321

303-
### OperandType element
322+
### \<OperandType\>
304323
Hierarchy: \<Spec\>\<ISA\>\<OperandTypes\>**\<OperandType\>**
305324

306325
Description: information about a single operand type in the architecture.
@@ -312,7 +331,7 @@ List of child elements:
312331
| 2. | Subtypes | \<Subtypes\> | Lists all subtype names that compose the give type. |
313332
| 3. | Operand predefined values | [\<OperandPredefinedValues\>](#operandpredefinedvalues-element) | Lists all predefined operand values. A predefined value maps encoded integer value in the binary opcode to the corresponding assembly name. |
314333

315-
### OperandPredefinedValues element
334+
### \<OperandPredefinedValues\>
316335
Hierarchy: \<Spec\>\<ISA\>\<OperandTypes\>\<OperandType\>**\<OperandPredefinedValues\>**
317336

318337
Description: lists all predefined operand values. A predefined value maps encoded integer value in the binary opcode to the corresponding assembly name.
@@ -323,7 +342,7 @@ List of child elements:
323342
| 1. | Operand predefined value | [\<OperandPredefinedValue\>](#operandpredefinedvalue-element) | Maps encoded integer value in the binary opcode to the corresponding assembly name. |
324343

325344

326-
### OperandPredefinedValue element
345+
### \<OperandPredefinedValue\>
327346
Hierarchy: \<Spec\>\<ISA\>\<OperandTypes\>\<OperandType\>\<OperandPredefinedValues\>**\<OperandPredefinedValue\>**
328347

329348
Description: maps encoded integer value in the binary opcode to the corresponding assembly name.
@@ -337,7 +356,7 @@ List of child elements:
337356

338357
---
339358

340-
### FunctionalGroups element
359+
### \<FunctionalGroups\>
341360
Hierarchy: \<Spec\>\<ISA\>**\<FunctionalGroups\>**
342361

343362
Description: lists all functional groups in the architecture. A function group provides high-level classification of the instructions, such as: vector memory, vector ALU, scalar memory, etc.
@@ -347,7 +366,7 @@ List of child elements:
347366
| -- | ---------------- | ---------------- | - |
348367
| 1. | Functional Group (singular) | [\<FunctionalGroup\>](#functionalgroup-element) | Provides high-level classification of the instruction, such as: vector memory, vector ALU, scalar memory, etc. |
349368

350-
### FunctionalGroup element
369+
### \<FunctionalGroup\>
351370
Hierarchy: \<Spec\>\<ISA\>\<Instructions\>\<Instruction\>\<FunctionalGroups\>**\<FunctionalGroup\>**
352371

353372
Description: provides a high-level hardware functional group used for the instruction in this architecture.
@@ -358,7 +377,7 @@ List of child elements:
358377
| 1. | Name | \<Name\> | Name of the functional group. |
359378
| 2. | Subgroup | [\<Subgroup\>](#Subgroup-element) | Name of the associated subgroup. |
360379

361-
### Subgroup element
380+
### \<Subgroup\>
362381
Hierarchy: \<Spec\>\<ISA\>\<Instructions\>\<Instruction\>\<FunctionalGroups\>\<FunctionalGroup\>**\<Subgroup\>**
363382

364383
Description: provides the associated subgroup for the instruction in this architecture. For example, a VMEM instruction can have the following subtypes: LOAD, STORE, ATOMIC, TEXTURE, etc.

0 commit comments

Comments
 (0)