]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/mips: support NEG, avoid crash with illegal instruction
authorCherry Zhang <cherryyz@google.com>
Thu, 25 Jan 2018 16:46:06 +0000 (11:46 -0500)
committerCherry Zhang <cherryyz@google.com>
Wed, 14 Feb 2018 17:09:37 +0000 (17:09 +0000)
commit0938e4cf90101ed718aebf63b583970267c87701
tree428a3c86423eb336e13fd578d9ec44aa616b9fca
parent1fccbfe90e80f214db0abf3ff0db5a0dfe0efdf3
cmd/internal/obj/mips: support NEG, avoid crash with illegal instruction

Add support of NEG{V,W} pseudo-instructions, which are translated
to a SUB instruction from R0 with proper width.

Also turn illegal instruction to UNDEF, to avoid crashing in
asmout when it tries to read the operands.

Fixes #23548.

Change-Id: I047b27559ccd9594c3dcf62ab039b636098f30a3
Reviewed-on: https://go-review.googlesource.com/89896
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/asm/internal/asm/testdata/mips.s
src/cmd/asm/internal/asm/testdata/mips64.s
src/cmd/internal/obj/mips/a.out.go
src/cmd/internal/obj/mips/anames.go
src/cmd/internal/obj/mips/asm0.go