Dan Gohman
7a9e8cbf79
I was convinced that it's ok to allow a second i8 return value
...
to be returned in DL. LLVM's multiple-return-value support is
not ABI-conforming; front-ends that wish to have code emitted
that conforms to an ABI are currently expected to make
arrangements for this on their own rather than assuming that
multiple-return-values will automatically do the right thing.
This commit doesn't fundamentally change this situation.
llvm-svn: 67588
2009-03-24 01:04:34 +00:00
Dan Gohman
745c0acc79
Fix a grammaro in a comment that Bill noticed.
...
llvm-svn: 67507
2009-03-23 05:02:44 +00:00
Dan Gohman
16b4a33039
Add comments explaining why there's only one register for
...
i8 return values.
llvm-svn: 67502
2009-03-23 04:28:24 +00:00
Evan Cheng
dd139e795c
Only v1i16 (i.e. _m64) is returned via RAX / RDX.
...
llvm-svn: 65313
2009-02-23 09:03:22 +00:00
Evan Cheng
4385f393f7
Be bug compatible with gcc by returning MMX values in RAX.
...
llvm-svn: 65274
2009-02-22 08:05:12 +00:00
Torok Edwin
b4c9a6097f
Implement -mno-sse: if SSE is disabled on x86-64, don't store XMM on stack for
...
var-args, and don't allow FP return values
llvm-svn: 63495
2009-02-01 18:15:56 +00:00
Dan Gohman
86b0a220af
Fix this comment to reflect that it applies to types other
...
than just i32.
llvm-svn: 60455
2008-12-03 01:39:44 +00:00
Dan Gohman
dcd4896f12
Fix byval arguments in the fastcc calling convention. The fastcc convention
...
delegates to the regular x86-32 convention which handles byval, but only
after it handles a few cases, and it's necessary to handle byval before
handling those cases. This fixes PR3122 (and rdar://6400815), llvm-gcc
miscompiling LLVM.
llvm-svn: 60453
2008-12-03 01:28:04 +00:00
Mon P Wang
76b86c996e
Allow XMM2 and XMM3 to be used for non ABI compliant code.
...
llvm-svn: 59720
2008-11-20 07:48:19 +00:00
Dale Johannesen
3f62c40108
Add "inreg" field to CallSDNode (doesn't increase
...
its size). Adjust various lowering functions to
pass this info through from CallInst. Use it to
implement sseregparm returns on X86. Remove
X86_ssecall calling convention.
llvm-svn: 56677
2008-09-26 19:31:26 +00:00
Dale Johannesen
62f64ab4c8
Accept 'inreg' attribute on x86 functions as
...
meaning sse_regparm (i.e. float/double values go
in XMM0 instead of ST0). Update documentation
to reflect reality.
llvm-svn: 56619
2008-09-25 20:47:45 +00:00
Arnold Schwaighofer
49f49e2086
Change the calling convention used when tail call optimization is enabled from CC_X86_32_TailCall to CC_X86_32_FastCC.
...
llvm-svn: 56436
2008-09-22 14:50:07 +00:00
Evan Cheng
10a350fa89
If SSE2 is available, x86 should pass first 3 f32/f64 arguments in XMM registers for fastcc calls.
...
llvm-svn: 55840
2008-09-05 17:24:07 +00:00
Evan Cheng
bd15e330d0
For whatever the reason, x86 CallingConv::Fast (i.e. fastcc) was not passing scalar arguments in registers. This patch defines a new fastcc CC which is slightly different from the FastCall CC. In addition to passing integer arguments in ECX and EDX, it also specify doubles are passed in 8-byte slots which are 8-byte aligned (instead of 4-byte aligned). This avoids a potential performance hazard where doubles span cacheline boundaries.
...
llvm-svn: 55807
2008-09-04 22:59:58 +00:00
Dale Johannesen
fdf8fe6c03
Add v2f32 (MMX) type to X86. Support is primitive:
...
load,store,call,return,bitcast. This is enough to
make call and return work.
llvm-svn: 52691
2008-06-24 22:01:44 +00:00
Anton Korobeynikov
54791c2a43
Fix FP return for Win64 ABI
...
llvm-svn: 50342
2008-04-28 07:40:07 +00:00
Anton Korobeynikov
0df1f3bc6c
Handle fp80 for win64
...
llvm-svn: 50324
2008-04-27 22:54:09 +00:00
Evan Cheng
39ae78cadb
MMX argument passing fixes:
...
On Darwin / Linux x86-32, v8i8, v4i16, v2i32 values are passed in MM[0-2].
On Darwin / Linux x86-32, v1i64 values are passed in memory.
On Darwin x86-64, v8i8, v4i16, v2i32 values are passed in XMM[0-7].
On Darwin x86-64, v1i64 values are passed in 64-bit GPRs.
llvm-svn: 50257
2008-04-25 07:56:45 +00:00
Dan Gohman
f4cd5a4801
Add XMM1 as a second return value register for f32 and f64 on x86-64. This
...
is needed for the x86-64-ABI handling of structs that contain floating-point
members that are returned by value.
llvm-svn: 49441
2008-04-09 17:54:37 +00:00
Dan Gohman
9f7c4f6e16
Add DX as a second return value register for i16 on x86.
...
llvm-svn: 49440
2008-04-09 17:53:38 +00:00
Anton Korobeynikov
d3330dfbf6
Add new CC lowering rule: provide a list of registers, which can be 'shadowed',
...
when some another register is used for argument passing.
Currently is used on Win64.
llvm-svn: 49079
2008-04-02 05:23:57 +00:00
Anton Korobeynikov
49574852c1
Minor typo fixes. Also add another FIXME.
...
llvm-svn: 48710
2008-03-23 20:32:06 +00:00
Anton Korobeynikov
dad919f561
Add convenient helper for win64 check. Simplify things slightly.
...
llvm-svn: 48691
2008-03-22 20:57:27 +00:00
Anton Korobeynikov
27c8ad4020
Initial support for Win64 calling conventions. Still in early state.
...
llvm-svn: 48690
2008-03-22 20:37:30 +00:00
Chris Lattner
260473f983
Enable support for returning two long-double values in ST(0)/ST(1).
...
This allows us to compile fp-stack-2results.ll into:
_test:
fldz
fld1
ret
which returns 1 in ST(0) and 0 in ST(1). This is needed for x86-64
_Complex long double.
llvm-svn: 48632
2008-03-21 05:57:20 +00:00
Dale Johannesen
23a6f7fc1f
MMX vectors are passed 4-byte aligned.
...
llvm-svn: 47483
2008-02-22 17:47:28 +00:00
Dale Johannesen
e8fa3130f8
Implement sseregparm.
...
llvm-svn: 46764
2008-02-05 20:46:33 +00:00
Evan Cheng
d436c2e724
SSE varargs arguments are passed in memory.
...
llvm-svn: 46262
2008-01-22 23:26:53 +00:00
Duncan Sands
5e1cbc1ad7
Need to handle any 'nest' parameter before integer
...
parameters, since otherwise it won't be passed in
the right register. With this change trampolines
work on x86-64 (thanks to Luke Guest for providing
access to an x86-64 box).
llvm-svn: 46192
2008-01-19 16:42:10 +00:00
Evan Cheng
d7403ac663
Rename CCIfStruct to CCIfByVal and CCStructAssign to CCPassByVal. Remove unused parameters of CCStructAssign and add size and alignment requirement info.
...
llvm-svn: 45997
2008-01-15 03:34:58 +00:00
Evan Cheng
4eb7ae04c5
Both x86-32 and x86-64 handle byval parameter attributes.
...
llvm-svn: 45996
2008-01-15 03:15:41 +00:00
Duncan Sands
fbbbb24641
Unbreak x86-32 darwin long double!
...
llvm-svn: 45703
2008-01-07 16:36:38 +00:00
Duncan Sands
93959fc16a
Fix long double support on x86-32 linux.
...
llvm-svn: 45701
2008-01-07 13:44:22 +00:00
Chris Lattner
ad9a6ccb83
Remove attribution from file headers, per discussion on llvmdev.
...
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Dale Johannesen
1e083ec1f6
x86-32 long doubles are 4-byte aligned on the stack
...
for parameter passing (only for that, on Darwin).
llvm-svn: 45038
2007-12-14 19:25:34 +00:00
Nate Begeman
4278967588
Support returning non-power-of-2 vectors to unblock some work
...
llvm-svn: 44371
2007-11-27 19:28:48 +00:00
Duncan Sands
e6821dd990
Eliminate the recently introduced CCAssignToStackABISizeAlign
...
in favour of teaching CCAssignToStack that size 0 and/or align
0 means to use the ABI values. This seems a neater solution.
It is safe since no legal value type has size 0.
llvm-svn: 44107
2007-11-14 08:29:13 +00:00
Dale Johannesen
2e9b020e89
Add CCAssignToStackABISizeAlign for convenience in
...
dealing with types whose size & alignment are
different on different subtargets. Use it for x86 f80.
llvm-svn: 43988
2007-11-10 22:07:15 +00:00
Duncan Sands
bf31a19c62
Clarify that fastcc has a problem with nested function
...
trampolines, rather than with nested functions themselves.
llvm-svn: 42955
2007-10-13 07:38:37 +00:00
Arnold Schwaighofer
6bcd9e7ec2
Corrected many typing errors. And removed 'nest' parameter handling
...
for fastcc from X86CallingConv.td. This means that nested functions
are not supported for calling convention 'fastcc'.
llvm-svn: 42934
2007-10-12 21:30:57 +00:00
Arnold Schwaighofer
d47210011e
Added tail call optimization to the x86 back end. It can be
...
enabled by passing -tailcallopt to llc. The optimization is
performed if the following conditions are satisfied:
* caller/callee are fastcc
* elf/pic is disabled OR
elf/pic enabled + callee is in module + callee has
visibility protected or hidden
llvm-svn: 42870
2007-10-11 19:40:01 +00:00
Dale Johannesen
04682bdc81
More long double fixes. x86_64 should build now.
...
llvm-svn: 42155
2007-09-19 23:55:34 +00:00
Dale Johannesen
3ea9879011
Get X86 long double calling convention to work
...
(on Darwin, anyway). Fix some table omissions for
LD arithmetic.
llvm-svn: 40877
2007-08-06 21:31:06 +00:00
Duncan Sands
35a77d857b
Trampoline codegen support for X86-32.
...
llvm-svn: 40566
2007-07-27 20:02:49 +00:00
Rafael Espindola
7b3de98989
Add the byval attribute
...
llvm-svn: 37940
2007-07-06 10:57:03 +00:00
Dan Gohman
eb46e6e629
Vector results may be returned in XMM0 and XMM1, not just XMM0. With
...
the recent lowering changes, this allows types like <4 x double> to
be returned, using two vector registers.
llvm-svn: 37844
2007-07-02 16:21:53 +00:00
Chris Lattner
e13fac05d7
If a function is vararg, never pass inreg arguments in registers. Thanks to
...
Anton for half of this patch.
llvm-svn: 37641
2007-06-19 00:13:10 +00:00
Bill Wendling
8f16f4bf9c
Fix comment.
...
llvm-svn: 35531
2007-03-31 09:36:12 +00:00
Bill Wendling
0cba5d3c15
Match GCC's MMX calling convention.
...
llvm-svn: 35523
2007-03-31 01:03:53 +00:00
Bill Wendling
503f3e41f6
Add MMX calling conventions.
...
llvm-svn: 35489
2007-03-30 00:35:22 +00:00