project_files/hwc/rtl/pmath.h
author koda
Wed, 07 Nov 2012 18:04:27 +0000
branchwebgl
changeset 7983 02f36c3e7f6c
child 8047 25a4daa6473c
permissions -rw-r--r--
add xymeng's rtl port
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7983
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
     1
#ifndef PMATH_H_
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
     2
#define PMATH_H_
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
     3
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
     4
#include <stdint.h>
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
     5
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
     6
#define     fpcrtl_min(a, b)                ((a) < (b) ? (a) : (b))
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
     7
#define     fpcrtl_max(a, b)                ((a) > (b) ? (a) : (b))
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
     8
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
     9
float       fpcrtl_power(float base, float exponent);
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
    10
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
    11
/* Currently the games only uses sign of an integer */
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
    12
int         fpcrtl_signi(int x);
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
    13
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
    14
float       fpcrtl_csc(float x);
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
    15
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
    16
#define     fpcrtl_arctan2(y, x)            atan2(y, x)
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
    17
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
    18
float       __attribute__((overloadable))   fpcrtl_abs(float x);
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
    19
double      __attribute__((overloadable))   fpcrtl_abs(double x);
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
    20
int         __attribute__((overloadable))   fpcrtl_abs(int x);
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
    21
int64_t     __attribute__((overloadable))   fpcrtl_abs(int64_t x);
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
    22
02f36c3e7f6c add xymeng's rtl port
koda
parents:
diff changeset
    23
#endif /* PMATH_H_ */