public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] arm: Fix memchr() for Armv8-R
@ 2020-12-04  7:42 Sebastian Huber
  2020-12-09 12:11 ` Sebastian Huber
  2020-12-14 21:12 ` Jeff Johnston
  0 siblings, 2 replies; 5+ messages in thread
From: Sebastian Huber @ 2020-12-04  7:42 UTC (permalink / raw)
  To: newlib

The Cortex-R52 processor is an Armv8-R processor with a NEON unit.  This
fix prevents conflicting architecture profiles A/R errors issued by the
linker.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
---
 newlib/libc/machine/arm/memchr.S | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/newlib/libc/machine/arm/memchr.S b/newlib/libc/machine/arm/memchr.S
index 7c22b117e..1a4c6512c 100644
--- a/newlib/libc/machine/arm/memchr.S
+++ b/newlib/libc/machine/arm/memchr.S
@@ -79,7 +79,11 @@
 
 @ NOTE: This ifdef MUST match the one in memchr-stub.c
 #if defined (__ARM_NEON__) || defined (__ARM_NEON)
+#if __ARM_ARCH >= 8 && __ARM_ARCH_PROFILE == 'R'
+	.arch	armv8-r
+#else
 	.arch	armv7-a
+#endif
 	.fpu	neon
 
 
-- 
2.26.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] arm: Fix memchr() for Armv8-R
  2020-12-04  7:42 [PATCH] arm: Fix memchr() for Armv8-R Sebastian Huber
@ 2020-12-09 12:11 ` Sebastian Huber
  2020-12-09 12:27   ` Richard Earnshaw
  2020-12-14 21:12 ` Jeff Johnston
  1 sibling, 1 reply; 5+ messages in thread
From: Sebastian Huber @ 2020-12-09 12:11 UTC (permalink / raw)
  To: newlib; +Cc: Richard Earnshaw

On 04/12/2020 08:42, Sebastian Huber wrote:

> The Cortex-R52 processor is an Armv8-R processor with a NEON unit.  This
> fix prevents conflicting architecture profiles A/R errors issued by the
> linker.
>
> Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
> ---
>   newlib/libc/machine/arm/memchr.S | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/newlib/libc/machine/arm/memchr.S b/newlib/libc/machine/arm/memchr.S
> index 7c22b117e..1a4c6512c 100644
> --- a/newlib/libc/machine/arm/memchr.S
> +++ b/newlib/libc/machine/arm/memchr.S
> @@ -79,7 +79,11 @@
>   
>   @ NOTE: This ifdef MUST match the one in memchr-stub.c
>   #if defined (__ARM_NEON__) || defined (__ARM_NEON)
> +#if __ARM_ARCH >= 8 && __ARM_ARCH_PROFILE == 'R'
> +	.arch	armv8-r
> +#else
>   	.arch	armv7-a
> +#endif
>   	.fpu	neon
>   
>   

The memchr.S from the ARM optimized routines package has little in 
common with the file in Newlib:

https://github.com/ARM-software/optimized-routines/blob/master/string/arm/memchr.S

The Newlib variant uses VFP instructions for example.

I think this change should be checked in as is.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] arm: Fix memchr() for Armv8-R
  2020-12-09 12:11 ` Sebastian Huber
@ 2020-12-09 12:27   ` Richard Earnshaw
  2020-12-09 12:53     ` Sebastian Huber
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Earnshaw @ 2020-12-09 12:27 UTC (permalink / raw)
  To: Sebastian Huber, newlib

On 09/12/2020 12:11, Sebastian Huber wrote:
> On 04/12/2020 08:42, Sebastian Huber wrote:
> 
>> The Cortex-R52 processor is an Armv8-R processor with a NEON unit.  This
>> fix prevents conflicting architecture profiles A/R errors issued by the
>> linker.
>>
>> Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
>> ---
>>   newlib/libc/machine/arm/memchr.S | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/newlib/libc/machine/arm/memchr.S
>> b/newlib/libc/machine/arm/memchr.S
>> index 7c22b117e..1a4c6512c 100644
>> --- a/newlib/libc/machine/arm/memchr.S
>> +++ b/newlib/libc/machine/arm/memchr.S
>> @@ -79,7 +79,11 @@
>>     @ NOTE: This ifdef MUST match the one in memchr-stub.c
>>   #if defined (__ARM_NEON__) || defined (__ARM_NEON)
>> +#if __ARM_ARCH >= 8 && __ARM_ARCH_PROFILE == 'R'
>> +    .arch    armv8-r
>> +#else
>>       .arch    armv7-a
>> +#endif
>>       .fpu    neon
>>     
> 
> The memchr.S from the ARM optimized routines package has little in
> common with the file in Newlib:
> 
> https://github.com/ARM-software/optimized-routines/blob/master/string/arm/memchr.S
> 
> 
> The Newlib variant uses VFP instructions for example.
> 
> I think this change should be checked in as is.
> 

That probably means the newlib one is out of date and needs to be resynced.

R.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] arm: Fix memchr() for Armv8-R
  2020-12-09 12:27   ` Richard Earnshaw
@ 2020-12-09 12:53     ` Sebastian Huber
  0 siblings, 0 replies; 5+ messages in thread
From: Sebastian Huber @ 2020-12-09 12:53 UTC (permalink / raw)
  To: Richard Earnshaw, newlib

On 09/12/2020 13:27, Richard Earnshaw wrote:

> On 09/12/2020 12:11, Sebastian Huber wrote:
>> On 04/12/2020 08:42, Sebastian Huber wrote:
>>
>>> The Cortex-R52 processor is an Armv8-R processor with a NEON unit.  This
>>> fix prevents conflicting architecture profiles A/R errors issued by the
>>> linker.
>>>
>>> Signed-off-by: Sebastian Huber<sebastian.huber@embedded-brains.de>
>>> ---
>>>    newlib/libc/machine/arm/memchr.S | 4 ++++
>>>    1 file changed, 4 insertions(+)
>>>
>>> diff --git a/newlib/libc/machine/arm/memchr.S
>>> b/newlib/libc/machine/arm/memchr.S
>>> index 7c22b117e..1a4c6512c 100644
>>> --- a/newlib/libc/machine/arm/memchr.S
>>> +++ b/newlib/libc/machine/arm/memchr.S
>>> @@ -79,7 +79,11 @@
>>>      @ NOTE: This ifdef MUST match the one in memchr-stub.c
>>>    #if defined (__ARM_NEON__) || defined (__ARM_NEON)
>>> +#if __ARM_ARCH >= 8 && __ARM_ARCH_PROFILE == 'R'
>>> +    .arch    armv8-r
>>> +#else
>>>        .arch    armv7-a
>>> +#endif
>>>        .fpu    neon
>>>      
>> The memchr.S from the ARM optimized routines package has little in
>> common with the file in Newlib:
>>
>> https://github.com/ARM-software/optimized-routines/blob/master/string/arm/memchr.S
>>
>>
>> The Newlib variant uses VFP instructions for example.
>>
>> I think this change should be checked in as is.
>>
> That probably means the newlib one is out of date and needs to be resynced.

I lack the background information to decide this. I have for example no 
idea why the VFP variant was removed or not included in 
ARM-software/optimized-routines. Was it intentional or an oversight? Was 
it based on benchmarks?

Without the patch above Newlib is currently unusable for Armv8-R targets 
with an VFP unit.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] arm: Fix memchr() for Armv8-R
  2020-12-04  7:42 [PATCH] arm: Fix memchr() for Armv8-R Sebastian Huber
  2020-12-09 12:11 ` Sebastian Huber
@ 2020-12-14 21:12 ` Jeff Johnston
  1 sibling, 0 replies; 5+ messages in thread
From: Jeff Johnston @ 2020-12-14 21:12 UTC (permalink / raw)
  To: Sebastian Huber; +Cc: Newlib

Patch applied to master as there were was no objection from Richard, even
though he suggests the function
needs resyncing.  If someone wants to do the resync before end-of-year,
please get approval from Richard or
Arm team.

-- Jeff J.

On Fri, Dec 4, 2020 at 2:42 AM Sebastian Huber <
sebastian.huber@embedded-brains.de> wrote:

> The Cortex-R52 processor is an Armv8-R processor with a NEON unit.  This
> fix prevents conflicting architecture profiles A/R errors issued by the
> linker.
>
> Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
> ---
>  newlib/libc/machine/arm/memchr.S | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/newlib/libc/machine/arm/memchr.S
> b/newlib/libc/machine/arm/memchr.S
> index 7c22b117e..1a4c6512c 100644
> --- a/newlib/libc/machine/arm/memchr.S
> +++ b/newlib/libc/machine/arm/memchr.S
> @@ -79,7 +79,11 @@
>
>  @ NOTE: This ifdef MUST match the one in memchr-stub.c
>  #if defined (__ARM_NEON__) || defined (__ARM_NEON)
> +#if __ARM_ARCH >= 8 && __ARM_ARCH_PROFILE == 'R'
> +       .arch   armv8-r
> +#else
>         .arch   armv7-a
> +#endif
>         .fpu    neon
>
>
> --
> 2.26.2
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-14 21:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04  7:42 [PATCH] arm: Fix memchr() for Armv8-R Sebastian Huber
2020-12-09 12:11 ` Sebastian Huber
2020-12-09 12:27   ` Richard Earnshaw
2020-12-09 12:53     ` Sebastian Huber
2020-12-14 21:12 ` Jeff Johnston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).