aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Shi <powerman1st@163.com>2017-12-21 11:29:24 +0000
committerCherry Zhang <cherryyz@google.com>2017-12-21 16:30:51 +0000
commit14332ed5b8fb91cbf26f4f815862a883cfa9e310 (patch)
tree6f5ca34a355600d5f18d34c4e8ade34cbcc79260
parent5ad3c1cda2a36ca5ef934a7647956de45af6f67e (diff)
downloadgo-14332ed5b8fb91cbf26f4f815862a883cfa9e310.tar.xz
cmd/internal/obj/arm: fix wrong encoding of NMULAF/NMULAD/NMULSF/NMULSD
NMULAF/NMULAD/NMULSF/NMULSD are incorrectly encoded by the arm assembler. Instruction Right binary Current wrong binary "NMULAF F5, F6, F7" 0xee167a45 0xee167a05 "NMULAD F5, F6, F7" 0xee167b45 0xee167b05 "NMULSF F5, F6, F7" 0xee167a05 0xee167a45 "NMULSD F5, F6, F7" 0xee167b05 0xee167b45 This patch fixes this issue. fixes issue #23212 Change-Id: Ic9c203f92c34b90d6eef492a694c0e95b4d479c5 Reviewed-on: https://go-review.googlesource.com/85116 Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-rw-r--r--src/cmd/asm/internal/asm/testdata/armv6.s8
-rw-r--r--src/cmd/internal/obj/arm/asm5.go8
2 files changed, 8 insertions, 8 deletions
diff --git a/src/cmd/asm/internal/asm/testdata/armv6.s b/src/cmd/asm/internal/asm/testdata/armv6.s
index c6649bc1fb..361867fdc2 100644
--- a/src/cmd/asm/internal/asm/testdata/armv6.s
+++ b/src/cmd/asm/internal/asm/testdata/armv6.s
@@ -26,10 +26,10 @@ TEXT foo(SB), DUPOK|NOSPLIT, $0
MULAD F5, F6, F7 // 057b06ee
MULSF F5, F6, F7 // 457a06ee
MULSD F5, F6, F7 // 457b06ee
- NMULAF F5, F6, F7 // 057a16ee
- NMULAD F5, F6, F7 // 057b16ee
- NMULSF F5, F6, F7 // 457a16ee
- NMULSD F5, F6, F7 // 457b16ee
+ NMULAF F5, F6, F7 // 457a16ee
+ NMULAD F5, F6, F7 // 457b16ee
+ NMULSF F5, F6, F7 // 057a16ee
+ NMULSD F5, F6, F7 // 057b16ee
FMULAF F5, F6, F7 // 057aa6ee
FMULAD F5, F6, F7 // 057ba6ee
FMULSF F5, F6, F7 // 457aa6ee
diff --git a/src/cmd/internal/obj/arm/asm5.go b/src/cmd/internal/obj/arm/asm5.go
index 0439954fe9..04c91faef5 100644
--- a/src/cmd/internal/obj/arm/asm5.go
+++ b/src/cmd/internal/obj/arm/asm5.go
@@ -2940,13 +2940,13 @@ func (c *ctxt5) oprrr(p *obj.Prog, a obj.As, sc int) uint32 {
case AMULSF:
return o | 0xe<<24 | 0xa<<8 | 0x4<<4
case ANMULAD:
- return o | 0xe<<24 | 0x1<<20 | 0xb<<8
+ return o | 0xe<<24 | 0x1<<20 | 0xb<<8 | 0x4<<4
case ANMULAF:
- return o | 0xe<<24 | 0x1<<20 | 0xa<<8
+ return o | 0xe<<24 | 0x1<<20 | 0xa<<8 | 0x4<<4
case ANMULSD:
- return o | 0xe<<24 | 0x1<<20 | 0xb<<8 | 0x4<<4
+ return o | 0xe<<24 | 0x1<<20 | 0xb<<8
case ANMULSF:
- return o | 0xe<<24 | 0x1<<20 | 0xa<<8 | 0x4<<4
+ return o | 0xe<<24 | 0x1<<20 | 0xa<<8
case AFMULAD:
return o | 0xe<<24 | 0xa<<20 | 0xb<<8
case AFMULAF: