6 ms·
Inside the AMD Microcode ROM [video]
- snovv_crash 8y agoI wonder whether it would be possible to add aftermarket AVX-512 instruction handling? Not for performance necessarily, but for compatibility.
- ah- 8y agoUnlikely, IIRC you only had someting in the order of 32 three-instruction slots of memory.
- TazeTSchnitzel 8y agoThe tricky thing there would be those aren't just new instructions, they extend existing registers and add new ones. Where do you fit the extra bytes?
- en4bz 8y agoAMD already implements 256bit operations in terms of 2 128bit operations. Seems like going to 4 wouldn't be a stretch, at least for some of the simpler operations. Seems like a subset of operations would be possible.
- bayindirh 8y agoI think Zen2 implements 256 bit instructions natively [0]. For AVX512, the new instructions [1] rather than the floating point arithmetic will be a problem IMHO. Emulating them with the microcode will be expensive and will provide no performance gains. [0]: https://en.wikichip.org/wiki/amd/microarchitectures/zen_2 https://en.wikichip.org/wiki/amd/microarchitectures/zen_2 [1]: https://en.wikipedia.org/wiki/AVX-512 https://en.wikipedia.org/wiki/AVX-512
- TazeTSchnitzel 8y ago> AMD already implements 256bit operations in terms of 2 128bit operations. Current Zen has actual 256-bit registers, it just doesn't have the execution units to process the whole register at once. It's not really the same thing.
- ip26 8y agoWe have robust support for alternate code paths based on CPU flags after many years of this kind of thing. Is that really necessary or useful? Custom microcode handling is a lot more brittle and chip- specific yet nearly equivalent to overloading in software your call to some avx512 op.
- raverbashing 8y agoYou're right, it isn't needed The "last time" this was done was in the x87 days, where if the math coprocessor wasn't installed you could trap the corresponding interrupt and handle it to emulate the instructions.
- bpye 8y agoThis is done for MIPS FP emulation too - https://www.linux-mips.org/wiki/Floating_point#The_Linux_kernel_and_floating_point https://www.linux-mips.org/wiki/Floating_point#The_Linux_ker...
- mschuster91 8y ago> The "last time" this was done was in the x87 days, where if the math coprocessor wasn't installed you could trap the corresponding interrupt and handle it to emulate the instructions. Wasn't Hackintosh (or getting new OS X running on too old hardware) also using this technology to "support" CPUs without the newest SSEx instruction sets?
- rzzzt 8y agoI guess it would be easier to do that with virtualization. Advertise the capability to the VM, catch illegal instructions, emulate the missing pieces.
- choonway 8y agoIs it possible to hack the microcode so that it can run ARM assembly natively?
- bayindirh 8y agoIt would be hard, because the ISA is tightly bound to the underlying silicon's structure. Some of the commands cannot be translated to the silicon effectively or not at all. e.g.: MIPS have 64 x 64bit registers. You can use any of them as a source or a destination, however x86 always designates EAX as the ALU accumulator. This has some profound effects on silicon design.
- gpderetta 8y ago> x86 always designates EAX as the ALU accumulat Actually no. After decoding there is nothing special in the aex register. AMD at some point was going to release K10 which was basically Zen but with an ARM decoder. It got cancelled when Zen proved viable and AMD decided it was better to compete with Intel than all the ARM vendors.
- floatboth 8y agohttps://softiron.com/development-tools/overdrive-1000/ https://softiron.com/development-tools/overdrive-1000/ They actually "released" (to one manufacturer it seems) the Opteron A1100. With stock Cortex-A57 cores, not "Zen with an ARM decoder".
- bayindirh 8y ago> Actually no. After decoding there is nothing special in the aex register. The microcode, or specifically the modern x86 processors, are using register renaming to move things around, but the actual ASM commands imply that the results should end in EAX register. You cannot arbitrarily do a MUL and get the result from EBX for example [3]. i.e. x86 assembly dictates where the results should end in. AMD played with two ideas: A pure ARM core, and a hybrid x86 core with ARM co-processor. The ARM core missed the performance targets [0], and they also abandoned the ARM accelerated x86 core [1], but I don't know why. They never intended to go full TransMeta and transcode the x86 ASM into something proprietary or ARM. Bonus: It seems they are still muling the idea of X86/ARM hybrid [2]. [0]: https://www.theregister.co.uk/2018/11/27/amazon_aws_graviton_specs/ https://www.theregister.co.uk/2018/11/27/amazon_aws_graviton... [1]: https://www.extremetech.com/computing/205078-amds-project-skybridge-the-armx86-hybrid-core-is-officially-dead https://www.extremetech.com/computing/205078-amds-project-sk... [2]: https://www.reddit.com/r/AMD_Stock/comments/8x4sba/the_return_of_the_x86arm_hybrid/ https://www.reddit.com/r/AMD_Stock/comments/8x4sba/the_retur... [3]: https://c9x.me/x86/html/file_module_x86_id_210.html https://c9x.me/x86/html/file_module_x86_id_210.html
- atq2119 8y agoAccording to a question at the end, this is about very old CPUs, K8/K10, because the newer ones authenticate microcode updates with public key cryptography which hasn't been broken. Still pretty amazing stuff.
- loeg 8y agoYeah, the description says "up to 2013." I think that's likely a bit more recent than K10 but I don't know.
- TazeTSchnitzel 8y agoThat's just the tail end of K10 production (2012 according to Wikipedia). Its successor, Bulldozer, came out in 2011, but a new architecture being out doesn't mean its predecessor immediately stops production.
- shmerl 8y agoWhy is AMD microcode not open source to begin with?
- anonymouzz 8y agoIt's firmware. Very little firmware is. In information theoretic sense it's much more surprising if some firmware is open source.
- shmerl 8y agoI'm asking why. Is there some reason for them not to open it? AMD are quite positive about opening up other things, like GPU drivers for example. So why not firmware as well? In the GPU case I know the reason - it's the DRM garbage (HDCP and Co.). Support for DRM dictates for them to keep it closed. But even there, they could provide alternative firmware without DRM, and make it open. But for CPU, there is no real reason it seems.
- jshap70 8y agobecause there's a lot of proprietary stuff in microcode that's used for accelerations. gfx drivers too. it's the reason the closed amd drivers are so much faster than the open mesa ones.
- shmerl 8y ago> it's the reason the closed amd drivers are so much faster than the open mesa ones. On the contrary, Mesa is faster than their blob. AMD themselves are working on replacing blob with Mesa in the long term. Firmware doesn't offer any acceleration advantages, it's used for different purposes.
- cafxx 8y agoI wonder if it would be possible to dump, from microcode, the contents of the microcode ROM. This would neatly sidestep the problems inherent in decoding the ROM contents from pictures of decapped chips.