aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/mkduff.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/mkduff.go')
-rw-r--r--src/runtime/mkduff.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/runtime/mkduff.go b/src/runtime/mkduff.go
index f1e4ed75d0..6b42b8524b 100644
--- a/src/runtime/mkduff.go
+++ b/src/runtime/mkduff.go
@@ -36,6 +36,7 @@ func main() {
gen("386", notags, zero386, copy386)
gen("arm", notags, zeroARM, copyARM)
gen("arm64", notags, zeroARM64, copyARM64)
+ gen("loong64", notags, zeroLOONG64, copyLOONG64)
gen("ppc64x", tagsPPC64x, zeroPPC64x, copyPPC64x)
gen("mips64x", tagsMIPS64x, zeroMIPS64x, copyMIPS64x)
gen("riscv64", notags, zeroRISCV64, copyRISCV64)
@@ -176,6 +177,30 @@ func copyARM64(w io.Writer) {
fmt.Fprintln(w, "\tRET")
}
+func zeroLOONG64(w io.Writer) {
+ // R0: always zero
+ // R19 (aka REGRT1): ptr to memory to be zeroed - 8
+ // On return, R19 points to the last zeroed dword.
+ fmt.Fprintln(w, "TEXT runtime·duffzero(SB), NOSPLIT|NOFRAME, $0-0")
+ for i := 0; i < 128; i++ {
+ fmt.Fprintln(w, "\tMOVV\tR0, 8(R19)")
+ fmt.Fprintln(w, "\tADDV\t$8, R19")
+ }
+ fmt.Fprintln(w, "\tRET")
+}
+
+func copyLOONG64(w io.Writer) {
+ fmt.Fprintln(w, "TEXT runtime·duffcopy(SB), NOSPLIT|NOFRAME, $0-0")
+ for i := 0; i < 128; i++ {
+ fmt.Fprintln(w, "\tMOVV\t(R19), R30")
+ fmt.Fprintln(w, "\tADDV\t$8, R19")
+ fmt.Fprintln(w, "\tMOVV\tR30, (R20)")
+ fmt.Fprintln(w, "\tADDV\t$8, R20")
+ fmt.Fprintln(w)
+ }
+ fmt.Fprintln(w, "\tRET")
+}
+
func tagsPPC64x(w io.Writer) {
fmt.Fprintln(w)
fmt.Fprintln(w, "//go:build ppc64 || ppc64le")