Hello, Does anyone know of any precedent for handling i128 in the calling convention on x86-32? I'm trying to write a testcase that returns an i128 value, and LLVM currently has only two 32-bit GPRs designated for returning integer values on x86-32. Dan
I think it's returned in 4 registers: eax, edx, esi, edi. Can someone confirm? Evan On Feb 27, 2008, at 8:33 AM, gohman at apple.com wrote:> Hello, > > Does anyone know of any precedent for handling i128 in the > calling convention on x86-32? I'm trying to write a testcase > that returns an i128 value, and LLVM currently has only two > 32-bit GPRs designated for returning integer values on x86-32. > > Dan > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
BTW, I think the type name for i128 is intmax_t and uintmax_t (see inttypes.h). Evan On Feb 27, 2008, at 9:58 AM, Evan Cheng wrote:> I think it's returned in 4 registers: eax, edx, esi, edi. Can someone > confirm? > > Evan > > On Feb 27, 2008, at 8:33 AM, gohman at apple.com wrote: > >> Hello, >> >> Does anyone know of any precedent for handling i128 in the >> calling convention on x86-32? I'm trying to write a testcase >> that returns an i128 value, and LLVM currently has only two >> 32-bit GPRs designated for returning integer values on x86-32. >> >> Dan >> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
On Feb 27, 2008, at 8:33 AM, gohman at apple.com wrote:> Hello, > > Does anyone know of any precedent for handling i128 in the > calling convention on x86-32? I'm trying to write a testcase > that returns an i128 value, and LLVM currently has only two > 32-bit GPRs designated for returning integer values on x86-32.Judging from the code in gcc, it goes in XMM0 if SSE is there, and in memory otherwise. See ix86_return_in_memory. (In 4.3 this is renamed to return_in_memory_32.) i128==TImode.
On Wed, 27 Feb 2008, Evan Cheng wrote:> I think it's returned in 4 registers: eax, edx, esi, edi. Can someone > confirm?I don't think there is a standard ABI. I'd be find with allocating a hidden argument and returning the values by reference. At some point we'll have to start doing this: if not for i128, then for multiple return values. Anton mentioned that Fortran uses i128 on 32-bit systems, Anton do you know if they can be returned, and if so what ABI they use? -Chris> On Feb 27, 2008, at 8:33 AM, gohman at apple.com wrote: > >> Hello, >> >> Does anyone know of any precedent for handling i128 in the >> calling convention on x86-32? I'm trying to write a testcase >> that returns an i128 value, and LLVM currently has only two >> 32-bit GPRs designated for returning integer values on x86-32. >> >> Dan >> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-Chris -- http://nondot.org/sabre/ http://llvm.org/
> Anton mentioned that Fortran uses i128 on 32-bit systems, Anton do you > know if they can be returned, and if so what ABI they use?Looks like, that warning is generated during emission of decl of __sync_fetch_and_add_16. I don't have any gcc 4.2.x+ here, so if somebody have it available on 32-bit machine - please check the stuff. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University.
Thanks everyone for your input here; I'm actually not going to persue this at this time. x86-64 does support i128 return values, and that's sufficient for my current needs. Dan On Feb 27, 2008, at 8:33 AM, gohman at apple.com wrote:> Hello, > > Does anyone know of any precedent for handling i128 in the > calling convention on x86-32? I'm trying to write a testcase > that returns an i128 value, and LLVM currently has only two > 32-bit GPRs designated for returning integer values on x86-32. > > Dan > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev