summaryrefslogtreecommitdiff
path: root/src/lj_obj.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_obj.h')
-rw-r--r--src/lj_obj.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lj_obj.h b/src/lj_obj.h
index 19a2345f..43f3d6ad 100644
--- a/src/lj_obj.h
+++ b/src/lj_obj.h
@@ -786,11 +786,19 @@ static LJ_AINLINE void copyTV(lua_State *L, TValue *o1, const TValue *o2)
786 786
787/* -- Number to integer conversion ---------------------------------------- */ 787/* -- Number to integer conversion ---------------------------------------- */
788 788
789#if !LJ_ARCH_HASFPU
790LJ_ASMF int32_t lj_vm_tobit(double x);
791#endif
792
789static LJ_AINLINE int32_t lj_num2bit(lua_Number n) 793static LJ_AINLINE int32_t lj_num2bit(lua_Number n)
790{ 794{
795#if LJ_ARCH_HASFPU
791 TValue o; 796 TValue o;
792 o.n = n + 6755399441055744.0; /* 2^52 + 2^51 */ 797 o.n = n + 6755399441055744.0; /* 2^52 + 2^51 */
793 return (int32_t)o.u32.lo; 798 return (int32_t)o.u32.lo;
799#else
800 return lj_vm_tobit(n);
801#endif
794} 802}
795 803
796#if LJ_TARGET_X86 && !defined(__SSE2__) 804#if LJ_TARGET_X86 && !defined(__SSE2__)