Skip to content

Commit b34235e

Browse files
committed
Improve documentation
1 parent 04a2946 commit b34235e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libc/src/string/memory_utils/arm/inline_memcpy.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,10 @@ copy_bytes_and_bump_pointers(Ptr &dst, CPtr &src, size_t size) {
199199
// The compiler performs alias analysis and is able to prove that `dst` and
200200
// `src` do not alias by propagating the `__restrict` keyword from the
201201
// `memcpy` prototype. This allows the compiler to merge consecutive
202-
// load/store (LDR, STR) instructions into load/store double (LDRD, STRD)
203-
// instructions.
202+
// load/store (LDR, STR) instructions generated in
203+
// `copy_block_and_bump_pointers` with `BlockOp::kByWord` into load/store
204+
// double (LDRD, STRD) instructions, this is is undesirable so we prevent the
205+
// compiler from inferring `__restrict` with the following line.
204206
asm volatile("" : "+r"(dst), "+r"(src));
205207
#ifdef __ARM_FEATURE_UNALIGNED
206208
return inline_memcpy_arm_mid_end(dst, src, size);

0 commit comments

Comments
 (0)