From 68a32ced0f7b1b9abf9fd948db53c668ef6b1c66 Mon Sep 17 00:00:00 2001 From: Junxian Zhu Date: Wed, 12 Jul 2023 19:07:55 +0800 Subject: [PATCH] cmd/compile/internal/mips: use hardware NOP instruction as NOOP on mips platform This CL uses mips hardware NOP instruction as NOOP on mips platform, instead of pseudo NOP "nor $zero,$zero,$zero". Change-Id: I336e1ba4228b71e6bfc6be66b367a4327fb3b36e Reviewed-on: https://go-review.googlesource.com/c/go/+/509015 Reviewed-by: David Chase Reviewed-by: Joel Sing Run-TryBot: Joel Sing Reviewed-by: Keith Randall TryBot-Result: Gopher Robot Reviewed-by: Keith Randall --- src/cmd/compile/internal/mips/ggen.go | 6 +----- src/cmd/compile/internal/mips64/ggen.go | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/cmd/compile/internal/mips/ggen.go b/src/cmd/compile/internal/mips/ggen.go index a18440e7b3c..e235ef95676 100644 --- a/src/cmd/compile/internal/mips/ggen.go +++ b/src/cmd/compile/internal/mips/ggen.go @@ -46,10 +46,6 @@ func zerorange(pp *objw.Progs, p *obj.Prog, off, cnt int64, _ *uint32) *obj.Prog } func ginsnop(pp *objw.Progs) *obj.Prog { - p := pp.Prog(mips.ANOR) - p.From.Type = obj.TYPE_REG - p.From.Reg = mips.REG_R0 - p.To.Type = obj.TYPE_REG - p.To.Reg = mips.REG_R0 + p := pp.Prog(mips.ANOOP) return p } diff --git a/src/cmd/compile/internal/mips64/ggen.go b/src/cmd/compile/internal/mips64/ggen.go index 37bb871958b..5f3f3e64d9c 100644 --- a/src/cmd/compile/internal/mips64/ggen.go +++ b/src/cmd/compile/internal/mips64/ggen.go @@ -50,10 +50,6 @@ func zerorange(pp *objw.Progs, p *obj.Prog, off, cnt int64, _ *uint32) *obj.Prog } func ginsnop(pp *objw.Progs) *obj.Prog { - p := pp.Prog(mips.ANOR) - p.From.Type = obj.TYPE_REG - p.From.Reg = mips.REG_R0 - p.To.Type = obj.TYPE_REG - p.To.Reg = mips.REG_R0 + p := pp.Prog(mips.ANOOP) return p }