Private
Public Access
13-post thread, 12 images. THE RDNA2 ASSEMBLER DESIGN DOC, Aug 2023 -
3 years before the Aug 2025 SPIR-V-from-data work. Same idea, more
concrete, GPU-side assembler+editor building RDNA2 binary for Steam
Deck. Custom binary format (no text input); 32-bit words treated
identically so assembly step is massively parallel. 6-arg symbol
joining + 7th arg for signed 16-bit relative branch offset. 5-char
symbol names (6-bit char table, right-angle-only font, upper case,
some glyph aliasing). SMEM 21-bit offset: 20 bits absolute positive
from KART base, 1 MiB easy data. Source = two 128-bit values per
32-bit word: {RULE, SYMBOLS, RELATIVE BRANCH} and {LABEL, COMMENT}.
3-view editor {symbol, rule, source}, 2 copies of everything per
edit, dead parallel. Interface inspired by MOD-like trackers
(Impulse Tracker): simple {instrument, pattern, arrangement} with
spreadsheet feel. Precursor to the 2079746130309415185 micro macro-
forth and the 1951638140600381942 cart file work.
236 lines
9.2 KiB
JSON
236 lines
9.2 KiB
JSON
{
|
|
"root_post_id": "1688286623375454208",
|
|
"posts": [
|
|
{
|
|
"post_id": "1688275737692815360",
|
|
"author": "NOTimothyLottes",
|
|
"handle": "NOTimothyLottes",
|
|
"text": "SPC: RDNA2 ASSEMBLER [thread] ... Did initial design plan this weekend. The aim is a GPU-side assembler+editor, building RDNA2 binary images for Steam Deck. Live edit, live data view, etc. Assembler and editor running in massive vectorized shader code.",
|
|
"timestamp": "2023-08-06 19:47:57",
|
|
"media_urls": [],
|
|
"reply_to_id": null,
|
|
"quote_of_id": null,
|
|
"metrics": {
|
|
"reply_count": 1,
|
|
"repost_count": 2,
|
|
"like_count": 22,
|
|
"view_count": 2862
|
|
}
|
|
},
|
|
{
|
|
"post_id": "1688276271619248129",
|
|
"author": "NOTimothyLottes",
|
|
"handle": "NOTimothyLottes",
|
|
"text": "Good reason not to use text input for assembler, instead will use a custom binary format, and treat all 32-bit words in the binary the exact same way (so massively parallel assembly step). This is parallel design 101.",
|
|
"timestamp": "2023-08-06 19:50:04",
|
|
"media_urls": [],
|
|
"reply_to_id": "1688275737692815360",
|
|
"quote_of_id": null,
|
|
"metrics": {
|
|
"reply_count": 1,
|
|
"repost_count": 0,
|
|
"like_count": 3,
|
|
"view_count": 193
|
|
}
|
|
},
|
|
{
|
|
"post_id": "1688277538571755520",
|
|
"author": "NOTimothyLottes",
|
|
"handle": "NOTimothyLottes",
|
|
"text": "Some basics: RDNA2 instructions are 1-N 32-bit words. Each of the 32-bit components have a bunch of fields. Will typically need 1-6 fields per 32-bit word, as will be joining some fields into one argument (like DLC/GLC) below.",
|
|
"timestamp": "2023-08-06 19:55:06",
|
|
"media_urls": [
|
|
"https://pbs.twimg.com/media/F232wWkX0AAZWPh?format=jpg&name=orig",
|
|
"https://pbs.twimg.com/media/F233F_sWMAAqHBo?format=png&name=orig"
|
|
],
|
|
"reply_to_id": "1688276271619248129",
|
|
"quote_of_id": null,
|
|
"metrics": {
|
|
"reply_count": 1,
|
|
"repost_count": 0,
|
|
"like_count": 4,
|
|
"view_count": 203
|
|
}
|
|
},
|
|
{
|
|
"post_id": "1688278083684421632",
|
|
"author": "NOTimothyLottes",
|
|
"handle": "NOTimothyLottes",
|
|
"text": "Could argue that MIMG has the most fields, but in practice many of those fields will be joined (see example), and I'm not likely to be using NSA encoding. So still will only need maximum 6 arguments to build a 32-bit value.",
|
|
"timestamp": "2023-08-06 19:57:16",
|
|
"media_urls": [
|
|
"https://pbs.twimg.com/media/F233qJyWQAAjmOo?format=jpg&name=orig",
|
|
"https://pbs.twimg.com/media/F2333WKXEAAc2fZ?format=png&name=orig"
|
|
],
|
|
"reply_to_id": "1688277538571755520",
|
|
"quote_of_id": null,
|
|
"metrics": {
|
|
"reply_count": 1,
|
|
"repost_count": 0,
|
|
"like_count": 5,
|
|
"view_count": 213
|
|
}
|
|
},
|
|
{
|
|
"post_id": "1688278959711272960",
|
|
"author": "NOTimothyLottes",
|
|
"handle": "NOTimothyLottes",
|
|
"text": "Custom editor, using a custom font, designed for vintage CRTs. Wanted 5-character symbol names for easy packing in 30-bit values. So setup a 6-bit character table. This is using a modified 'right-angle-only' font (like the one below). So some glyphs alias, and only upper case.",
|
|
"timestamp": "2023-08-06 20:00:45",
|
|
"media_urls": [
|
|
"https://pbs.twimg.com/media/F234Y1IXcAECWTB?format=png&name=orig"
|
|
],
|
|
"reply_to_id": "1688278083684421632",
|
|
"quote_of_id": null,
|
|
"metrics": {
|
|
"reply_count": 1,
|
|
"repost_count": 0,
|
|
"like_count": 4,
|
|
"view_count": 221
|
|
}
|
|
},
|
|
{
|
|
"post_id": "1688280670764756992",
|
|
"author": "NOTimothyLottes",
|
|
"handle": "NOTimothyLottes",
|
|
"text": "Will need some kind of symbol table, what ends up providing the arguments to the rules that build the 32-bit words that comprise the final binary. The symbol indirection provides a way to name registers for example, and then change the register mapping later.",
|
|
"timestamp": "2023-08-06 20:07:33",
|
|
"media_urls": [
|
|
"https://pbs.twimg.com/media/F2357mwXUAAC6O6?format=png&name=orig"
|
|
],
|
|
"reply_to_id": "1688278959711272960",
|
|
"quote_of_id": null,
|
|
"metrics": {
|
|
"reply_count": 1,
|
|
"repost_count": 0,
|
|
"like_count": 4,
|
|
"view_count": 182
|
|
}
|
|
},
|
|
{
|
|
"post_id": "1688281231954161664",
|
|
"author": "NOTimothyLottes",
|
|
"handle": "NOTimothyLottes",
|
|
"text": "Notice SMEM ops have 21-bit immediate offsets. I'll use 20-bits of that for an absolute positive offset from KART base. 1 MiB of easy data. The editor will relink tagged symbols that represent offsets automatically.",
|
|
"timestamp": "2023-08-06 20:09:47",
|
|
"media_urls": [
|
|
"https://pbs.twimg.com/media/F236eA_XkAAc8-_?format=jpg&name=orig"
|
|
],
|
|
"reply_to_id": "1688280670764756992",
|
|
"quote_of_id": null,
|
|
"metrics": {
|
|
"reply_count": 1,
|
|
"repost_count": 0,
|
|
"like_count": 4,
|
|
"view_count": 191
|
|
}
|
|
},
|
|
{
|
|
"post_id": "1688281975210041344",
|
|
"author": "NOTimothyLottes",
|
|
"handle": "NOTimothyLottes",
|
|
"text": "Next will need a collection of rules, how to join the 6 possible symbol arguments together. Rules for example for each of the RDNA2 instruction encodings (VOPC, etc). This reduces to just a 6 entry 5-bit left shift amount associated with each argument.",
|
|
"timestamp": "2023-08-06 20:12:44",
|
|
"media_urls": [
|
|
"https://pbs.twimg.com/media/F237AEiWgAAkzD0?format=png&name=orig"
|
|
],
|
|
"reply_to_id": "1688281231954161664",
|
|
"quote_of_id": null,
|
|
"metrics": {
|
|
"reply_count": 1,
|
|
"repost_count": 0,
|
|
"like_count": 3,
|
|
"view_count": 178
|
|
}
|
|
},
|
|
{
|
|
"post_id": "1688282613914492928",
|
|
"author": "NOTimothyLottes",
|
|
"handle": "NOTimothyLottes",
|
|
"text": "But will need a 7th argument, hard coded to a signed 16-bit *4 relative offset as this is how RDNA2 does all it's relative branches. This will be setup inside the editor to auto relink as source is edited.",
|
|
"timestamp": "2023-08-06 20:15:16",
|
|
"media_urls": [
|
|
"https://pbs.twimg.com/media/F237uqaXAAAKAFl?format=jpg&name=orig"
|
|
],
|
|
"reply_to_id": "1688281975210041344",
|
|
"quote_of_id": null,
|
|
"metrics": {
|
|
"reply_count": 1,
|
|
"repost_count": 0,
|
|
"like_count": 3,
|
|
"view_count": 209
|
|
}
|
|
},
|
|
{
|
|
"post_id": "1688283094049021952",
|
|
"author": "NOTimothyLottes",
|
|
"handle": "NOTimothyLottes",
|
|
"text": "Source then is simple, two 128-bit values per 32-bit word in the binary. One to select {RULE, SYMBOLS, RELATIVE BRANCH}, and another for {LABEL, COMMENT}.",
|
|
"timestamp": "2023-08-06 20:17:11",
|
|
"media_urls": [
|
|
"https://pbs.twimg.com/media/F238Q-zXYAAO1Eo?format=png&name=orig"
|
|
],
|
|
"reply_to_id": "1688282613914492928",
|
|
"quote_of_id": null,
|
|
"metrics": {
|
|
"reply_count": 1,
|
|
"repost_count": 0,
|
|
"like_count": 3,
|
|
"view_count": 194
|
|
}
|
|
},
|
|
{
|
|
"post_id": "1688284090129084417",
|
|
"author": "NOTimothyLottes",
|
|
"handle": "NOTimothyLottes",
|
|
"text": "And then the source editor, shows a line per 32-bit value (so VOP3's for example would take 2 lines). So the 'assembler' is deceptively simple, but powerful enough to do everything required to generate GPU binary code. And all the opcode generation is in the data itself :)",
|
|
"timestamp": "2023-08-06 20:21:08",
|
|
"media_urls": [
|
|
"https://pbs.twimg.com/media/F238wJ8WoAAtEfw?format=png&name=orig"
|
|
],
|
|
"reply_to_id": "1688283094049021952",
|
|
"quote_of_id": null,
|
|
"metrics": {
|
|
"reply_count": 1,
|
|
"repost_count": 0,
|
|
"like_count": 4,
|
|
"view_count": 286
|
|
}
|
|
},
|
|
{
|
|
"post_id": "1688284962288537600",
|
|
"author": "NOTimothyLottes",
|
|
"handle": "NOTimothyLottes",
|
|
"text": "The editor itself will have 3 views {symbol table, rule table, source table}. The editor itself will use 2 copies of everything, so each edit, it's one entry/lane, reading prior state and updating to the new. Dead simple, dead parallel (not necessarily efficient) :)",
|
|
"timestamp": "2023-08-06 20:24:36",
|
|
"media_urls": [],
|
|
"reply_to_id": "1688284090129084417",
|
|
"quote_of_id": null,
|
|
"metrics": {
|
|
"reply_count": 1,
|
|
"repost_count": 0,
|
|
"like_count": 3,
|
|
"view_count": 484
|
|
}
|
|
},
|
|
{
|
|
"post_id": "1688286623375454208",
|
|
"author": "NOTimothyLottes",
|
|
"handle": "NOTimothyLottes",
|
|
"text": "Yeah, perhaps wildly alien. But for those who grew up with MOD-like trackers (like Impulse Tracker below), the interface will almost feel like home (those had simple {instrument, pattern, arangement} editors, with a very spreadsheet feel).",
|
|
"timestamp": "2023-08-06 20:31:12",
|
|
"media_urls": [
|
|
"https://pbs.twimg.com/media/F23_OOhXgAUBtlb?format=png&name=orig"
|
|
],
|
|
"reply_to_id": "1688284962288537600",
|
|
"quote_of_id": null,
|
|
"metrics": {
|
|
"reply_count": 0,
|
|
"repost_count": 0,
|
|
"like_count": 7,
|
|
"view_count": 488
|
|
}
|
|
}
|
|
],
|
|
"source_url": "https://x.com/NOTimothyLottes/status/1688286623375454208"
|
|
} |