← 返回首页
Decoding instructions with the machine-readable AMD GPU ISA specifications - AMD GPUOpenDecoding instructions with the machine-readable AMD GPU ISA specifications - AMD GPUOpen
  1. Home
  2. » Learn
  3. » Decoding instructions with the machine-readable AMD GPU ISA specifications
Share on Bluesky Share on Mastadon Share on LinkedIn Share on Twitter/X Share on Reddit Share on Facebook Share on Whatsapp Share via Email

Decoding instructions with the machine-readable AMD GPU ISA specifications

Originally posted: August 22, 2024
Last updated: August 23, 2024
Amit Ben-Moshe
Nursultan Kabylkas

We recently released a machine-readable specification for our GPU Instruction Set Architecture (ISA), provided as a set of XML files detailing its RDNA™ and CDNA™ Instruction Set Architectures. While you can manually parse these files using the XML schema documentation, the easiest way to get started is using the  IsaDecoder  API. This API reads and parses the XML files and can decode individual instructions or entire kernels in both binary and textual formats.

Here is a simple program demonstrating how easy it is to decode a single MI-300/CDNA™ 3 instruction using the API. This program loads the specification XML file from a hardcoded path and decodes a hardcoded instruction ( 0x7e000301 ):

int main()
{
// Initialize the decoder with the MI300/CDNA3 XML ISA specification file.
amdisa::IsaDecoder decoder;
const char* kPathToSpec = "path/to/xml/spec/amdgpu_isa_mi300.xml";
std::string error_msg;
bool is_initialized = decoder.Initialize(kPathToSpec, error_msg);
if (is_initialized)
{
// Decode instruction 0x7e000301.
amdisa::InstructionInfoBundle inst_bundle;
bool is_decoded = decoder.DecodeInstruction(0x7e000301, inst_bundle, error_msg);
if (is_decoded)
{
for (const amdisa::InstructionInfo& inst : inst_bundle.bundle)
{
std::cout << "Instruction Name: " << inst.instruction_name << std::endl;
std::cout << "Instruction Description: " << inst.instruction_description << std::endl;
// More information is available in the InstructionInfo structure,
// such as operands and their type (input/output/SGPR/VGPR/etc.), flags and more.
}
}
else
{
std::cerr << error_msg << std::endl;
}
}
else
{
std::cerr << error_msg << std::endl;
}
return 0;
}

After decoding, the program outputs the instruction name and the human-readable instruction description from the decoded InstructionInfo structure.

Terminal window
Instruction Name: V_MOV_B32
Instruction Description: Move 32-bit data from a vector input into a vector register.

The populated InstructionInfo structure contains detailed information about the decoded instruction like its encoding, operands and their types (input/output/SGPR/VGPR etc.), and flags. For a complete description of the available information, please refer to the API documentation on GitHub.

In addition, as mentioned above, the API is not limited to decoding single instructions – it can be used to decode whole kernels and shaders in binary and disassembly formats. API usage examples and additional details are available on the isa_spec_manager repository on GitHub alongside the API source code – check it out!

You can also find out more over on our AMD machine-readable ISA specification page here on GPUOpen!

Amit Ben-Moshe

Amit Ben-Moshe is an AMD Fellow. His postings are his own opinions and may not represent AMD’s positions, strategies or opinions. Links to third party sites are provided for convenience and unless explicitly stated, AMD is not responsible for the contents of such linked sites and no endorsement is implied.

Nursultan Kabylkas

Nursultan Kabylkas, Ph.D. in Computer Engineering, is a senior software engineer working on the AMD GPU Machine-Readable ISA Specification project.

Related news and technical articles

How GOALS delivers sustained, competitive esports performance on handheld PCs - part 1
The first part of a developer-first look at how GOALS leverages AMD Ryzen APUs and the ADLX SDK to implement a system that reduces power, fan noise and carbon footprint across legacy and handheld hardware while preserving competitive performance.
How GOALS delivers sustained, competitive esports performance on handheld PCs - part 2
The second part of how GOALS optimizes AMD Ryzen handheld PC gaming performance using AMD FSR Upscaling and Frame Generation, handcrafted device profiles, football-aware animation budgeting, and battery-aware scalability for sustained play.
Welcome to the AMD FSR SDK 2.2, now available on GPUOpen
The AMD FSR™ "Redstone" SDK 2.2 update delivers ML-powered FSR Upscaling 4.1 and FSR Ray Regeneration 1.1 optimized for AMD RDNA™ 4 graphics, enabling higher visual fidelity and performance with analytical fallbacks to scale across handhelds, consoles, and PCs.
Driving the future: frictionless automotive HMI development with Epic Games & AMD Ryzen AI Embedded P100 series
At CES 2026 Epic Games and AMD unveiled the Unreal Engine 5 Next‑Gen HMI Experience powered by AMD Ryzen AI Embedded P100 Series, unifying instrument clusters, maps, and apps into a single high‑performance UE5 instance with gaming‑class graphics, and a streamlined developer workflow to deliver customizable, 60 FPS in‑cockpit experiences.
AMD Radeon Developer Tool Suite updated with new GPU support and significant RGP enhancements
The latest version of the RDTS is designed to empower developers with enhanced capabilities for profiling, analyzing, and optimizing their GPU applications.
Using the Matrix Cores of AMD RDNA 4 architecture GPUs
This article is a quick how-to guide for using the WMMA intrinsics with our new AMD RDNA™ 4 architecture GPUs.
Enhancing AMD Radeon GPU Detective Output with DirectX Debug Information
With version 1.5 of AMD Radeon™ GPU Detective (RGD) you can now use the debug information that is produced by the Microsoft DirectX® Shader Compiler.
Introducing the Latest AMD Radeon Developer Tool Suite with Support for AMD Radeon RX 9060 XT
We've released an updated AMD Radeon™ Developer Tool Suite, including enhanced versions of tools such as the Radeon GPU Detective, Profiler, Raytracing Analyzer, Memory Visualizer, GPU Analyzer, and Developer Panel, now with expanded GPU support.

Related videos

Real-time Sparse Distance Fields for Games (GDC 2023 - YouTube link)
This presentation introduces a novel algorithm for PC and console developers to efficiently generate sparse distance fields in real-time.
Compute Shaders - Game Industry Conference 2021
This talk introduces compute shaders, explaining ideas from a software and hardware perspective, as well as considerations when writing compute shaders.
Microsoft® Game Stack Live: Denoising Raytraced Soft Shadows on Xbox Series X|S and Windows with FidelityFX
We explain how FidelityFX Denoiser allows for high-quality raytracing results without increasing rays per pixel, and deep dive into specific AMD RDNA™ 2-based optimizations that benefit both Xbox Series X|S and PC.
AMD RDNA™ 2 – Radeon™ GPU Profiler 1.10 - YouTube link
RGP 1.9 and 1.10 introduce support for AMD Radeon™ RX6000 series GPUs, a new memory cache counter feature, and support for DirectX® and Vulkan® ray tracing.
All the Pipelines - Journey through the GPU
This presentation by one of our engineers at GIC 2020 provides an introduction to the graphics pipeline.
AMD RDNA™ 2 – DirectX® Raytracing 1.1 - YouTube link
Graphics feature architect Rys Sommefeldt provides a short presentation on the major advantages of the new API, and how to best utilize it on AMD RDNA™ 2-based hardware.
AMD RDNA™ 2 - DirectX® 12 Ultimate: Variable Rate Shading - YouTube link
Engineer Stephan Hodes provides a short description how VRS works, and how AMD’s FidelityFX Variable Shading technique can assist with integrating VRS into your engine.
AMD RDNA™ 2 - DirectX® 12 Ultimate: Sampler Feedback and Mesh Shaders - YouTube link
Engineer Colin Riley provides a short description of Sampler Feedback and Mesh Shaders, as well as important performance guidelines that graphics developers should consider when using AMD RDNA™ 2-based GPUs.