4 ms·
The costs of the i386 to x86-64 upgrade
- johnklos 2y agoSo is the only difference between "x32" (sic) and 32 bit x86 with PAE the fact that "x32" can use full 64 bit registers?
- jmmv 2y agoIn part yes, the difference is the ability to access the 64-bit registers, the additional set of registers, and the assumption that SSE is present. But because of all of these, x32 defines a new call convention to optimize function calls.
- kimixa 2y agoI'd argue it's more similar to 64-bit x86, and the only difference between the "standard" x86_64 ABI and x32 ABI is that x32's pointers are 32bit. Everything else matches the 64-bit version - not the 32bit one - the instruction encoding, the extra registers, the minimum isa extensions (x86_64 puts a baseline of sse2), the calling convention advantages etc. etc.
- o11c 2y agoThere are a lot of future-oriented decisions in the x32 ABI, for example 64-bit `time_t` to avoid the Y2038 problem.
- ksec 2y agoAnd I assume most will default to X86S soon(ish)?
- solarmist 2y agoWhat's X86S? I'm not familiar with it.
- KMnO4 2y agoIt’s a simplified version of x86 that is 64bit only. It removes all the backwards compatibility for 32/16bit apps, as well as a number of low level features that aren’t really used/needed (legacy IO, old versions of SSE, memory segmentation, etc). Currently in the “investigation” phase by Intel. https://www.intel.com/content/www/us/en/developer/articles/technical/envisioning-future-simplified-architecture.html https://www.intel.com/content/www/us/en/developer/articles/t...
- EdSchouten 2y agoNote that it doesn’t remove support for 32 bit apps. It only removes the ability to boot 32 bit operating systems.
- shiroiushi 2y agoAre they ever going to remove PS/2 support? I'm still seeing motherboards with these ports on them.
- DaiPlusPlus 2y agoI hope not! Because systems like PS/2, COM/Serial ports, etc are really simple and well-understood (compared to USB) which does make them more reliable or dependable in situations where it matters. Additionally, PS/2 is very much still used today: every laptop I've ever owned, including my brand-new 2024 ThinkPad P1, has a touchpad ostensibly using a PS/2 connection internally - and we get all this functionality essentially for free (yay lithography): it's all baked into a single "Super I/O" unit[1] which today is part of some larger IC on your mobo. ...that said, Microsoft and some hardware partners tried this when Windows XP came out; they were called "Legacy-free PCs", which in-practice just meant (excepting video and audio) all periphial ports were USB 1.1, with zero (exposed) ports for PS/2, parallel, serial, ISA, and gameport/MIDI; no floppy drive either; it was also a convenient excuse to omit a 56K modem too. (Anyone remember the iPAQ Desktop[2]?). ...but it was more style than substance: those computers were still x86 machines using the same mobo chipsets as a traditional box, so the hardware support for PS/2 and the like was still there in the chips, just without the traces connected to anything and the functionality disabled via BIOS settings or maybe something like an e-fuse. [1] https://en.wikipedia.org/wiki/Super_I/O https://en.wikipedia.org/wiki/Super_I/O [2] https://en.wikipedia.org/wiki/IPAQ_(desktop_computer) https://en.wikipedia.org/wiki/IPAQ_(desktop_computer)
- jcelerier 2y ago> We can’t run the resulting binary. x32 is an ABI that impacts the kernel interface too, so these binaries cannot be executed on a regular x86-64 kernel. Sadly, and as far as I can tell, x32 is pretty much abandonware today. Gentoo claims to support it but there are no official builds of any distribution I can find that are built in x32 mode. Which distro is this ? In debian I'm pretty sure CONFIG_X86_X32 was enabled in the kernel not too long ago, enabling this to work without issues. When I benchmarked it was on average 20% faster than x86_64 and used quite less memory for GUI apps IIRC - I think that for most utilities like coreutils, image viewers, file explorers, media players, etc. they'd benefit from it ; >4GB is only really meaningful for web browsers, compilers & interpreters, games and creative apps such as anything doing 3D, audio or large data processing.
- jmmv 2y agoOriginal author here. Actually, this was on Debian testing, so maybe x32 was disabled not that long ago? A 20% penalty sounds insane, but I can very well believe it. What benchmarks did you run?
- sillystuff 2y agoYou need to pass syscall.x32=y on the kernel cmdline for Debian packaged kernels. https://wiki.debian.org/X32Port https://wiki.debian.org/X32Port But, maybe support has gone away recently, too since upstream apparently was interested in removing support? https://www.phoronix.com/news/Linux-Potentially-Drops-x32 https://www.phoronix.com/news/Linux-Potentially-Drops-x32
- LegionMammal978 2y agoAs far as I'm aware, kernel-side support hasn't budged an inch since all those articles came out. The bigger annoyance is that you'll either have to compile a special libc or define your own raw-syscall wrappers.
- sillystuff 2y ago
- docfort 2y agoA nice complement to this post is Mike Culbert’s article about how Apple chose to use 32-bit ARM6 instead of a 16-bit processor for reasons entirely unrelated to maximum memory size. http://waltersmith.us/newton/COMPCON-HW.pdf http://waltersmith.us/newton/COMPCON-HW.pdf
- M95D 2y ago> Sadly, and as far as I can tell, x32 is pretty much abandonware today. Gentoo claims to support it but there are no official builds of any distribution I can find that are built in x32 mode. It is supported, but the list of broken packages is rather long... [1] You don't need an official build, as Gentoo builds itself and also cross-builds itself for any target and any ABI. In this case, you don't even need a cross-build. Just install Gentoo x86_64 multilib, enable x32 support in kernel, enable abi_x86_x32 USE flag for the packages you want to test and run emerge to build them. They won't even interfere with the rest of the running system. See [2]. [1] https://github.com/gentoo/gentoo/blob/master/profiles/arch/amd64/x32/package.mask https://github.com/gentoo/gentoo/blob/master/profiles/arch/a... [2] https://wiki.gentoo.org/wiki/Multilib/Concepts https://wiki.gentoo.org/wiki/Multilib/Concepts
- dpassens 2y ago147 packages don't strike me as that many, that's less than 1% of all Gentoo packages. I expected much more. EDIT: And several of those packages are binaries. Apart from the *-bin packages, I've identified TeamSpeak, dev-libs/amdgpu-pro-opencl, Skype, and Slack. That leaves 138 packages.
- M95D 2y agoYeah, but one of those packages is nodejs. That means no firefox, no transmission, almost nothing with a web ui.
- dpassens 2y ago(Sane) web UIs in general should be fine, since they can just use the browser's JS engine. I don't think transmission is affected, at least it's not listed as masked. You're right about firefox though, which is weird. Apparently node is a build dependency, but I can't figure out if that's something specific to the ebuild (that Arch's PKGBUILD does as well) or just generally something the buildsystem requires, but it's not listed as a dependency at https://firefox-source-docs.mozilla.org/setup/linux_build.html https://firefox-source-docs.mozilla.org/setup/linux_build.ht....
- fweimer 2y agoComparing PIE executables is a bit of an anachronism. They did not really exist when x86-64 was introduced. Position-dependent executables are more compact on i386 because its lack of PC-relative addressing (the %rip stuff on x86-64) does not matter. That being said, the larger register set, the register-based calling convention, SSE2 for floating point math, PC-relative addressing (important for shared objects) together usually compensate the cost of wider pointers. Unless your workload happens to be pointer-heavy and fit into slightly less than 4 GiB of address space.