Commit 14332ed5 authored by Ben Shi's avatar Ben Shi Committed by Cherry Zhang

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/85116Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 5ad3c1cd
......@@ -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
......
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment