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

[libjpeg-turbo] Enable NEON intrinsics for ARM builds #24775

Merged
merged 2 commits into from
May 20, 2022

Conversation

ZacWalk
Copy link
Member

@ZacWalk ZacWalk commented May 18, 2022

Describe the pull request

  • What does your PR fix?

Enables NEON Intrinsics for ARM builds to improve performance. Performance testing using tjbench:

config Snapdragon 3ghz Windows device Without Intrinsics Snapdragon 3ghz Windows device With Intrinsics Intel i7 11700 3.6ghz Windows device
x86 113 Megapixels/sec (Emulated) 113 Megapixels/sec (Emulated) 229 Megapixels/sec
x64 121 Megapixels/sec (Emulated) 121 Megapixels/sec (Emulated) 278 Megapixels/sec
arm64 102 Megapixels/sec 183 Megapixels/sec n/a
  • Which triplets are supported/not supported? Have you updated the CI baseline?

    No - not needed.

  • Does your PR follow the maintainer guide?

    Yes

  • If you have added/updated a port: Have you run ./vcpkg x-add-version --all and committed the result?

    Yes

If you are still working on the PR, open it as a Draft: https://github.blog/2019-02-14-introducing-draft-pull-requests/

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout 261ca0dd4d458f9ea58fc7096b1eb1a68c47cfc8 -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/l-/libjpeg-turbo.json b/versions/l-/libjpeg-turbo.json
index 857413f..6860f26 100644
--- a/versions/l-/libjpeg-turbo.json
+++ b/versions/l-/libjpeg-turbo.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "f3ab7c40b47aa03953467e7697d3eea7b60d624e",
+      "version": "2.1.3",
+      "port-version": 3
+    },
     {
       "git-tree": "dd9bb6eb0d4e28d2b3ef0d83b6b9ef736555621d",
       "version": "2.1.3",

@ZacWalk ZacWalk changed the title [libjpeg-trubo] Enable NEON intrinsics for ARM builds [libjpeg-turbo] Enable NEON intrinsics for ARM builds May 18, 2022
@@ -15,7 +15,7 @@ vcpkg_from_github(
)

if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR (VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore"))
set(LIBJPEGTURBO_SIMD -DWITH_SIMD=OFF)
set(LIBJPEGTURBO_SIMD -DWITH_SIMD=ON -DNEON_INTRINSICS=ON)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question here is if NEON_INTRNSICS are valid on all arm architectures or not.

Copy link
Member Author

@ZacWalk ZacWalk May 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are runtime checks to determine if SIMD versions of routines should be called.
The intrinsics look compatible with ARMv7 and ARMv8.
I have only tested on Windows ARM64 devices though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is consistent with what other ports do.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout 261ca0dd4d458f9ea58fc7096b1eb1a68c47cfc8 -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/l-/libjpeg-turbo.json b/versions/l-/libjpeg-turbo.json
index 857413f..6860f26 100644
--- a/versions/l-/libjpeg-turbo.json
+++ b/versions/l-/libjpeg-turbo.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "f3ab7c40b47aa03953467e7697d3eea7b60d624e",
+      "version": "2.1.3",
+      "port-version": 3
+    },
     {
       "git-tree": "dd9bb6eb0d4e28d2b3ef0d83b6b9ef736555621d",
       "version": "2.1.3",

@JackBoosY JackBoosY added category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. labels May 19, 2022
@ZacWalk ZacWalk marked this pull request as ready for review May 19, 2022 14:08
@BillyONeal BillyONeal merged commit 314018f into microsoft:master May 20, 2022
@BillyONeal
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants