Skip to content

Commit 91d3e76

Browse files
kmclaughlin-armtru
authored andcommitted
[AArch64][SME] Rewrite __arm_sc_memset to remove invalid instruction (llvm#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)
1 parent de97808 commit 91d3e76

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

compiler-rt/lib/builtins/aarch64/sme-libc-mem-routines.S

+9-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,15 @@ DEFINE_COMPILERRT_FUNCTION_ALIAS(__arm_sc_memmove, __arm_sc_memcpy)
252252
#define zva_val x5
253253

254254
DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(__arm_sc_memset)
255-
dup v0.16B, valw
255+
#ifdef __ARM_FEATURE_SVE
256+
mov z0.b, valw
257+
#else
258+
bfi valw, valw, #8, #8
259+
bfi valw, valw, #16, #16
260+
bfi val, val, #32, #32
261+
fmov d0, val
262+
fmov v0.d[1], val
263+
#endif
256264
add dstend2, dstin, count
257265

258266
cmp count, 96

0 commit comments

Comments
 (0)