memcpy and unaligned memory access

Asked by Axel Wolf on 2017-08-03

I have the following questions:

Q1 – Does memcpy in libc.a perform unaligned memory accesses?
Q2 – Does memcpy in libc_nano.a perform unaligned memory accesses?
Q3 – If the answer for Q2 is NO, are there any plans to enable libc_nano.a to perform unaligned memory accesses in the future?

Target CPU: armv7-m (C-M4)
Toolchain version: 4.9 2015q3

Thanks!

Question information

Language:
English Edit question
Status:
Answered
For:
GNU ARM Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
2017-08-03
Last reply:
2017-08-04
Tejas Belagod (belagod-tejas) said : #1

Yes, memcpy() has been optimized for both unaligned and aligned access in both libc and nano. Have a look at

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=newlib/libc/machine/arm/memcpy-armv7m.S;h=c8bff36f60cf6ed520172c85406f6a9529f41de3;hb=HEAD

Thanks,
Tejas.

Tejas Belagod (belagod-tejas) said : #2

Also, we don't support 4.9 toolchain anymore - I would recommend you move to the latest ARM Embedded 6 toolchain (6-2017-q2-update) available here:

https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads

Can you help with this problem?

Provide an answer of your own, or ask Axel Wolf for more information if necessary.

To post a message you must log in.