]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/mips: fix encoding of FCR registers
authorCherry Zhang <cherryyz@google.com>
Sun, 27 Oct 2019 02:48:15 +0000 (22:48 -0400)
committerCherry Zhang <cherryyz@google.com>
Tue, 29 Oct 2019 03:45:36 +0000 (03:45 +0000)
commitba0bab7b4fda1498f2ace58b9d38f0fb8c748f53
tree68cca5d6ae4a30f37a6267b30d6ce0c9c0685e46
parent97592b3c14e96eece91ddc91a188e08fd2ed2dfa
cmd/internal/obj/mips: fix encoding of FCR registers

The asm encoder generally assumes that the lowest 5 bits of the
REG_XX constants match the machine instruction encoding, i.e.
the lowest 5 bits is the register number. This was not true for
FCR registers and M registers. Make it so.

MOV Rx, FCRy was encoded as two machine instructions. The first
is unnecessary. Remove.

Change-Id: Ib988e6b109ba8f564337cdd31019c1a6f1881f5b
Reviewed-on: https://go-review.googlesource.com/c/go/+/203717
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/cmd/asm/internal/asm/testdata/mips64.s
src/cmd/internal/obj/mips/a.out.go
src/cmd/internal/obj/mips/asm0.go