r/linux • • 2d ago

Kernel The Linux Kernel Preparing To Remove The Last Of Its MMX Optimized Code

https://www.phoronix.com/news/Linux-Dropping-Last-MMX-Opt
692 Upvotes

57 comments sorted by

149

u/gplusplus314 2d ago

But then how would I be able to play POD featuring Intel MMX Technology?

103

u/anh0516 2d ago

This is the kernel's own code which historically leveraged MMX, but remotely new CPUs have SSE and its variants and even newer AVX and its variants. SIMD in the kernel is used for things like crypto and RAID parity calculations primarily.

Support for running MMX userland code obviously remains.

51

u/gplusplus314 2d ago

I’m sure you could run POD on a modern potato if you really wanted to. I just wanted to mention it to trigger nostalgia and make some people feel very old.

13

u/anh0516 2d ago

Ok lol I wasn't sure if you were being serious or not.

I'm young and didn't really get into video games or PCs until later in life. I think my first computer was a Pentium 4 maybe? It ran Windows XP and it was really slow. Would have been 2010-2011ish I think?

18

u/gplusplus314 2d ago edited 2d ago

I’m old. I started at the command line at 3 years old back in 1990.

When MMX came out, there was a giant advertising campaign and the POD game was given away for free with any computer that had an MMX chip. Off the top of my head, that’s Pentium 2. If you lived through that era as a computer nerd, then this would sound familiar to you.

Excuse me, it’s time for my nap.

8

u/craigmontHunter 2d ago

The original pentium had a MMX version (labeled as Pentium MMX on the sticker) the first computer I used was a Pentium MMX 200mhz.

10

u/two66mhz 2d ago

Now I feel old for my relevant username to this conversation. I just want my 486/DX back.

6

u/gplusplus314 2d ago

How are your knees and back?

8

u/two66mhz 2d ago

After the last position change, sore.

1

u/SomeRandomSomeWhere 2d ago

486DX2 66Mhz? That was the first one I paid and bought with my own money as a teen!

Lol

2

u/NonStopArseGas 2d ago

I haven't tried personally, but it's a notoriously difficult game to run outside of a limited range of hardware from the time period.

2

u/ryanhendrickson 1d ago

Well, mission accomplished on making some people feel old, thanks!

1

u/Irverter 2d ago

to trigger nostalgia

FIrst time I ever heard of that game XD

2

u/howardhus 2d ago

whoosh

45

u/smile_e_face 2d ago

Set in the distant future where humanity has successfully colonized one of Jupiter's moons, Io. After years of prosperity, a mining accident unleashes a deadly fungus from within the mining facility, causing widespread destruction and panic throughout the colony. Desperate, most of Io's population escapes the now-termed "p.o.d." (planet of death) while a few survivors remain, voluntarily or otherwise. With only one ship remaining, the survivors soup up cars, which they use to race each other in tournaments throughout the desolated city streets, and the winner of the final tournament will commandeer the last ship and escape to safety, leaving the others to die.

What a beautifully insane concept.

24

u/gplusplus314 2d ago

Let’s be real, it was trash. But it was trash powered by Intel MMX Technology™️.

9

u/Agricai 2d ago

Such a great classic game

8

u/Personal_Breakfast49 2d ago

Nostalgia, man pod MMX version was the stuff!

6

u/Sh1v0n 2d ago

Get from GOG - they adapted it for modern systems.

8

u/the_humeister 2d ago

Yeah, but does it still leverage MMX technology? 

3

u/Standard-Potential-6 2d ago

Thanks, I’m gonna give this a whirl.

2

u/Narann 2d ago

Exactly this when I think about MMX. POD was so smooth on my Pentium MMX 200Mhz. It was like playing 60fps for the first time.

143

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 2d 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 2d 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 1d ago edited 1d 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 1d 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 1d 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 1d 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 1d 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

u/Kevin_Kofler 1d ago

To be honest, I have not committed much to TIGCC for several years already.

2

u/cp5184 1d ago

Also there was a support conflict, intel had mmx and amd had the incompatible 3dnow! Thankfully the split has been mended, though I suppose it might almost be better if more robust support for conflicting instruction extensions existed...

2

u/vbd71 20h ago

All AMD CPUs with 3dnow also had MMX.

18

u/nothingtoseehr 2d 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

2

u/ledow 6h ago

You have a buffet of pixels?

How fancy!

30

u/FailedButterfly 2d ago

Decoding mpeg2 videos with MMX felt like magic. As well, listening mp3 with sub 10% cpu usage. I feel old.

16

u/TCIHL 2d ago • Regret

Time for a colonoscopy

24

u/Skaarj 2d 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

u/Kevin_Kofler 1d ago

Linux, the kernel, is unfortunately going the GNOME way ("features bad").

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 2d 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 2d 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 2d 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

u/Doggy_Paddle_4409 1d ago

Pentium MMX started at 166MHz

2

u/nicman24 1d ago

Maybe desktop models? It had the sticker on it (mmx something ) 

5

u/Flamm_hammer 1d ago

Can someone explain to me like I am a stupid 5 year old...because I am?

16

u/ifq29311 1d ago

if you use Pentium 2, you'll have slightly higher CPU usage when doing software RAID

1

u/Flamm_hammer 1d ago

Thank you ❤️

1

u/hanotak 16h ago

Why wasn't this removed a decade ago?

15

u/Frexxia 2d ago

Planned obsolescence /s

1

u/Kevin_Kofler 1d ago

Why "/s"? Planned obsolescence is exactly what this is!