anchao opened a new pull request, #21033:
URL: https://github.com/apache/nuttx/pull/21033
## Summary
Optimize the default libc `memcpy()` implementation by using aligned 32-bit
word copies when the source and destination have compatible alignment.
Previously, the generic fallback implementation copied data byte by byte for
the whole buffer. This change keeps the same byte-copy fallback behavior,
but
adds a faster path for suitable buffers:
- check that the copy size is large enough for 32-bit block copying
- verify that source and destination alignment match
- copy leading bytes until the destination is 32-bit aligned
- copy data in unrolled 32-bit blocks
- copy any remaining trailing bytes byte by byte
This improves the generic `memcpy()` path used when an architecture-specific
implementation is not enabled.
## Impact
No user-visible behavior change is expected.
Expected impact:
- improves performance of the default libc `memcpy()` for aligned or
similarly
aligned buffers
- preserves byte-wise fallback behavior for small or incompatible alignments
- does not affect builds using `CONFIG_LIBC_ARCH_MEMCPY`
- no API, ABI, build-system, documentation, or security impact is expected
## Testing
sim/nsh
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]