]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/mips: add WSBH/DSBH/DSHD instructions
authorJunxian Zhu <zhujunxian@oss.cipunited.com>
Tue, 9 May 2023 11:11:20 +0000 (19:11 +0800)
committerJoel Sing <joel@sing.id.au>
Thu, 3 Aug 2023 05:31:56 +0000 (05:31 +0000)
commit83c4e533bcf71d86437a5aa9ffc9b5373208628c
tree0d0cbcda5cf6065f649c915b4e733e94fd6817ad
parent431612eacb1089ad2e264e2aea3b8c9370e9bc62
cmd/internal/obj/mips: add WSBH/DSBH/DSHD instructions

Add support for WSBH/DSBH/DSHD instructions, which are introduced in mips{32,64}r2.

WSBH reverse bytes within halfwords for 32-bit word, DSBH reverse bytes within halfwords for 64-bit doubleword, and DSHD reverse halfwords within doublewords. These instructions can be used to optimize byte swaps.

Ref: The MIPS64 Instruction Set, Revision 5.04: https://s3-eu-west-1.amazonaws.com/downloads-mips/documents/MD00087-2B-MIPS64BIS-AFP-05.04.pdf

Updates #60072

Change-Id: I31c043150fe8ac03027f413ef4cb2f3e435775e1
Reviewed-on: https://go-review.googlesource.com/c/go/+/493816
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
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