This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Support __aeabi_memcpy, __aeabi_memcpy4 and __aeabi_memcpy8 routines in the arm backend.
- From: Joey Ye <joey dot ye dot cc at gmail dot com>
- To: "Bin.Cheng" <amker dot cheng at gmail dot com>
- Cc: Richard Earnshaw <rearnsha at arm dot com>, Hale Wang <Hale dot Wang at arm dot com>, "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Fri, 8 Aug 2014 18:51:22 +0800
- Subject: Re: Support __aeabi_memcpy, __aeabi_memcpy4 and __aeabi_memcpy8 routines in the arm backend.
- Authentication-results: sourceware.org; auth=none
- References: <000601cfb2c2$a9386a40$fba93ec0$ at arm dot com> <CAHFci28LV01ZA5i6EZyAngQT=0O8WG-WDH3vmRwdHCgL63C4rA at mail dot gmail dot com> <000a01cfb2df$f5d79070$e186b150$ at arm dot com> <CAHFci2-5cjHnrvH3s-Nw2Mtb8Y+mjWYty5TrYLExL3qX9LjURg at mail dot gmail dot com> <000b01cfb2f0$49dc8e40$dd95aac0$ at arm dot com> <53E4A438 dot 8010504 at arm dot com> <CAHFci2_4fK2ChZ+xcKTuCtxBjZ24F88yoXjJrND3NPKapQgKHg at mail dot gmail dot com>
On Fri, Aug 8, 2014 at 6:26 PM, Bin.Cheng <amker.cheng@gmail.com> wrote:
> On Fri, Aug 8, 2014 at 6:19 PM, Richard Earnshaw <rearnsha@arm.com> wrote:
>> I've two concerns about this, one important.
>>
>> 1) Minor concern. The point of __aeabi_memcpy[4|8] is that they are
>> more efficient than __aeabi_memcpy since they know the aligment and size
>> are a multiple of 4/8 respectively.
>>
>> 2) Major concern. __aeabi_memcpy* are not permitted to clobber any
>> callee clobbered registers outside of the core register set
>> (specifically not to clobber any FP/SIMD registers). Unfortunately, the
>> memcpy in newlib does not guarantee this, particularly for ARMv7-a. You
>> need to either provide alternative implementations in that case, or to
>> save the appropriate FP/SIMD registers around a call to memcpy.
>
> Ah, they are conflict with each other in ABI level. If __aeabi_memcpy
> could be alias to c version memcpy, how could it reserve registers
> other than AAPCS allows?
>
I think what ABI says is that they can be aliased if it is known the C
memcpy does not clobber other registers, otherwise cannot.
- Joey