diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-02-03 17:06:27 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-02-03 17:06:27 -0500 |
commit | 651d2cbf3258cd4b38b42cfe9e282a8b67073bfb (patch) | |
tree | be1cd7760a9379206ec2308e3106beadf7c4f58a /lib/Target/JSBackend | |
parent | a556d1e8e5a55b9b2ac6d24bad4f01099c08c8c9 (diff) |
do not emit ffi casts on Math_* builtins
Diffstat (limited to 'lib/Target/JSBackend')
-rw-r--r-- | lib/Target/JSBackend/CallHandlers.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/JSBackend/CallHandlers.h b/lib/Target/JSBackend/CallHandlers.h index d2f8231dca..a37d11a34a 100644 --- a/lib/Target/JSBackend/CallHandlers.h +++ b/lib/Target/JSBackend/CallHandlers.h @@ -98,7 +98,8 @@ DEF_CALL_HANDLER(__default__, { getAssign(getJSName(CI), InstRT); // ensure the variable is defined, but do not emit it here // it should have 0 uses, but just to be safe } else if (!ActualRT->isVoidTy()) { - unsigned FFI = NeedCasts ? ASM_FFI : 0; + // this is an ffi call if we need casts, and it is not a Math_ builtin + unsigned FFI = NeedCasts && text.find("Math_") != 0 ? ASM_FFI : 0; text = getAssign(getJSName(CI), ActualRT) + getCast(text, ActualRT, ASM_NONSPECIFIC | FFI); } return text; |