summaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86CallingConv.td
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-03-23 04:28:24 +0000
committerDan Gohman <gohman@apple.com>2009-03-23 04:28:24 +0000
commit82f84159e0ec945657054ddcf465aca3253339ab (patch)
treec99519efec0ecb935823f8dbed53343a2b1e44f9 /lib/Target/X86/X86CallingConv.td
parenta38ff646bc0ca873b3fe73b8d69e31209bedb2e2 (diff)
downloadllvm-82f84159e0ec945657054ddcf465aca3253339ab.tar.gz
llvm-82f84159e0ec945657054ddcf465aca3253339ab.tar.bz2
llvm-82f84159e0ec945657054ddcf465aca3253339ab.tar.xz
Add comments explaining why there's only one register for
i8 return values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67502 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86CallingConv.td')
-rw-r--r--lib/Target/X86/X86CallingConv.td7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Target/X86/X86CallingConv.td b/lib/Target/X86/X86CallingConv.td
index d2fc86398e..370bae7a50 100644
--- a/lib/Target/X86/X86CallingConv.td
+++ b/lib/Target/X86/X86CallingConv.td
@@ -22,7 +22,12 @@ class CCIfSubtarget<string F, CCAction A>
// Return-value conventions common to all X86 CC's.
def RetCC_X86Common : CallingConv<[
- // Scalar values are returned in AX first, then DX.
+ // Scalar values are returned in AX first, then DX, except for i8 where
+ // the convention is to return values in AL and AH. However, using AL and
+ // is AH problematic -- a return of {i16,i8} would end up using AX and AH,
+ // and one value would clobber the other. C front-ends are currently expected
+ // to pack two i8 values into an i16 in the rare situations where this
+ // is necessary.
CCIfType<[i8] , CCAssignToReg<[AL]>>,
CCIfType<[i16], CCAssignToReg<[AX, DX]>>,
CCIfType<[i32], CCAssignToReg<[EAX, EDX]>>,