You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cmd/asm: support Advanced Matrix Extensions (AMX) in Go Assembler #61079
The Go assembler (shipped with 1.20.5) currently lacks support for Advanced Matrix Extensions (AMX), particularly the sub-extensions AMX-TILE, AMX-INT8, and AMX-BF16.
As a workaround, we have been using byte sequences to generate the required instructions. However, for the sake of our mental stability, we would love to use proper instructions. @golang/compiler could you please add these 12 AMX instructions.
changed the title [-]proposal: support Advanced Matrix Extensions (AMX) in Go Assembler[/-][+]cmd/asm: support Advanced Matrix Extensions (AMX) in Go Assembler[/+]on Jun 30, 2023
Quick update on my progress. During the investigation of how to implement this feature I discovered that there's a tool x86avgen. It generates corresponding optables based on a provided csv file, e.g. this or this. After that I discovered, that there's a tool x86spec which actually downloads the latest intel doc and parses it to generate corresponding csv file mentioned previously.
However, there's a problem. Currently this tool can't parse properly the latest documentation with added AMX commands, due to the unhandled header.
For example:
p.1440: reading TILELOADD/TILELOADDT1-Load Tile: unexpected header: "CPUID Feature\nFlag"
["Opcode/Instruction" "Op/En" "64/32-Bit Mode" "CPUID Feature\nFlag" "Description"]
["VEX.128.F2.0F38.W0 4B !(11):rrr:100\nTILELOADD tmm1, sibmem" "A" "V/N.E." "AMX-TILE" "Load data into tmm1 as specified by information\nin sibmem."]
["VEX.128.66.0F38.W0 4B !(11):rrr:100\nTILELOADDT1 tmm1, sibmem" "A" "V/N.E." "AMX-TILE" "Load data into tmm1 as specified by information\nin sibmem with hint to optimize data caching."]
To add AMX commands I first need to fix this parser (which I will work on). Do I need to create a separate issue for it, or I can fix it as part of this one?
I've created an initial PR, however there's a number of questions, which had to be resolved before it will be ready, so it will take some time. I will ask questions in gerrit.
Activity
[-]proposal: support Advanced Matrix Extensions (AMX) in Go Assembler[/-][+]cmd/asm: support Advanced Matrix Extensions (AMX) in Go Assembler[/+]ianlancetaylor commentedon Jun 30, 2023
This doesn't need to be a proposal, so taking it out of the proposal process.
cagedmantis commentedon Jun 30, 2023
/cc @golang/compiler
anton-kuklin commentedon Jul 11, 2023
Would love to work on that.
cherrymui commentedon Jul 11, 2023
@anton-kuklin that would be great. Thanks! (I don't know of anybody currently working on this.)
anton-kuklin commentedon Jul 11, 2023
Sure, starting my work.
anton-kuklin commentedon Jul 17, 2023
Quick update on my progress. During the investigation of how to implement this feature I discovered that there's a tool x86avgen. It generates corresponding optables based on a provided csv file, e.g. this or this. After that I discovered, that there's a tool x86spec which actually downloads the latest intel doc and parses it to generate corresponding csv file mentioned previously.
However, there's a problem. Currently this tool can't parse properly the latest documentation with added AMX commands, due to the unhandled header.
For example:
To add AMX commands I first need to fix this parser (which I will work on). Do I need to create a separate issue for it, or I can fix it as part of this one?
CC: @cherrymui
gopherbot commentedon Jul 17, 2023
Change https://go.dev/cl/510555 mentions this issue:
x86spec: fix header parsinganton-kuklin commentedon Jul 27, 2023
Hey @cherrymui, any chance you can give it a look? It should become pretty straightforward, after we will sort out the PR mentioned above.
cmd/asm: add x86 AMX instructions
gopherbot commentedon Aug 5, 2023
Change https://go.dev/cl/516277 mentions this issue:
cmd/asm: add x86 AMX instructionsanton-kuklin commentedon Aug 5, 2023
I've created an initial PR, however there's a number of questions, which had to be resolved before it will be ready, so it will take some time. I will ask questions in gerrit.
cmd/asm: add x86 AMX instructions