qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] target/sparc: Use memcpy() in memcpy32()


From: Pierrick Bouvier
Subject: Re: [PATCH] target/sparc: Use memcpy() in memcpy32()
Date: Wed, 4 Dec 2024 13:23:42 -0800
User-agent: Mozilla Thunderbird

On 12/4/24 12:41, Philippe Mathieu-Daudé wrote:
Rather than manually copying each register, use
the libc memcpy(), which is well optimized.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
Worth renaming as reg8cpy()?
---
  target/sparc/win_helper.c | 9 +--------
  1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/target/sparc/win_helper.c b/target/sparc/win_helper.c
index b53fc9ce940..dab0ff00ccc 100644
--- a/target/sparc/win_helper.c
+++ b/target/sparc/win_helper.c
@@ -26,14 +26,7 @@
static inline void memcpy32(target_ulong *dst, const target_ulong *src)
  {
-    dst[0] = src[0];
-    dst[1] = src[1];
-    dst[2] = src[2];
-    dst[3] = src[3];
-    dst[4] = src[4];
-    dst[5] = src[5];
-    dst[6] = src[6];
-    dst[7] = src[7];
+    memcpy(dst, src, 8 * sizeof(target_ulong));
  }
void cpu_set_cwp(CPUSPARCState *env, int new_cwp)

Potentially we could go further and just remove the memcpy32 function.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]