[compiler-rt] d6649f2 - [AArch64][SME] Rewrite __arm_sc_memset to remove invalid instruction (#101522)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 2 10:01:02 PDT 2024


Author: Kerry McLaughlin
Date: 2024-08-02T18:00:59+01:00
New Revision: d6649f2d4871c4535ae0519920e36100748890c4

URL: https://github.com/llvm/llvm-project/commit/d6649f2d4871c4535ae0519920e36100748890c4
DIFF: https://github.com/llvm/llvm-project/commit/d6649f2d4871c4535ae0519920e36100748890c4.diff

LOG: [AArch64][SME] Rewrite __arm_sc_memset to remove invalid instruction (#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.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/builtins/aarch64/sme-libc-mem-routines.S b/compiler-rt/lib/builtins/aarch64/sme-libc-mem-routines.S
index 926ad3b1b6331..0318d9a6f1ebd 100644
--- a/compiler-rt/lib/builtins/aarch64/sme-libc-mem-routines.S
+++ b/compiler-rt/lib/builtins/aarch64/sme-libc-mem-routines.S
@@ -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
+        mov     z0.b, valw
+#else
+        bfi valw, valw, #8, #8
+        bfi valw, valw, #16, #16
+        bfi val, val, #32, #32
+        fmov d0, val
+        fmov v0.d[1], val
+#endif
         add     dstend2, dstin, count
 
         cmp     count, 96


        


More information about the llvm-commits mailing list