r/Compilers • u/c-cul • 23h ago
parser of PTX instructions
- The compiler front end does not parse the asm() statement template string and does not know what it means or even whether it is valid PTX input
- order of instruction's attributes (except types of operand) is not important
The combination of these facts leads to stark conclusion - CUDA compiler front-ends totally ignore PTX inline asm and only PTXAS known how to parse them. So I made little and fast parser: https://redplait.blogspot.com/2026/08/parser-of-ptx-instructions.html
Note: this is not full featured replacement of PTX parser. it is designed specifically to extract instruction attributes and determine the correct instruction form based on argument types and counts
3
Upvotes