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

[AArch64][SME] Rewrite __arm_sc_memset to remove invalid instruction #101522

Merged
merged 3 commits into from
Aug 2, 2024

Conversation

kmclaughlin-arm
Copy link
Contributor

The implementation of __arm_sc_memset in compiler-rt contains
a Neon dup instruction which is not valid in streaming mode.
This patch rewrites the function to use spills & fills, or to use
an SVE mov instruction if available.

The implementation of __arm_sc_memset in compiler-rt contains a Neon
dup instruction which is not valid in streaming mode.
This patch rewrites the function to use spills & fills, or to use
an SVE mov instruction if available.
# ifdef __ARM_FEATURE_SVE
mov z0.b, valw
# else
sub sp, sp, #16
Copy link
Collaborator

Choose a reason for hiding this comment

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

bfi valw, valw, #8, #8
bfi valw, valw, #16, #16
bfi val, val, #32, #32
fmov d0, val
fmov v0.d[1], val

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion, @efriedma-quic!

Copy link
Collaborator

@sdesmalen-arm sdesmalen-arm left a comment

Choose a reason for hiding this comment

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

LGMT with nit addressed

@@ -252,7 +252,15 @@ DEFINE_COMPILERRT_FUNCTION_ALIAS(__arm_sc_memmove, __arm_sc_memcpy)
#define zva_val x5

DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(__arm_sc_memset)
dup v0.16B, valw
# ifdef __ARM_FEATURE_SVE
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: why the space between the # and the ifdef/else/endif ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was no real reason for the spaces, I'll remove them before merging.

@kmclaughlin-arm kmclaughlin-arm merged commit d6649f2 into llvm:main Aug 2, 2024
6 checks passed
@kmclaughlin-arm kmclaughlin-arm added this to the LLVM 19.X Release milestone Aug 5, 2024
@kmclaughlin-arm
Copy link
Contributor Author

/cherry-pick d6649f2

llvmbot pushed a commit to llvmbot/llvm-project that referenced this pull request Aug 5, 2024
…lvm#101522)

The implementation of __arm_sc_memset in compiler-rt contains
a Neon dup instruction which is not valid in streaming mode. This
patch rewrites the function, using an SVE mov instruction if available.

(cherry picked from commit d6649f2)
@llvmbot
Copy link
Collaborator

llvmbot commented Aug 5, 2024

/pull-request #101938

banach-space pushed a commit to banach-space/llvm-project that referenced this pull request Aug 7, 2024
…lvm#101522)

The implementation of __arm_sc_memset in compiler-rt contains
a Neon dup instruction which is not valid in streaming mode. This
patch rewrites the function, using an SVE mov instruction if available.
tru pushed a commit to llvmbot/llvm-project that referenced this pull request Aug 10, 2024
…lvm#101522)

The implementation of __arm_sc_memset in compiler-rt contains
a Neon dup instruction which is not valid in streaming mode. This
patch rewrites the function, using an SVE mov instruction if available.

(cherry picked from commit d6649f2)
@kmclaughlin-arm kmclaughlin-arm deleted the aor-streaming branch August 19, 2024 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

4 participants