This commit is contained in:
iabdalkader 2014-09-09 15:02:34 +02:00
parent 2f5b82ec77
commit 06c8f77662
2 changed files with 13 additions and 1 deletions

View File

@ -31,6 +31,17 @@ int ALWAYS_INLINE fast_floorf(float x)
return i;
}
int ALWAYS_INLINE fast_ceilf(float x)
{
int i;
x += 0.9999f;
asm volatile (
"vcvt.S32.f32 %[r], %[x]\n"
: [r] "=t" (i)
: [x] "t" (x));
return i;
}
int ALWAYS_INLINE fast_roundf(float x)
{
int i;

View File

@ -2,7 +2,8 @@
#define __FMATH_H__
#include <stdint.h>
float fast_sqrtf(float x);
int fast_floor(float x);
int fast_floorf(float x);
int fast_ceilf(float x);
int fast_roundf(float x);
float fast_atanf(float x);
float fast_atan2f(float x, float y);