[llvm-commits] [PATCH] x32 ABI support: 32-bit pointer size and handling sret

Eli Bendersky eliben at google.com
Fri Jan 25 09:40:27 PST 2013


Hello,

This is the next patch in the effort to add x32 ABI support to LLVM
(introduced in http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-January/058209.html).

In this patch, we teach X86_64TargetMachine that it has a ILP32
(defined by the x32 ABI) mode, in which case its pointers are 32-bits
in size. This knowledge is also added to X86RegisterInfo that now
returns the appropriate registers in getPointerRegClass.

There are many outcomes to this change. In order to keep the patches
separate and manageable, we start by focusing on some simple testable
cases. The patch adds a test with passing a pointer to a function -
focusing on the difference between the two data models for x86-64.
Another test is added for handling of 'sret' arguments (and
functionality is added in X86ISelLowering to make it work).

A note on naming: the "x32 ABI" document refers to the AMD64
architecture (in LLVM it's distinguished by being is64Bits() in the
x86 subtarget) with two variations: the LP64 (default) data model, and
the ILP32 data model. For lack of better ideas for naming, this patch
adds predicates to the subtarget which are consistent with this naming
scheme.

This patch in particular, and our x32 effort in general, is partly
based on the x32 patches Michael Liao from Intel sent last year. Our
goal is to reconcile the ILP32 needs of Native Client with Michael's
x32 approach into generic patches that will be generally useful.

Eli
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x32-pointer-size-sret.2.patch
Type: application/octet-stream
Size: 8478 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130125/12f76543/attachment.obj>


More information about the llvm-commits mailing list