From 96a10b9c8469110a0aa30ea2185ca55f4aefef99 Mon Sep 17 00:00:00 2001 From: Xiaodong Liu Date: Thu, 19 May 2022 20:01:10 +0800 Subject: [PATCH] runtime: implement duffzero/duffcopy for linux/loong64 Contributors to the loong64 port are: Weining Lu Lei Wang Lingqin Gong Xiaolin Zhao Meidan Li Xiaojuan Zhai Qiyuan Pu Guoqi Chen This port has been updated to Go 1.15.6: https://github.com/loongson/go Updates #46229 Change-Id: Ida040e76dc8172f60e6aee1ea2b5bce13ab3581e Reviewed-on: https://go-review.googlesource.com/c/go/+/368077 TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor Reviewed-by: Cherry Mui Auto-Submit: Ian Lance Taylor Run-TryBot: Ian Lance Taylor --- src/runtime/duff_loong64.s | 907 +++++++++++++++++++++++++++++++++++++ src/runtime/mkduff.go | 25 + 2 files changed, 932 insertions(+) create mode 100644 src/runtime/duff_loong64.s diff --git a/src/runtime/duff_loong64.s b/src/runtime/duff_loong64.s new file mode 100644 index 00000000000..7f78e4fa9f1 --- /dev/null +++ b/src/runtime/duff_loong64.s @@ -0,0 +1,907 @@ +// Code generated by mkduff.go; DO NOT EDIT. +// Run go generate from src/runtime to update. +// See mkduff.go for comments. + +#include "textflag.h" + +TEXT runtime·duffzero(SB), NOSPLIT|NOFRAME, $0-0 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + MOVV R0, 8(R19) + ADDV $8, R19 + RET + +TEXT runtime·duffcopy(SB), NOSPLIT|NOFRAME, $0-0 + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + MOVV (R19), R30 + ADDV $8, R19 + MOVV R30, (R20) + ADDV $8, R20 + + RET diff --git a/src/runtime/mkduff.go b/src/runtime/mkduff.go index f1e4ed75d0b..6b42b8524b4 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")