[llvm-commits] [llvm] r67502 - /llvm/trunk/lib/Target/X86/X86CallingConv.td
Dan Gohman
gohman at apple.com
Sun Mar 22 21:28:24 PDT 2009
Author: djg
Date: Sun Mar 22 23:28:24 2009
New Revision: 67502
URL: http://llvm.org/viewvc/llvm-project?rev=67502&view=rev
Log:
Add comments explaining why there's only one register for
i8 return values.
Modified:
llvm/trunk/lib/Target/X86/X86CallingConv.td
Modified: llvm/trunk/lib/Target/X86/X86CallingConv.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CallingConv.td?rev=67502&r1=67501&r2=67502&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86CallingConv.td (original)
+++ llvm/trunk/lib/Target/X86/X86CallingConv.td Sun Mar 22 23:28:24 2009
@@ -22,7 +22,12 @@
// 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]>>,
More information about the llvm-commits
mailing list