[Hdrflow-svn] SF.net SVN: hdrflow: [94] lib/openlibraries
Status: Pre-Alpha
Brought to you by:
glslang
|
From: <gl...@us...> - 2007-04-22 16:40:49
|
Revision: 94
http://hdrflow.svn.sourceforge.net/hdrflow/?rev=94&view=rev
Author: glslang
Date: 2007-04-22 09:40:46 -0700 (Sun, 22 Apr 2007)
Log Message:
-----------
+ enable fast math by default
Modified Paths:
--------------
lib/openlibraries/src/openpluginlib/pl/fast_math.cpp
lib/openlibraries/src/openpluginlib/pl/pl_vc8.vcproj
lib/openlibraries/test/openeffectslib/tm_bench/tm_bench_vc8.vcproj
Property Changed:
----------------
lib/openlibraries/m4/fast_math.m4
Property changes on: lib/openlibraries/m4/fast_math.m4
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: lib/openlibraries/src/openpluginlib/pl/fast_math.cpp
===================================================================
--- lib/openlibraries/src/openpluginlib/pl/fast_math.cpp 2007-04-22 15:47:45 UTC (rev 93)
+++ lib/openlibraries/src/openpluginlib/pl/fast_math.cpp 2007-04-22 16:40:46 UTC (rev 94)
@@ -5,6 +5,14 @@
// Released under the LGPL.
// For more information, see http://www.openlibraries.org.
+#ifdef HAVE_CONFIG_H
+#include <openlibraries_global_config.hpp>
+#endif
+
+#ifndef HAVE_FAST_MATH
+#include <cmath>
+#endif
+
#include <openpluginlib/pl/fast_math.hpp>
namespace olib { namespace openpluginlib {
@@ -15,9 +23,13 @@
int fast_floorf( float x )
{
+#if defined( HAVE_FAST_MATH ) && !defined( __ppc )
double y = ( x + 68719476736.0 * 1.5 );
-
+
return ( int ) ( ( *( ( long long* ) &y ) ) >> 16 );
+#else
+ return ( int ) std::floorf( x );
+#endif
}
float fast_log2f( float v )
@@ -25,18 +37,18 @@
float x = ( float ) *( int* ) &v;
x *= one_over_two_to_pow_23;
x = x - 127.0f;
-
+
float y = x - fast_floorf( x );
y = ( y - y * y ) * 0.346607f;
-
+
return x + y;
}
-
+
float fast_exp2f( float v )
{
float y = v - fast_floorf( v );
y = ( y - y * y ) * 0.33971f;
-
+
float x = v + 127.0f - y;
x *= two_to_pow_23;
*( int* ) &x = ( int ) x;
@@ -46,7 +58,11 @@
float fast_powf( float x, float y )
{
+#if defined( HAVE_FAST_MATH )
return fast_exp2f( y * fast_log2f( x ) );
+#else
+ return std::powf( x, y );
+#endif
}
} }
Modified: lib/openlibraries/src/openpluginlib/pl/pl_vc8.vcproj
===================================================================
--- lib/openlibraries/src/openpluginlib/pl/pl_vc8.vcproj 2007-04-22 15:47:45 UTC (rev 93)
+++ lib/openlibraries/src/openpluginlib/pl/pl_vc8.vcproj 2007-04-22 16:40:46 UTC (rev 94)
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""$(SolutionDir)\src";"C:\Boost\include\boost-1_33_1";"C:\Program Files\NVIDIA Corporation\Cg\include""
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OPENPLUGINLIB_EXPORTS;OPENPLUGINLIB_BUILD;HAVE_FLEX_STRING;HAVE_CG_RUNTIME;HAVE_BOOST_FILESYSTEM"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OPENPLUGINLIB_EXPORTS;OPENPLUGINLIB_BUILD;HAVE_FLEX_STRING;HAVE_CG_RUNTIME;HAVE_BOOST_FILESYSTEM;HAVE_FAST_MATH"
MinimalRebuild="true"
ExceptionHandling="2"
BasicRuntimeChecks="3"
@@ -128,7 +128,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""$(SolutionDir)\src";"C:\Boost\include\boost-1_33_1";"C:\Program Files\NVIDIA Corporation\Cg\include""
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OPENPLUGINLIB_EXPORTS;OPENPLUGINLIB_BUILD;HAVE_FLEX_STRING;HAVE_CG_RUNTIME;HAVE_BOOST_FILESYSTEM"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OPENPLUGINLIB_EXPORTS;OPENPLUGINLIB_BUILD;HAVE_FLEX_STRING;HAVE_CG_RUNTIME;HAVE_BOOST_FILESYSTEM;HAVE_FAST_MATH"
ExceptionHandling="2"
RuntimeLibrary="2"
BufferSecurityCheck="false"
@@ -373,11 +373,11 @@
>
</File>
<File
- RelativePath=".\pcos\property.hpp"
+ RelativePath=".\property.hpp"
>
</File>
<File
- RelativePath=".\property.hpp"
+ RelativePath=".\pcos\property.hpp"
>
</File>
<File
Modified: lib/openlibraries/test/openeffectslib/tm_bench/tm_bench_vc8.vcproj
===================================================================
--- lib/openlibraries/test/openeffectslib/tm_bench/tm_bench_vc8.vcproj 2007-04-22 15:47:45 UTC (rev 93)
+++ lib/openlibraries/test/openeffectslib/tm_bench/tm_bench_vc8.vcproj 2007-04-22 16:40:46 UTC (rev 94)
@@ -202,10 +202,6 @@
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
- <File
- RelativePath=".\VTune\tm_bench.vpj"
- >
- </File>
</Files>
<Globals>
</Globals>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|