[PATCH v2 07/11] RISC-V: memcpy() size optimized version: Replace lb with lbu

m fally <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
From: Mahmoud Abumandour <[email protected]>

Replace lb with lbu to avoid unnecessary sign extension.

Reviewed-by: Christian Herber <[email protected]>
Signed-off-by: Mahmoud Abumandour <[email protected]>
---
 newlib/libc/machine/riscv/memcpy-asm.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/newlib/libc/machine/riscv/memcpy-asm.S b/newlib/libc/machine/riscv/memcpy-asm.S
index 5571e4704..d05ff5055 100644
--- a/newlib/libc/machine/riscv/memcpy-asm.S
+++ b/newlib/libc/machine/riscv/memcpy-asm.S
@@ -18,7 +18,7 @@ memcpy:
   beqz a2, 2f
 
 1:
-  lb t2, 0(a1)
+  lbu t2, 0(a1)
   sb t2, 0(t1)
   add   a2, a2, -1
   add   t1, t1, 1
-- 
2.49.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.