diff options
author | Mike Pall <mike> | 2014-12-08 01:58:05 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2014-12-08 01:58:05 +0100 |
commit | e03df1e3395bc719d43bd9196d0290757f992b2f (patch) | |
tree | 98a2a827c4b83900e7b330d82c5d369caf642db4 /src/lj_vmmath.c | |
parent | f49c61a2776ae9abeb2297dbc3b53ea2962ad750 (diff) | |
download | luajit-e03df1e3395bc719d43bd9196d0290757f992b2f.tar.gz luajit-e03df1e3395bc719d43bd9196d0290757f992b2f.tar.bz2 luajit-e03df1e3395bc719d43bd9196d0290757f992b2f.zip |
x86/x64: Call external symbols directly from interpreter code.
Except for ELF/x86 PIC, where it's easier to use wrappers.
Diffstat (limited to 'src/lj_vmmath.c')
-rw-r--r-- | src/lj_vmmath.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lj_vmmath.c b/src/lj_vmmath.c index 63886aa7..b60858b2 100644 --- a/src/lj_vmmath.c +++ b/src/lj_vmmath.c | |||
@@ -13,15 +13,17 @@ | |||
13 | #include "lj_ir.h" | 13 | #include "lj_ir.h" |
14 | #include "lj_vm.h" | 14 | #include "lj_vm.h" |
15 | 15 | ||
16 | /* -- Helper functions for generated machine code ------------------------- */ | 16 | /* -- Wrapper functions --------------------------------------------------- */ |
17 | 17 | ||
18 | #if LJ_TARGET_X86ORX64 | 18 | #if LJ_TARGET_X86 && __ELF__ && __PIC__ |
19 | /* Wrapper functions to avoid linker issues on OSX. */ | 19 | /* Wrapper functions to deal with the ELF/x86 PIC disaster. */ |
20 | LJ_FUNCA double lj_vm_sinh(double x) { return sinh(x); } | 20 | LJ_FUNCA double lj_wrap_sinh(double x) { return sinh(x); } |
21 | LJ_FUNCA double lj_vm_cosh(double x) { return cosh(x); } | 21 | LJ_FUNCA double lj_wrap_cosh(double x) { return cosh(x); } |
22 | LJ_FUNCA double lj_vm_tanh(double x) { return tanh(x); } | 22 | LJ_FUNCA double lj_wrap_tanh(double x) { return tanh(x); } |
23 | #endif | 23 | #endif |
24 | 24 | ||
25 | /* -- Helper functions for generated machine code ------------------------- */ | ||
26 | |||
25 | #if !LJ_TARGET_X86ORX64 | 27 | #if !LJ_TARGET_X86ORX64 |
26 | double lj_vm_foldarith(double x, double y, int op) | 28 | double lj_vm_foldarith(double x, double y, int op) |
27 | { | 29 | { |