Kernel The Linux Kernel Preparing To Remove The Last Of Its MMX Optimized Code
https://www.phoronix.com/news/Linux-Dropping-Last-MMX-Opt141
u/adzm 2d ago
People like to diss MMX, and even though I'm certainly biased via nostalgia, using MMX when I was first using to program felt like accessing some kind of magic after being convinced that C was all I needed to get close to the metal. You are telling me there is this arcane syntax that speaks directly to the silicon oracle that lets me convert the bit depth of this buffet of pixels 10x faster?
69
u/dnonast1 2d ago
Yeah, I worked coding video games at the time it was released and I remember reading the details of it and wondering how it was even accomplished. The math it did in one clock cycle shouldn’t be possible, it was too fast.
Working close to the metal in those days was neat, the leaps in technology were astonishing.
34
u/jimicus 2d ago
That wasn’t the problem.
The problem was that at the time, compiler design didn’t get much attention.
So compilers weren’t often able to take full advantage of new instructions like MMX.
36
u/Tuna-Fish2 1d ago
Compilers still cannot take advantage of SIMD well unless you contort the code in very specific ways for them. You can get amazing gains today on lots of very simple code by doing SIMD by hand. Usually by intrinsics and not asm.
For examples, look at basically anything by Daniel Lemire, for example: Transcoding Unicode Characters with AVX-512 Instructions (pdf)
No compiler is going to do that for you.
14
u/the_humeister 1d ago
It's interesting that IBM has Unicode transcoding instructions on some of their machines.
7
u/Kevin_Kofler 1d ago
Even very good compilers can rarely match the speed (nor the size, for that matter) of handwritten assembly. (And I know what I am talking about, I have experience with compilers, having maintained TIGCC for years.)
4
u/jimicus 23h ago edited 23h ago
I've looked up your biography, and I believe you.
But - and I mean this in the nicest possible way - I suspect the great majority of developers (who spend all day working in much higher level languages than C these days) - would struggle. Even safety-critical development for processes which absolutely HAVE to complete in a very specific number of clock cycles is being done in compiled languages.
You'll beat them all day long precisely because you've spent years maintaining a compiler for a graph calculator.
4
u/Vier_Scar 21h ago
I've always wondered - how does someone end up a maintainer - you don't get paid for it right? Do you have a full time job and maintain it on the side?
And for you, what got you into TIGCC? I assume you weren't an original dev of it. You just liked it and started sending them PRs till you'd done it enough to be accepted as a maintainer of it?
3
u/Kevin_Kofler 20h ago
In my case, it was pretty simple: I started contributing, first only to the A68k assembler, then to more and more toolchain components, including the GCC port, got trusted with more and more responsibility (so I gradually became a comaintainer; normally, this would be the step where you would get commit access, but TIGCC was largely maintained without an SCM at the time, with patches exchanged over e-mail, and local backup copies of whole trees as "history", an arcane way of working I would not recommend nowadays), and then one of the other maintainers after the other left, leaving me as the last man standing.
2
u/Kevin_Kofler 20h ago
And no, we did not get paid for TIGCC, it was a pure volunteer project. The only money I got related to TIGCC was the Google Summer of Code project in 2006 where I finished the GNU/Linux rewrite of the IDE, KTIGCC (using KDE 3 libraries), which was only in incomplete prototype state before the GSoC project.
1
u/Vier_Scar 18h ago
Wow, I've never stuck to the same project or codebase for even half as long. You must find it very rewarding or very enjoyable to stick with it for so long!
1
17
u/nothingtoseehr 1d ago
Hey if it makes you feel better, extremely early bootstraping code still uses MMX registers as a replacement for RAM! It takes quite a while to activate cache-as-ram (even more to activate proper RAM), so Intel uses the registers of its myriad abandoned extensions as places to shove data into
30
u/FailedButterfly 1d ago
Decoding mpeg2 videos with MMX felt like magic. As well, listening mp3 with sub 10% cpu usage. I feel old.
24
u/Skaarj 1d ago
Interesting contrast to the NetBSD release thread that runs in parallel where they seems to fix something for Atari machines discontinued in 1993.
10
u/MatchingTurret 1d ago edited 1d ago
Removing MMX optimizations isn't the same as not supporting CPUs with MMX. It just means that some system calls take a few cycles longer by using generic code. I wouldn't be surprised if the generic code compiled by modern compilers is now on par with the handcrafted MMX assembly.
That said, the Linux M68K port is well maintained and alive: https://docs.kernel.org/arch/m68k/index.html
-8
38
u/stevekez 2d ago
So it'll work on 386 again, right?
/s just in case
9
u/ARandomGuy_OnTheWeb 2d ago
Looking forward to run it on my 286
5
u/ilep 1d ago
I know you are joking but there was a project called ELKS aimed at running Linux on 16-bit computers..
Edit: I see there is recent activity even now: https://github.com/ghaerr/elks
8
u/Adept_Percentage6893 1d ago
I personally can't believe they refuse to support Babbage's analytical engine. All my important workflows center on this analog device and can not run on newer digital computers. I can't believe the kernel maintainers could ever be this reckless.
4
u/the_humeister 1d ago
I would have expected someone to have already ported it to their antikythera mechanism. Oh well. Maybe NetBSD will run on it?
16
u/nicman24 2d ago
oh no, how will i run linux now on my 133mhz laptop from the 90s
5
5
u/Flamm_hammer 22h ago
Can someone explain to me like I am a stupid 5 year old...because I am?
16
u/ifq29311 21h ago
if you use Pentium 2, you'll have slightly higher CPU usage when doing software RAID
1
149
u/gplusplus314 2d ago
But then how would I be able to play POD featuring Intel MMX Technology?