Skip to content

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


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
@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
Member

llvmbot commented Aug 5, 2024

/pull-request #101938

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