summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Guryanov <guryanov@synopsys.com>2015-02-03 13:58:09 +0300
committerAlexey Brodkin <abrodkin@synopsys.com>2015-02-09 16:41:20 +0300
commitf958a91fa5cefd0cda76c887ee0488fb9158496e (patch)
treeeab1f7d9e7ff47bff2b0ba0503b5b25f5c20e9ce
parent7f641d53bbb3a426a3bfb132d8346153e86a9d08 (diff)
downloadu-boot-imx-f958a91fa5cefd0cda76c887ee0488fb9158496e.zip
u-boot-imx-f958a91fa5cefd0cda76c887ee0488fb9158496e.tar.gz
u-boot-imx-f958a91fa5cefd0cda76c887ee0488fb9158496e.tar.bz2
arc: memcmp - fix zero-delay loop utilization
It's prohibited to put branch instruction in the very end of zero-delay loop. On execution this causes "Illegal instruction" exception. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Igor Guryanov <guryanov@synopsys.com>
-rw-r--r--arch/arc/lib/memcmp.S2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arc/lib/memcmp.S b/arch/arc/lib/memcmp.S
index fa5aac5..87bccab 100644
--- a/arch/arc/lib/memcmp.S
+++ b/arch/arc/lib/memcmp.S
@@ -29,6 +29,7 @@ memcmp:
ld.a %r4, [%r0, 8]
ld.a %r5, [%r1, 8]
brne WORD2, %r12, .Lodd
+ nop
.Loop_end:
asl_s SHIFT, SHIFT, 3
bhs_s .Last_cmp
@@ -105,6 +106,7 @@ memcmp:
ldb.a %r4, [%r0, 2]
ldb.a %r5, [%r1, 2]
brne %r3, %r12, .Lbyte_odd
+ nop
.Lbyte_end:
bcc .Lbyte_even
brne %r4, %r5, .Lbyte_even