diff options
| author | Xiaolin Zhao <zhaoxiaolin@loongson.cn> | 2025-09-04 19:13:23 +0800 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-09-05 08:42:28 -0700 |
| commit | f5b20689e9a055223a6dbb6b63f53648ed02cd74 (patch) | |
| tree | d59e5984be8367a6010d5ca1bb65f3f7dff02587 /test/codegen | |
| parent | 3492e4262b751c5a117a3c77ba5e243b16918e61 (diff) | |
| download | go-f5b20689e9a055223a6dbb6b63f53648ed02cd74.tar.xz | |
cmd/compile: optimize loads from readonly globals into constants on loong64
Ref: CL 141118
Update #26498
Change-Id: I9c4ad2bedc4d50bd273bbe9119a898d4fca95e45
Reviewed-on: https://go-review.googlesource.com/c/go/+/700875
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'test/codegen')
| -rw-r--r-- | test/codegen/strings.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/codegen/strings.go b/test/codegen/strings.go index 64dcf4c842..fbcef57cd1 100644 --- a/test/codegen/strings.go +++ b/test/codegen/strings.go @@ -39,6 +39,7 @@ func ConstantLoad() { // 386:`MOVW\t\$12592, \(`,`MOVB\t\$50, 2\(` // arm:`MOVW\t\$48`,`MOVW\t\$49`,`MOVW\t\$50` // arm64:`MOVD\t\$12592`,`MOVD\t\$50` + // loong64:`MOVV\t\$12592`,`MOVV\t\$50` // wasm:`I64Const\t\$12592`,`I64Store16\t\$0`,`I64Const\t\$50`,`I64Store8\t\$2` // mips64:`MOVV\t\$48`,`MOVV\t\$49`,`MOVV\t\$50` bsink = []byte("012") @@ -48,6 +49,7 @@ func ConstantLoad() { // amd64:`MOVL\t\$858927408`,`MOVW\t\$13620, 4\(` // 386:`MOVL\t\$858927408`,`MOVW\t\$13620, 4\(` // arm64:`MOVD\t\$858927408`,`MOVD\t\$13620` + // loong64:`MOVV\t\$858927408`,`MOVV\t\$13620` // wasm:`I64Const\t\$858927408`,`I64Store32\t\$0`,`I64Const\t\$13620`,`I64Store16\t\$4` bsink = []byte("012345") @@ -56,19 +58,23 @@ func ConstantLoad() { // amd64:`MOVQ\t\$3978425819141910832`,`MOVQ\t\$7306073769690871863` // 386:`MOVL\t\$858927408, \(`,`DUFFCOPY` // arm64:`MOVD\t\$3978425819141910832`,`MOVD\t\$7306073769690871863`,`MOVD\t\$15` + // loong64:`MOVV\t\$3978425819141910832`,`MOVV\t\$7306073769690871863`,`MOVV\t\$15` // wasm:`I64Const\t\$3978425819141910832`,`I64Store\t\$0`,`I64Const\t\$7306073769690871863`,`I64Store\t\$7` bsink = []byte("0123456789abcde") // 56 = 0x38 // amd64:`MOVQ\t\$3978425819141910832`,`MOVB\t\$56` + // loong64:`MOVV\t\$3978425819141910832`,`MOVV\t\$56` bsink = []byte("012345678") // 14648 = 0x3938 // amd64:`MOVQ\t\$3978425819141910832`,`MOVW\t\$14648` + // loong64:`MOVV\t\$3978425819141910832`,`MOVV\t\$14648` bsink = []byte("0123456789") // 1650538808 = 0x62613938 // amd64:`MOVQ\t\$3978425819141910832`,`MOVL\t\$1650538808` + // loong64:`MOVV\t\$3978425819141910832`,`MOVV\t\$1650538808` bsink = []byte("0123456789ab") } |
