diff options
author | Ben Murdoch <benm@google.com> | 2014-04-10 11:48:40 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2014-04-10 11:48:40 +0100 |
commit | c7fd8ad396558ae2fc23840b0583408c0a6a63d1 (patch) | |
tree | 3deb1b1e57e764a7d47666f3fd92b684b91f61d2 | |
parent | 362f1418ec8cb8388c69df01e099c4e320b78691 (diff) | |
parent | ea82f8995efee1140d2a096b10786f547327bb3c (diff) | |
download | src-c7fd8ad396558ae2fc23840b0583408c0a6a63d1.tar.gz |
Merge from Chromium at DEPS revision 262940
This commit was generated by merge_to_master.py.
Change-Id: I8895603818f261bf1b301f727708e144bec345d3
-rw-r--r-- | src/gallium/auxiliary/util/u_math.h | 59 |
1 files changed, 17 insertions, 42 deletions
diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h index 05bb9e2..2383f94 100644 --- a/src/gallium/auxiliary/util/u_math.h +++ b/src/gallium/auxiliary/util/u_math.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -10,11 +10,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. @@ -22,7 +22,7 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ @@ -61,46 +61,46 @@ extern "C" { #endif -#if defined(_MSC_VER) +#if defined(_MSC_VER) #if _MSC_VER < 1400 && !defined(__cplusplus) - -static INLINE float cosf( float f ) + +static INLINE float cosf( float f ) { return (float) cos( (double) f ); } -static INLINE float sinf( float f ) +static INLINE float sinf( float f ) { return (float) sin( (double) f ); } -static INLINE float ceilf( float f ) +static INLINE float ceilf( float f ) { return (float) ceil( (double) f ); } -static INLINE float floorf( float f ) +static INLINE float floorf( float f ) { return (float) floor( (double) f ); } -static INLINE float powf( float f, float g ) +static INLINE float powf( float f, float g ) { return (float) pow( (double) f, (double) g ); } -static INLINE float sqrtf( float f ) +static INLINE float sqrtf( float f ) { return (float) sqrt( (double) f ); } -static INLINE float fabsf( float f ) +static INLINE float fabsf( float f ) { return (float) fabs( (double) f ); } -static INLINE float logf( float f ) +static INLINE float logf( float f ) { return (float) log( (double) f ); } @@ -140,31 +140,6 @@ roundf(float x) #endif /* _MSC_VER */ - -#ifdef PIPE_OS_ANDROID - -static INLINE -double log2(double d) -{ - return log(d) * (1.0 / M_LN2); -} - -/* workaround a conflict with main/imports.h */ -#ifdef log2f -#undef log2f -#endif - -static INLINE -float log2f(float f) -{ - return logf(f) * (float) (1.0 / M_LN2); -} - -#endif - - - - #define POW2_TABLE_SIZE_LOG2 9 #define POW2_TABLE_SIZE (1 << POW2_TABLE_SIZE_LOG2) #define POW2_TABLE_OFFSET (POW2_TABLE_SIZE/2) @@ -305,7 +280,7 @@ util_ifloor(float f) static INLINE int util_iround(float f) { -#if defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86) +#if defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86) int r; __asm__ ("fistpl %0" : "=m" (r) : "t" (f) : "st"); return r; @@ -502,7 +477,7 @@ static INLINE unsigned util_last_bit(unsigned u) * int i = u_bit_scan(&mymask); * ... process element i * } - * + * */ static INLINE int u_bit_scan(unsigned *mask) { |