Elena Demikhovsky
fc4840fbed
Intel OCL built-ins calling conventions now support MacOS 32-bit.
...
llvm-svn: 168359
2012-11-20 09:37:57 +00:00
Duncan Sands
d71b4e4568
Add the Erlang/HiPE calling convention, patch by Yiannis Tsiouris.
...
llvm-svn: 168166
2012-11-16 12:36:39 +00:00
Elena Demikhovsky
d6afb03bc9
Special calling conventions for Intel OpenCL built-in library.
...
llvm-svn: 166566
2012-10-24 14:46:16 +00:00
Rafael Espindola
4e6e537314
Change x86_fastcallcc to require inreg markers. This allows it to known
...
the difference from "int x" (which should go in registers and
"struct y {int x;}" (which should not).
Clang will be updated in the next patches.
llvm-svn: 166536
2012-10-24 01:58:48 +00:00
Chris Lattner
1622a99e58
it's pointed out that R11 can be used for magic things, and doing things just for 64-bit registers is silly. Just optimize 3 more.
...
llvm-svn: 157699
2012-05-30 18:08:02 +00:00
Chris Lattner
04d722a68d
Extend the (abi-irrelevant) return convention to be able to return more than two values in
...
integer registers. This is already supported by the fastcc convention, but it doesn't
hurt to support it in the standard conventions as well.
In cases where we can cheat at the calling convention, this allows us to avoid returning
things through memory in more cases.
llvm-svn: 157698
2012-05-30 17:50:14 +00:00
Jakob Stoklund Olesen
276ae14023
s/CSR_Ghc/CSR_NoRegs/
...
Share the CalleeSavedRegs defs between all calling conventions having no
callee-saved registers.
Patch by Yiannis Tsiouris!
llvm-svn: 156382
2012-05-08 15:07:29 +00:00
Aaron Ballman
e67173e718
Adding support for Microsoft's thiscall calling convention. LLVM side of the patch.
...
llvm-svn: 151123
2012-02-22 03:04:40 +00:00
Jia Liu
b22310fda6
Emacs-tag and some comment fix for all ARM, CellSPU, Hexagon, MBlaze, MSP430, PPC, PTX, Sparc, X86, XCore.
...
llvm-svn: 150878
2012-02-18 12:03:15 +00:00
Elena Demikhovsky
824eed70a6
Passing AVX 256-bit structures in Win64 was wrong.
...
Fixed Win64 calling conventions.
llvm-svn: 149494
2012-02-01 10:46:14 +00:00
Jakob Stoklund Olesen
d51a710bde
Move X86 callee saved register lists to the X86CallConv .td file.
...
Add a trivial implementation of the getCallPreservedMask() hook.
llvm-svn: 148347
2012-01-17 22:47:01 +00:00
Craig Topper
b0c0f72ae6
Remove hasXMM/hasXMMInt functions. Move callers to hasSSE1/hasSSE2. This is the final piece to remove the AVX hack that disabled SSE.
...
llvm-svn: 147843
2012-01-10 06:54:16 +00:00
Eli Friedman
d61887dd0a
Pass AVX vectors which are arguments to varargs functions on the stack. <rdar://problem/10463281>.
...
llvm-svn: 145573
2011-12-01 04:49:21 +00:00
Eli Friedman
d24a7da658
Calling-convention specifications for illegal types are no-ops. Simplify based on this.
...
llvm-svn: 134264
2011-07-01 21:33:28 +00:00
Tilmann Scheller
3bc0bcf3ad
Use X86_thiscall calling convention for Win64 as well.
...
llvm-svn: 126934
2011-03-03 07:49:07 +00:00
Tilmann Scheller
a3769f8021
Add Win64 thiscall calling convention.
...
llvm-svn: 126862
2011-03-02 19:29:22 +00:00
Nate Begeman
8b08f5232b
Formalize the notion that AVX and SSE are non-overlapping extensions from the compiler's point of view. Per email discussion, we either want to always use VEX-prefixed instructions or never use them, and are taking "HasAVX" to mean "Always use VEX". Passing -mattr=-avx,+sse42 should serve to restore legacy SSE support when desirable.
...
llvm-svn: 121439
2010-12-10 00:26:57 +00:00
Duncan Sands
fb0a48ef96
Factorize the duplicated logic for choosing the right argument
...
calling convention out of the fast and normal ISel files, and
into the calling convention TD file.
llvm-svn: 117856
2010-10-31 13:21:44 +00:00
Dale Johannesen
dd224d2333
Massive rewrite of MMX:
...
The x86_mmx type is used for MMX intrinsics, parameters and
return values where these use MMX registers, and is also
supported in load, store, and bitcast.
Only the above operations generate MMX instructions, and optimizations
do not operate on or produce MMX intrinsics.
MMX-sized vectors <2 x i32> etc. are lowered to XMM or split into
smaller pieces. Optimizations may occur on these forms and the
result casted back to x86_mmx, provided the result feeds into a
previous existing x86_mmx operation.
The point of all this is prevent optimizations from introducing
MMX operations, which is unsafe due to the EMMS problem.
llvm-svn: 115243
2010-09-30 23:57:10 +00:00
Bruno Cardoso Lopes
77954bdf7a
Support very basic (doesn't include ABI support in the front-end, varags, ...) 256-bit argument passing and return for AVX
...
llvm-svn: 110394
2010-08-05 23:35:51 +00:00
Chris Lattner
feb2467bf4
rip out the various v2f32 "mmx" handling logic, now that
...
v2f32 is illegal on x86.
llvm-svn: 107609
2010-07-05 04:36:27 +00:00
Anton Korobeynikov
8f35fabbc1
Add support for thiscall calling convention.
...
Patch by Charles Davis and Steven Watanabe!
llvm-svn: 103902
2010-05-16 09:08:45 +00:00
Chris Lattner
a179e4d0a8
add support, testcases, and dox for the new GHC calling
...
convention. Patch by David Terei!
llvm-svn: 98212
2010-03-11 00:22:57 +00:00
Kenneth Uildriks
792f0913ee
For fastcc on x86, let ECX be used as a return register after EAX and EDX
...
llvm-svn: 91410
2009-12-15 03:27:52 +00:00
Anton Korobeynikov
442beabbf7
Add 'Indirect' LocInfo class and use to pass __m128 on win64. Also minore fixes here and there (mostly __m64).
...
llvm-svn: 77964
2009-08-03 08:13:56 +00:00
Anton Korobeynikov
72bc3846bc
Cleanup Darwin MMX calling conv stuff - make the stuff more generic. This also fixes a subtle bug, when 6th v1i64 argument passed wrongly.
...
llvm-svn: 77963
2009-08-03 08:13:24 +00:00
Anton Korobeynikov
71386e08fe
Unbreak Win64 CC. Step one: honour register save area, fix some alignment and provide a different set of call-clobberred registers.
...
llvm-svn: 77962
2009-08-03 08:12:53 +00:00
Arnold Schwaighofer
e3a018d707
Fix Bug 4278: X86-64 with -tailcallopt calling convention
...
out of sync with regular cc.
The only difference between the tail call cc and the normal
cc was that one parameter register - R9 - was reserved for
calling functions through a function pointer. After time the
tail call cc has gotten out of sync with the regular cc.
We can use R11 which is also caller saved but not used as
parameter register for potential function pointers and
remove the special tail call cc on x86-64.
llvm-svn: 73233
2009-06-12 16:26:57 +00:00
Dan Gohman
efd2d44aa5
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
772de0ae2d
Fix a grammaro in a comment that Bill noticed.
...
llvm-svn: 67507
2009-03-23 05:02:44 +00:00
Dan Gohman
70d9929def
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
9f8fddeed8
Only v1i16 (i.e. _m64) is returned via RAX / RDX.
...
llvm-svn: 65313
2009-02-23 09:03:22 +00:00
Evan Cheng
e4ffc030e2
Be bug compatible with gcc by returning MMX values in RAX.
...
llvm-svn: 65274
2009-02-22 08:05:12 +00:00
Torok Edwin
a2d1f35e9a
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
0c8df671ac
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
5d3d1f69e1
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
e15a540071
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
0e32a2c935
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
c50ada2f56
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
796a271c5f
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
4f0d21592a
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
6c94b99c62
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
e5f4ffbdf1
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
fac70f2f44
Fix FP return for Win64 ABI
...
llvm-svn: 50342
2008-04-28 07:40:07 +00:00
Anton Korobeynikov
b5096e9c73
Handle fp80 for win64
...
llvm-svn: 50324
2008-04-27 22:54:09 +00:00
Evan Cheng
df38b35a1e
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
3d074a3125
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
cbf87313a2
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
20c9e4cbee
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
1fdd5e9133
Minor typo fixes. Also add another FIXME.
...
llvm-svn: 48710
2008-03-23 20:32:06 +00:00
Anton Korobeynikov
7f125b2ba5
Add convenient helper for win64 check. Simplify things slightly.
...
llvm-svn: 48691
2008-03-22 20:57:27 +00:00
Anton Korobeynikov
7b4f4e1a86
Initial support for Win64 calling conventions. Still in early state.
...
llvm-svn: 48690
2008-03-22 20:37:30 +00:00
Chris Lattner
b6f04a3e0a
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
eac159c1f0
MMX vectors are passed 4-byte aligned.
...
llvm-svn: 47483
2008-02-22 17:47:28 +00:00
Dale Johannesen
d88f1d060e
Implement sseregparm.
...
llvm-svn: 46764
2008-02-05 20:46:33 +00:00
Evan Cheng
1e0d4d2aa8
SSE varargs arguments are passed in memory.
...
llvm-svn: 46262
2008-01-22 23:26:53 +00:00
Duncan Sands
3e95d963e9
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
4d70ba3134
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
48bdfe63e2
Both x86-32 and x86-64 handle byval parameter attributes.
...
llvm-svn: 45996
2008-01-15 03:15:41 +00:00
Duncan Sands
d8d4170f84
Unbreak x86-32 darwin long double!
...
llvm-svn: 45703
2008-01-07 16:36:38 +00:00
Duncan Sands
28bf7ac219
Fix long double support on x86-32 linux.
...
llvm-svn: 45701
2008-01-07 13:44:22 +00:00
Chris Lattner
f3ebc3f3d2
Remove attribution from file headers, per discussion on llvmdev.
...
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Dale Johannesen
f7cefdd5f0
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
6f026a654c
Support returning non-power-of-2 vectors to unblock some work
...
llvm-svn: 44371
2007-11-27 19:28:48 +00:00
Duncan Sands
e2287ed552
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
b988e7e8cd
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
29af26f147
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
1f0da1fefb
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
9ccea99165
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
7d67e547b5
More long double fixes. x86_64 should build now.
...
llvm-svn: 42155
2007-09-19 23:55:34 +00:00
Dale Johannesen
75169a82d6
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
ce38853cc6
Trampoline codegen support for X86-32.
...
llvm-svn: 40566
2007-07-27 20:02:49 +00:00
Rafael Espindola
b567e3ffb0
Add the byval attribute
...
llvm-svn: 37940
2007-07-06 10:57:03 +00:00
Dan Gohman
f9ae1c6001
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
944200be45
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
b72fcddd23
Fix comment.
...
llvm-svn: 35531
2007-03-31 09:36:12 +00:00
Bill Wendling
afddb2c6f8
Match GCC's MMX calling convention.
...
llvm-svn: 35523
2007-03-31 01:03:53 +00:00
Bill Wendling
2fbcbc16b4
Add MMX calling conventions.
...
llvm-svn: 35489
2007-03-30 00:35:22 +00:00
Chris Lattner
eb09e28ccc
bugfix: fastcall does not require the first two params to be marked 'inreg',
...
they always get registers.
llvm-svn: 34748
2007-02-28 18:35:11 +00:00
Chris Lattner
0bc74fd6cc
add new CC_X86_32_FastCall calling conv, which describes fastcall on win32.
...
Factor out a CC_X86_32_Common convention, which is the part shared between
ccc, stdcall and fastcall
llvm-svn: 34732
2007-02-28 06:20:01 +00:00
Chris Lattner
be7995953a
switch LowerCCCCallTo over to using an autogenerated callingconv
...
llvm-svn: 34727
2007-02-28 05:31:48 +00:00
Chris Lattner
0c0a7b288e
rename stuff
...
llvm-svn: 34726
2007-02-28 05:30:29 +00:00
Chris Lattner
659ca56383
make subtarget references work.
...
llvm-svn: 34721
2007-02-28 04:51:41 +00:00
Chris Lattner
fa9227ed54
Add calling convention info
...
llvm-svn: 34661
2007-02-27 06:59:52 +00:00
Chris Lattner
db2049fb8e
move target independent calling convention stuff to TargetCallingConv.td
...
llvm-svn: 34659
2007-02-27 05:57:32 +00:00
Chris Lattner
4c83b98604
fill in some holes
...
llvm-svn: 34658
2007-02-27 05:51:05 +00:00
Chris Lattner
77f0a1553c
fix attribution
...
llvm-svn: 34637
2007-02-26 18:56:07 +00:00
Chris Lattner
5d00a0b8a9
Add a description of the X86-64 calling convention and the return
...
conventions. This doesn't do anything yet, but may in the future.
llvm-svn: 34636
2007-02-26 18:17:14 +00:00