New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IOS7: Utilise Arm Neon optimisation #5301
Conversation
engines/ags/lib/allegro/surface.cpp
Outdated
@@ -183,7 +183,7 @@ void BITMAP::draw(const BITMAP *srcBitmap, const Common::Rect &srcRect, | |||
drawInnerGeneric<2, 1, false>(args); | |||
return; | |||
} | |||
#ifdef SCUMMVM_NEON | |||
#if defined(SCUMMVM_NEON) && (defined(__ARM_NEON__) || defined(__ARM_NEON)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will stop runtime detection from working on platforms where NEON is optional since only the files with the actual NEON code is built with -fpu=neon, which is what defines ARM_NEON.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will try to solve it within the backend itself
There's an additional change in PR #5286 that enables NEON in ARMv7 ./configure builds that you might want to add to this one. |
The blit-neon.cpp file is only added to the project if the flag SCUMMVM_NEON is defined. However some backends, e.g. iOS, adds the definition of SCUMMVM_NEON in create_project so the file can be added to the project during configuration. The same backend can then unset the definition due to changing build target, the iOS simulator in this example, which runs can run on x86_64 hosts which doesn't support NEON. Since the project still include the source file it will be compiled. Make sure to not build the file if not SCUMMVM_NEON is defined at compile time.
The surface_neon.cpp file is only added to the project if the flag SCUMMVM_NEON is defined. However some backends, e.g. iOS, adds the definition of SCUMMVM_NEON in create_project so the file can be added to the project during configuration. The same backend can then unset the definition due to changing build target, the iOS simulator in this example, which runs can run on x86_64 hosts which doesn't support NEON. Since the project still include the source file it will be compiled. Make sure to not build the file if not SCUMMVM_NEON is defined at compile time.
Add the definition of SCUMMVM_NEON in create_project for the iOS and tvOS targets. Do not add the same definition to corresponding simulators since they can run on x86_64 hosts, which for obvious reasons lacks support for NEON.
Make use of the NEON optimisations in iOS and tvOS.
The SCUMMVM_NEON definition is alredy added by default for aarch64 host cpus. NEON is also supported on iOS devices running on armv7 cpus. Make sure to enable NEON for all ios7 devices.
2356570
to
2b9ab01
Compare
@ccawley2011 updated |
Thanks! |
This PR enables SCUMMVM_NEON for iOS/tvOS, simulators running on x86_64 excluded.
It also add extra preprocessor checks that ARM_NEON really is available if SCUMMVM_NEON is set.
To allow for Arm NEON optimisations SCUMMVM_NEON, ARM_NEON or __ARM_NEON have to be defined.
Else it will bail out do use the default non-optimised functions.
Replaces #5286