]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/obj/arm: fix wrong encoding of NMULAF/NMULAD/NMULSF/NMULSD
authorBen Shi <powerman1st@163.com>
Thu, 21 Dec 2017 11:29:24 +0000 (11:29 +0000)
committerCherry Zhang <cherryyz@google.com>
Thu, 21 Dec 2017 16:30:51 +0000 (16:30 +0000)
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>

src/cmd/asm/internal/asm/testdata/armv6.s
src/cmd/internal/obj/arm/asm5.go

index c6649bc1fb4b94d6ea3901113844cb3b737460b0..361867fdc2fcfbb4a29eb323974ae1b82a612a6a 100644 (file)
@@ -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
index 0439954fe9e660a0757eb006bd2cfafab5a0d976..04c91faef5bc714432057af66e9fdf4d2c59737b 100644 (file)
@@ -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: