Browse Source

Fix Bullet's btVector3.cpp compile error on 64-bit iOS platform.
See https://code.google.com/p/bullet/source/detail?r=2716

Yao Wei Tjong 姚伟忠 11 years ago
parent
commit
dae56f4d0c

+ 1 - 1
Source/Engine/CMakeLists.txt

@@ -105,7 +105,7 @@ endif ()
 if (APPLE)
     if (IOS)
         setup_ios_linker_flags (LINKER_FLAGS)
-        # Add a custom target to build Mach-O universal binary consisting of iphoneos (universal ARM archs) and iphonesimulator (i386 arch)
+        # Add a custom target to build Mach-O universal binary consisting of iphoneos (universal ARM archs including 'arm64' if 64-bit is enabled) and iphonesimulator (i386 arch and also x86_64 arch if 64-bit is enabled)
         add_custom_target (${TARGET_NAME}_universal
             COMMAND xcodebuild -target ${TARGET_NAME} -configuration $(CONFIGURATION) -sdk iphonesimulator
             COMMAND mv $<TARGET_FILE:${TARGET_NAME}>{,.iphonesimulator}

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

@@ -821,6 +821,7 @@ long _mindot_large( const float *vv, const float *vec, unsigned long count, floa
 
 
 #elif defined BT_USE_NEON
+
 #define ARM_NEON_GCC_COMPATIBILITY  1
 #include <arm_neon.h>
 #include <sys/types.h>
@@ -884,7 +885,12 @@ static long _mindot_large_sel( const float *vv, const float *vec, unsigned long
 
 
 
-#define vld1q_f32_aligned_postincrement( _ptr ) ({ float32x4_t _r; asm( "vld1.f32  {%0}, [%1, :128]!\n" : "=w" (_r), "+r" (_ptr) ); /*return*/ _r; })
+#if defined __arm__
+# define vld1q_f32_aligned_postincrement( _ptr ) ({ float32x4_t _r; asm( "vld1.f32 {%0}, [%1, :128]!\n" : "=w" (_r), "+r" (_ptr) ); /*return*/ _r; })
+#else
+//support 64bit arm
+# define vld1q_f32_aligned_postincrement( _ptr) ({ float32x4_t _r = ((float32x4_t*)(_ptr))[0]; (_ptr) = (const float*) ((const char*)(_ptr) + 16L); /*return*/ _r; })
+#endif
 
 
 long _maxdot_large_v0( const float *vv, const float *vec, unsigned long count, float *dotResult )