return floor;
}
-static inline double dml_log2(double x)
+/* float
+static inline int dml_log2(float x)
{
- return (double) dcn_bw_log(x, 2);
+ unsigned int ix = *((unsigned int *)&x);
+
+ return (int)((ix >> 23) & 0xff) - 127;
+}*/
+
+/* double */
+static inline int dml_log2(double x)
+{
+ unsigned long long ix = *((unsigned long long *)&x);
+
+ return (int)((ix >> 52) & 0x7ff) - 1023;
}
static inline double dml_pow(double a, int exp)
return (double) dcn_bw_floor2(x, granularity);
}
-static inline double dml_log(double x, double base)
-{
- return (double) dcn_bw_log(x, base);
-}
-
static inline unsigned int dml_round_to_multiple(unsigned int num,
unsigned int multiple,
unsigned char up)