summaryrefslogtreecommitdiffstats
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
commit70d9929def5fda573a5c082620c0e7713decb94c (patch)
tree88718e08840e7a6ba3a7d56a87ba662473bcb606
parent31a20d680ae23d9d1e368194c869074f8390fd95 (diff)
downloadbcm5719-llvm-70d9929def5fda573a5c082620c0e7713decb94c.tar.gz
bcm5719-llvm-70d9929def5fda573a5c082620c0e7713decb94c.zip
Add comments explaining why there's only one register for
i8 return values. llvm-svn: 67502
-rw-r--r--llvm/lib/Target/X86/X86CallingConv.td7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86CallingConv.td b/llvm/lib/Target/X86/X86CallingConv.td
index d2fc86398e4..370bae7a50c 100644
--- a/llvm/lib/Target/X86/X86CallingConv.td
+++ b/llvm/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]>>,
OpenPOWER on IntegriCloud