My oldish PC has an Intel HD 420 in it.
I was wondering - we can use Assembly code to address the CPU directly, with commands like mul
, add
The GPU is a separate core you can only interact with via MMIO; it's not a coprocessor like x87 originally was (where fmul
ran on a separate chip). You can access it the same way the graphics drivers do.
There is no CPU instruction that does stuff on the GPU directly because it's not tightly-coupled at all, hence the high latency being a problem for GPGPU. Sending work to the GPU looks like storing to memory and then passing a pointer to that physical memory to the GPU, e.g. via mov [mem], rax
or something to the address of one of the GPU's MMIO registers.
For Intel, those are open source if you really want to dive in to Linux DRM (direct rendering manager) and X11 drivers that talk to the GPU after asking the kernel for access.
If you need the ISA for Intel HD graphics, here it is. Intel provides the programmer's reference manuals for all their graphics chips here. These information can be used to create a graphics driver for Intel HD graphics, which is the most "direct" way of accessing the GPU.
Please note this is for Intel HD graphics as they are the only one who provides ISA documentation for open source driver development as I know.
Best of luck!