





















Software built for Windows must be built for the Windows x86 or x64 ABIs, which are unrelated to x32. WINE needs Linux AMD64 libraries for x64 ABI support and (for versions where the WoW64 work in Wine is not done) Linux i386 libraries for x86 ABI support.
Linux's x32 ABI is a special case of Linux's AMD64 where the ABI designers have declared that the top 33 bits of all 64 bit pointers are always going to be the same - either all 1s, or all 0s, and C's long type is 32 bit instead of 64 bit. Other than those two differences (with all of the ripple-through this causes), the ABI is the same as AMD64 - the CPU is in long mode, you have access to RAX through R15 (with RSP, RBP etc) instead of EAX through ESP, segmentation doesn't work etc.
Making the top 33 bits of every pointer the same means that loading and storing pointers can just store the bottom 32 bits of the 64 bit pointer, and load with sign extension, to recover the 64 bit pointer the CPU works with. This was supposed to reduce memory use (halving the RAM used by pointers) and speed things up by reducing cache footprint, but in practice never did by enough to make it worth having.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。