From 2fbed0dc6c4dffcfd586a990fc3d2aeb7e00d521 Mon Sep 17 00:00:00 2001 From: Lynn Boger Date: Mon, 22 Feb 2021 09:12:01 -0600 Subject: libgo: ensure memmove, memset 8 byte atomicity on ppc64x Go requires that pointer moves are done 8 bytes at a time, but gccgo uses libc's memmove and memset which does not require that, and there are some cases where an 8 byte move might be done as 4+4. To enforce 8 byte moves for memmove and memset, this adds a C implementation in libgo/runtime for memmove and memset to be used on ppc64le and ppc64. Asm implementations were considered but discarded to avoid different implementations for different target ISAs. Fixes golang/go#41428 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/294931 --- libgo/go/runtime/stubs.go | 2 -- 1 file changed, 2 deletions(-) (limited to 'libgo/go/runtime') diff --git a/libgo/go/runtime/stubs.go b/libgo/go/runtime/stubs.go index 6d20c38..dea7234 100644 --- a/libgo/go/runtime/stubs.go +++ b/libgo/go/runtime/stubs.go @@ -106,9 +106,7 @@ func reflect_memclrNoHeapPointers(ptr unsafe.Pointer, n uintptr) { memclrNoHeapPointers(ptr, n) } -// memmove copies n bytes from "from" to "to". //go:noescape -//extern __builtin_memmove func memmove(to, from unsafe.Pointer, n uintptr) //go:linkname reflect_memmove reflect.memmove -- cgit v1.1