[llvm-commits] [llvm-gcc-4.2] r51971 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
Dale Johannesen
dalej at apple.com
Wed Jun 4 17:01:22 PDT 2008
Author: johannes
Date: Wed Jun 4 19:01:22 2008
New Revision: 51971
URL: http://llvm.org/viewvc/llvm-project?rev=51971&view=rev
Log:
X86-64 ABI: pass structs shorter than 4 bytes as
i16 or i8. Fixes 477.dealII.
Modified:
llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp?rev=51971&r1=51970&r2=51971&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Wed Jun 4 19:01:22 2008
@@ -1316,29 +1316,27 @@
int NumClasses = ix86_ClassifyArgument(Mode, type, Class, 0);
*DontCheckAlignment= true;
if (NumClasses == 1 && Class[0] == X86_64_INTEGER_CLASS) {
- /* 8 byte object, one int register */
+ // one int register
*size = 8;
return true;
}
if (NumClasses == 1 && Class[0] == X86_64_INTEGERSI_CLASS) {
- /* 4 byte object, one int register */
- *size = 4;
+ // one shorter-than-64-bits register
+ HOST_WIDE_INT Bytes =
+ (Mode == BLKmode) ? int_size_in_bytes(type) : (int) GET_MODE_SIZE(Mode);
+ *size = Bytes;
return true;
}
if (NumClasses == 2 && (Class[0] == X86_64_INTEGERSI_CLASS ||
Class[0] == X86_64_INTEGER_CLASS)) {
if (Class[1] == X86_64_INTEGER_CLASS) {
- /* 16 byte object, 2 int registers */
+ // 16 byte object, 2 int registers
*size = 16;
return true;
}
- if (Class[1] == X86_64_INTEGERSI_CLASS) {
- /* 12 byte object, 2 int registers */
- *size = 12;
- return true;
- }
+ // IntegerSI can occur only as element 0.
if (Class[1] == X86_64_NO_CLASS) {
- /* 16 byte object, only 1st register has information */
+ // 16 byte object, only 1st register has information
*size = 8;
return true;
}
More information about the llvm-commits
mailing list