[PATCH] D91338: [X86] Zero-extend pointers to i64 for x86_64

H.J Lu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 14 07:04:55 PST 2020


hjl.tools added a comment.

In D91338#2395608 <https://reviews.llvm.org/D91338#2395608>, @hvdijk wrote:

> In D91338#2395497 <https://reviews.llvm.org/D91338#2395497>, @pengfei wrote:
>
>> Hi Harald, thanks for thoroughly answering my questions. I still have doubts intention of this patch. Is there any bug related to it?
>
> I run an x32 system. Things work well for things built with GCC, but break badly when using LLVM, because the ABI as implemented is incompatible between GCC and LLVM, as GCC-generated code will sometimes assume that the high bits of pointer parameters have been zeroed out as required by the ABI. This is especially visible when using Rust applications, as the Rust compiler is LLVM-based but most of the rest of my system is built with GCC. Pretty much any non-trivial Rust application crashes, for instance ripgrep, or the Rust compiler itself.
>
>> IMHO, the ILP32 mode is designed for performance which always assumes the address bit 63~32 all zero and uses 32 bits register to reduce code size.

ILP32 psABI has

---

10.1 Parameter Passing

When a value of pointer type is returned or passed in a register, bits 32 to 63 shall be zero.
----------------------------------------------------------------------------------------------

It is required for ILP32 since many system calls are shared between ILP32 and LP64.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91338/new/

https://reviews.llvm.org/D91338



More information about the llvm-commits mailing list