mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-28 00:40:54 +00:00
apparently tailcalls are better on darwin/x86-64 than on linux?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119947 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
dd061b2854
commit
8bc1e45295
@ -895,6 +895,24 @@ compare:
|
|||||||
|
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
Linux is missing some basic tail call support:
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
double foo(double a) { return sin(a); }
|
||||||
|
|
||||||
|
This compiles into this on x86-64 Linux (but not darwin):
|
||||||
|
foo:
|
||||||
|
subq $8, %rsp
|
||||||
|
call sin
|
||||||
|
addq $8, %rsp
|
||||||
|
ret
|
||||||
|
vs:
|
||||||
|
|
||||||
|
foo:
|
||||||
|
jmp sin
|
||||||
|
|
||||||
|
//===---------------------------------------------------------------------===//
|
||||||
|
|
||||||
Tail call optimization improvements: Tail call optimization currently
|
Tail call optimization improvements: Tail call optimization currently
|
||||||
pushes all arguments on the top of the stack (their normal place for
|
pushes all arguments on the top of the stack (their normal place for
|
||||||
non-tail call optimized calls) that source from the callers arguments
|
non-tail call optimized calls) that source from the callers arguments
|
||||||
|
Loading…
x
Reference in New Issue
Block a user