Prechádzať zdrojové kódy

Ensure SIMD code path is being used when BT_USE_SSE is on.
Related to ommit dabfcff14ee597941fd66c9cb8cd9544b4511049.

Yao Wei Tjong 姚伟忠 10 rokov pred
rodič
commit
deaa23a140

+ 3 - 2
Source/ThirdParty/Bullet/src/BulletCollision/Gimpact/gim_memory.h

@@ -32,6 +32,7 @@ email: [email protected]
 -----------------------------------------------------------------------------
 -----------------------------------------------------------------------------
 */
 */
 
 
+// Modified by Yao Wei Tjong for Urho3D
 
 
 #include "gim_math.h"
 #include "gim_math.h"
 #include <string.h>
 #include <string.h>
@@ -116,8 +117,8 @@ void * gim_realloc(void *ptr, size_t oldsize, size_t newsize);
 void gim_free(void *ptr);
 void gim_free(void *ptr);
 
 
 
 
-
-#if defined (_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__)
+// Urho3D - allow to disable SIMD, allow MinGW to use SIMD
+#if defined(URHO3D_SSE) && defined(_WIN32) && !defined(__CYGWIN__)
     #define GIM_SIMD_MEMORY 1
     #define GIM_SIMD_MEMORY 1
 #endif
 #endif
 
 

+ 1 - 1
Source/ThirdParty/Bullet/src/LinearMath/btVector3.cpp

@@ -42,7 +42,7 @@ typedef  float float4 __attribute__ ((vector_size(16)));
 //typedef  uint32_t uint4 __attribute__ ((vector_size(16)));
 //typedef  uint32_t uint4 __attribute__ ((vector_size(16)));
 
 
 
 
-#if defined BT_USE_SSE || defined _WIN32
+#if defined BT_USE_SSE //|| defined _WIN32      // Urho3D - just use BT_USE_SSE as the main switch, Urho3D allow SSE to be disabled
 
 
 #define LOG2_ARRAY_SIZE     6
 #define LOG2_ARRAY_SIZE     6
 #define STACK_ARRAY_COUNT   (1UL << LOG2_ARRAY_SIZE)
 #define STACK_ARRAY_COUNT   (1UL << LOG2_ARRAY_SIZE)

+ 3 - 3
Source/ThirdParty/Bullet/src/LinearMath/btVector3.h

@@ -12,7 +12,7 @@ subject to the following restrictions:
 3. This notice may not be removed or altered from any source distribution.
 3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-
+// Modified by Yao Wei Tjong for Urho3D
 
 
 #ifndef BT_VECTOR3_H
 #ifndef BT_VECTOR3_H
 #define BT_VECTOR3_H
 #define BT_VECTOR3_H
@@ -1001,10 +1001,10 @@ SIMD_FORCE_INLINE btVector3 btVector3::rotate( const btVector3& wAxis, const btS
 SIMD_FORCE_INLINE   long    btVector3::maxDot( const btVector3 *array, long array_count, btScalar &dotOut ) const
 SIMD_FORCE_INLINE   long    btVector3::maxDot( const btVector3 *array, long array_count, btScalar &dotOut ) const
 {
 {
 #if (defined BT_USE_SSE && defined BT_USE_SIMD_VECTOR3 && defined BT_USE_SSE_IN_API) || defined (BT_USE_NEON)
 #if (defined BT_USE_SSE && defined BT_USE_SIMD_VECTOR3 && defined BT_USE_SSE_IN_API) || defined (BT_USE_NEON)
-    #if defined _WIN32 || defined (BT_USE_SSE)
+    #ifdef BT_USE_SSE	// Urho3D - to be consistent with the function return below
         const long scalar_cutoff = 10;
         const long scalar_cutoff = 10;
         long _maxdot_large( const float *array, const float *vec, unsigned long array_count, float *dotOut );
         long _maxdot_large( const float *array, const float *vec, unsigned long array_count, float *dotOut );
-    #elif defined BT_USE_NEON
+    #elif BT_USE_NEON
         const long scalar_cutoff = 4;
         const long scalar_cutoff = 4;
         extern long (*_maxdot_large)( const float *array, const float *vec, unsigned long array_count, float *dotOut );
         extern long (*_maxdot_large)( const float *array, const float *vec, unsigned long array_count, float *dotOut );
     #endif
     #endif