erincatto / box2d

Box2D is a 2D physics engine for games
https://box2d.org
MIT License
8.36k stars 1.55k forks source link

fix armeabi-v7a #814

Closed bostick closed 1 month ago

bostick commented 2 months ago

Fix https://github.com/erincatto/box2d/issues/813

Emulate vzip1q_f32 for 32-bit

erincatto commented 1 month ago

Thanks for this fix! Are you able to do any performance comparisons versus SIMD disabled on this platform? Just curious.

bostick commented 1 month ago

I have a 32-bit arm7 device I can test on. What comparisons would be good to do?

erincatto commented 1 month ago

If you can run the benchmark app that would be great.

https://github.com/erincatto/box2d/blob/2dbb6818cb5e69bd3dcd20b7190cdba3844dd4e8/CMakeLists.txt#L72

bostick commented 1 month ago

OK, I will setup a simple Android app for running the benchmark.

bostick commented 1 month ago

OK @erincatto , I put up a repo with the results of running the benchmark: https://github.com/bostick/Box2DAndroidBenchmark

I have not interpreted the results. Let me know if you'd like anything else

erincatto commented 1 month ago

image

It seems SIMD optimizations are not helping on this CPU. I've heard 32-bit Neon is not very good. I see good results on 64-bit Neon though. This CPU is also quite slow in general. But it does make sense to use around 4 threads on this.

Thanks a lot for running these tests!

erincatto commented 1 month ago

Fixed the formatting. You can see other benchmark results here: https://box2d.org/files/benchmark_results.html

image

bostick commented 1 month ago

Ah, I messed up the formatting when I stripped the \n in the fprintf calls when I was replacing all of printf calls with Android logging. Fixed in the repo now.