arm: Fix addressing in optpld macro

In patch b219285f873cc79361355938bd2a994957b4a6ef you have a syntax
error in the PLD instruction.  The syntax for the pld argument should be
in square brackets as it's a memory address like so: pld [r1].  With
your patch the newlib build fails for armv7-a targets.  This patch fixes
the build failures.

Tested by making sure the newlib build completes successfully.

2016-01-26  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

    * libc/machine/arm/strcpy.c (strcpy): Fix PLD assembly syntax.
    * libc/machine/arm/strlen-stub.c (strlen): Likewise.
This commit is contained in:
Kyrill Tkachov 2017-01-26 10:26:10 +00:00 committed by Corinna Vinschen
parent 3ebc26958e
commit 52a6da816f
2 changed files with 4 additions and 4 deletions

View File

@ -45,7 +45,7 @@ strcpy (char* dst, const char* src)
#if !(defined(__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED) || \ #if !(defined(__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED) || \
(defined (__thumb__) && !defined (__thumb2__))) (defined (__thumb__) && !defined (__thumb2__)))
#ifdef _ISA_ARM_7 #ifdef _ISA_ARM_7
"pld r1\n\t" "pld [r1]\n\t"
#endif #endif
"eor r2, r0, r1\n\t" "eor r2, r0, r1\n\t"
"mov ip, r0\n\t" "mov ip, r0\n\t"
@ -78,7 +78,7 @@ strcpy (char* dst, const char* src)
".p2align 2\n" ".p2align 2\n"
"2:\n\t" "2:\n\t"
#ifdef _ISA_ARM_7 #ifdef _ISA_ARM_7
"pld r1, #8\n\t" "pld [r1, #8]\n\t"
#endif #endif
"ldr r4, [r1], #4\n\t" "ldr r4, [r1], #4\n\t"
"sub r2, r3, "magic1(r5)"\n\t" "sub r2, r3, "magic1(r5)"\n\t"

View File

@ -59,7 +59,7 @@ strlen (const char* str)
"addr .req r1\n\t" "addr .req r1\n\t"
#ifdef _ISA_ARM_7 #ifdef _ISA_ARM_7
"pld r0\n\t" "pld [r0]\n\t"
#endif #endif
/* Word-align address */ /* Word-align address */
"bic addr, r0, #3\n\t" "bic addr, r0, #3\n\t"
@ -116,7 +116,7 @@ strlen (const char* str)
/* and 4 more bytes */ /* and 4 more bytes */
"addeq len, len, #4\n\t" "addeq len, len, #4\n\t"
/* Unroll the loop a bit. */ /* Unroll the loop a bit. */
"pld addr, #8\n\t" "pld [addr, #8]\n\t"
/* test (data - 0x01010101) */ /* test (data - 0x01010101) */
"ittt eq\n\t" "ittt eq\n\t"
"subeq r2, data, ip\n\t" "subeq r2, data, ip\n\t"