Skip to content
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

Merged
merged 5 commits into from Sep 3, 2023

Conversation

larsamannen
Copy link
Contributor

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

@@ -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))
Copy link
Member

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.

Copy link
Contributor Author

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

@ccawley2011
Copy link
Member

There's an additional change in PR #5286 that enables NEON in ARMv7 ./configure builds that you might want to add to this one.

larsamannen and others added 5 commits August 29, 2023 23:28
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.
@larsamannen
Copy link
Contributor Author

@ccawley2011 updated

@larsamannen larsamannen changed the title ARM NEON changes IOS7: Utilise Arm Neon optimisation Aug 31, 2023
@sev-
Copy link
Member

sev- commented Sep 3, 2023

Thanks!

@sev- sev- merged commit 0c98d17 into scummvm:master Sep 3, 2023
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants