haiku/headers/private/graphics/radeon/utils.h
Jérôme Duval 93ca791b70 * added math.h missing prototypes like log2f. This fixes #6802.
* whitespace cleanup and renamed log2() to radeon_log2 (conflicts with log2 in math.h)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39620 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-24 23:42:17 +00:00

49 lines
703 B
C

/*
Copyright (c) 2002/03, Thomas Kurschel
Part of Radeon accelerant
Utility functions
*/
#ifndef _UTILS_H
#define _UTILS_H
#ifdef __cplusplus
extern "C" {
#endif
extern int radeon_log2( uint32 x );
static inline int RoundDiv( int num, int den )
{
return (num + (den / 2)) / den;
}
static inline int32 RoundDiv64( int64 num, int32 den )
{
return (num + (den / 2)) / den;
}
static inline int ceilShiftDiv( int num, int shift )
{
return (num + (1 << shift) - 1) >> shift;
}
static inline int ceilDiv( int num, int den )
{
return (num + den - 1) / den;
}
// macros for fixed-point calculation
#define FIX_SHIFT 32
#define FIX_SCALE (1LL << FIX_SHIFT)
#ifdef __cplusplus
}
#endif
#endif