Zephyrnet Logo

What Is X86-64-v3?

Date:

You may have heard Linux pundits discussing x86-64-v3. Can recompiling Linux code to use this bring benefits? To answer that question, you probably need to know what x86-64-v3 is, and [Gary Explains]… well… explains it in a recent video.

If you’d rather digest text, RedHat has a recent article about their experiments using the instructions set in RHEL10. From that article, you can see that most of the new instructions support some enhancements for vectors and bit manipulation. It also allows for more flexible instructions that leave their results in an explicit destination register instead of one of the operand registers.

Of course, none of this matters for high-level code unless the compiler supports it. However, gcc version 12 will automatically vectorize code when using the -O2 optimization flags.

There’s a snag of course, that will make code incompatible with older CPUs. How old? Intel has supported these instructions since 2013 in the Haswell CPUs. Although some Atom CPUs have had v3 since 2021, some later Intel Atoms do not support it fully. AMD came to the party in 2015. There is a newer set of instructions, x86-64-v4. However, this is still too new, so most people, including RedHat, plan to support v3 for now. You can find a succinct summary table on Wikipedia.

So, outside of Atom processors, you must have some old hardware to not have the v3 instructions. Some of these instructions are pretty pervasive, so switching at run time doesn’t seem very feasible.

We wonder if older processors would trip illegal instruction interrupts for these instructions. If so, you could add emulated versions the same way old CPUs used to emulate math coprocessors if they didn’t have one.

Keep in mind that the debate about dropping versions before x86-64-v3 doesn’t mean Linux itself will care. This is simply how the distributions do their compile. While compiling everything yourself is possible but daunting, there will doubtlessly be distributions that elect to maintain support for older CPUs for as long as the Linux kernel will allow it.

Intel would like to drop older non-64-bit hardware from CPUs. If you want to sharpen up your 64-bit assembly language skills, try a GUI.

[embedded content]

(Title image from Wikipedia)

spot_img

Latest Intelligence

spot_img