ARM: Add fast assembler implementation of floor/ceil/trunc.
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "lj_obj.h"
|
||||
#include "lj_lib.h"
|
||||
#include "lj_vm.h"
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
@@ -162,7 +163,7 @@ LJLIB_CF(math_random) LJLIB_REC(.)
|
||||
double r1 = lj_lib_checknum(L, 1);
|
||||
#endif
|
||||
if (n == 1) {
|
||||
d = floor(d*r1) + 1.0; /* d is an int in range [1, r1] */
|
||||
d = lj_vm_floor(d*r1) + 1.0; /* d is an int in range [1, r1] */
|
||||
} else {
|
||||
#if LJ_DUALNUM
|
||||
double r2;
|
||||
@@ -176,7 +177,7 @@ LJLIB_CF(math_random) LJLIB_REC(.)
|
||||
#else
|
||||
double r2 = lj_lib_checknum(L, 2);
|
||||
#endif
|
||||
d = floor(d*(r2-r1+1.0)) + r1; /* d is an int in range [r1, r2] */
|
||||
d = lj_vm_floor(d*(r2-r1+1.0)) + r1; /* d is an int in range [r1, r2] */
|
||||
}
|
||||
#if LJ_DUALNUM
|
||||
if (isint) {
|
||||
|
||||
Reference in New Issue
Block a user