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

ARM NEON: fix arm64 gcc11 build excess elements in vector failure #1216

Merged
merged 3 commits into from
Sep 12, 2024

Conversation

Qingwu-Li
Copy link
Contributor

Resolved a build failure on ARM64 with GCC 11 caused by excess elements in a vector initializer. The issue stemmed from the __builtin_shuffle function, where the number of elements in the argument vector(s) and the mask vector must match.

For more details, refer to issue #1211.

Copy link
Collaborator

@mr-c mr-c left a comment

Choose a reason for hiding this comment

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

@mr-c mr-c force-pushed the arm64-gcc11-builtin-shuffle branch from 1097884 to 5377444 Compare September 9, 2024 15:13
@mr-c
Copy link
Collaborator

mr-c commented Sep 9, 2024

I can confirm this PR does fix some errors: https://github.com/simd-everywhere/simde/actions/runs/10775769592/job/29880998011?pr=1216#step:9:1271 (log of a gcc-11 aarch64 build without these fixes)

@Qingwu-Li Qingwu-Li force-pushed the arm64-gcc11-builtin-shuffle branch from 5377444 to 53e13c9 Compare September 10, 2024 11:21
@Qingwu-Li
Copy link
Contributor Author

Thank you @Qingwu-Li ; can you address the test failures? https://github.com/simd-everywhere/simde/actions/runs/10774988233/job/29878397301?pr=1216#step:10:1023

This is another issue related to gcc 11. While I'm new to SIMD and not fully confident in the fix, it provides a temporary solution to the problem.

@mr-c
Copy link
Collaborator

mr-c commented Sep 10, 2024

Thank you @Qingwu-Li ; can you address the test failures? https://github.com/simd-everywhere/simde/actions/runs/10774988233/job/29878397301?pr=1216#step:10:1023

This is another issue related to gcc 11. While I'm new to SIMD and not fully confident in the fix, it provides a temporary solution to the problem.

Thanks for the fix! Is there a bug about vst1_*_x4 in the GCC bug tracker?

@Qingwu-Li Qingwu-Li force-pushed the arm64-gcc11-builtin-shuffle branch from 53e13c9 to 84d614c Compare September 10, 2024 11:28
@mr-c
Copy link
Collaborator

mr-c commented Sep 10, 2024

Yay, it worked! It would be nice to update the reference to include a specific GCC bug number before merging

@mr-c mr-c force-pushed the arm64-gcc11-builtin-shuffle branch from 84d614c to 63db247 Compare September 10, 2024 20:01
@Qingwu-Li
Copy link
Contributor Author

Yay, it worked! It would be nice to update the reference to include a specific GCC bug number before merging

Didn't found the related bug number , maybe fixed in this commit in releases/gcc-11.5.0,but not verifyed.
https://gcc.gnu.org/git/?p=gcc.git;a=log;h=daee0409d195d346562e423da783d5d1cf8ea175

@mr-c
Copy link
Collaborator

mr-c commented Sep 11, 2024

Yay, it worked! It would be nice to update the reference to include a specific GCC bug number before merging

Didn't found the related bug number , maybe fixed in this commit in releases/gcc-11.5.0,but not verifyed. https://gcc.gnu.org/git/?p=gcc.git;a=log;h=daee0409d195d346562e423da783d5d1cf8ea175

Okay, that seems to come from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114521

@mr-c mr-c force-pushed the arm64-gcc11-builtin-shuffle branch from 63db247 to 84d5515 Compare September 11, 2024 12:06
@mr-c mr-c force-pushed the arm64-gcc11-builtin-shuffle branch from 84d5515 to eeba351 Compare September 11, 2024 12:29
@mr-c mr-c enabled auto-merge (rebase) September 11, 2024 12:30
Qingwu-Li added a commit to Qingwu-Li/WebKit that referenced this pull request Sep 12, 2024
Resolved a build failure on ARM64 with GCC 11 caused by excess
elements in a vector initializer. The issue stemmed from the
`__builtin_shuffle` function, where the number of elements in
the argument vector(s) and the mask vector must match. see [1].

[1]: simd-everywhere/simde#1216

Signed-off-by: LI Qingwu <[email protected]>
Qingwu-Li added a commit to Qingwu-Li/WebKit that referenced this pull request Sep 12, 2024
Resolved a build failure on ARM64 with GCC 11 caused by excess
elements in a vector initializer. The issue stemmed from the
`__builtin_shuffle` function, where the number of elements in
the argument vector(s) and the mask vector must match. see [1].

[1]: simd-everywhere/simde#1216

Signed-off-by: LI Qingwu <[email protected]>
Qingwu-Li and others added 3 commits September 12, 2024 12:57
Resolved a build failure on ARM64 with GCC 11 caused by excess
elements in a vector initializer. The issue stemmed from the
`__builtin_shuffle` function, where the number of elements in
the argument vector(s) and the mask vector must match.

For more details, refer to issue simd-everywhere#1211.

Signed-off-by: LI Qingwu <[email protected]>
The vst1_*_x4 built-in functions in GCC 11 produce incorrect results,
as following exanple, this patch circumvents the issue by avoiding these
functions in GCC 11 and earlier versions.

float32x2x4_t val = {{
        {0.10f, 0.20f},
        {0.30f, 0.40f},
        {0.50f, 0.60f},
        {0.70f, 0.80f}
    }};
    float result[16];

    vst1_f32_x4(result, val);

get result = {0.100000 0.200000 0.500000 0.600000 0.000000 0.000000 0.000000 0.000000}

Signed-off-by: LI Qingwu <[email protected]>
@mr-c mr-c force-pushed the arm64-gcc11-builtin-shuffle branch from eeba351 to 78182f2 Compare September 12, 2024 10:57
@mr-c mr-c disabled auto-merge September 12, 2024 12:55
@mr-c mr-c merged commit 4b96738 into simd-everywhere:master Sep 12, 2024
96 of 98 checks passed
@mr-c
Copy link
Collaborator

mr-c commented Sep 12, 2024

Thank you @Qingwu-Li !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants