The canonical LoongArch NOP instruction form is "andi r0, r0, 0", as
described in the LoongArch Reference Manual Volume 1, Section 2.2.1.10.
We currently use NOR instead, which may or may not change anything (e.g.
performance on less capable micro-architectures) but is deviation from
upstream standards nevertheless. Fix them to use the explicit hardware
NOP which happens to be supported as `NOOP`.
Change-Id: I0a799a1da959e9c3b582feb88202df2bab0ab23a
Reviewed-on: https://go-review.googlesource.com/c/go/+/475615
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
}
func ginsnop(pp *objw.Progs) *obj.Prog {
- p := pp.Prog(loong64.ANOR)
- p.From.Type = obj.TYPE_REG
- p.From.Reg = loong64.REG_R0
- p.To.Type = obj.TYPE_REG
- p.To.Reg = loong64.REG_R0
+ p := pp.Prog(loong64.ANOOP)
return p
}
// The top-most function running on a goroutine
// returns to goexit+PCQuantum.
TEXT runtime·goexit(SB),NOSPLIT|NOFRAME|TOPFRAME,$0-0
- NOR R0, R0 // NOP
+ NOOP
JAL runtime·goexit1(SB) // does not return
// traceback from goexit1 must hit code range of goexit
- NOR R0, R0 // NOP
+ NOOP
TEXT ·checkASM(SB),NOSPLIT,$0-1
MOVW $1, R19