Skip to content

Commit

Permalink
cmd/internal/obj/arm: fix wrong encoding of MULBB
Browse files Browse the repository at this point in the history
"MULBB R1, R2, R3" is encoded to 0xe163f182, which should be
0xe1630182.

This patch fix it.

fix golang#20764

Change-Id: I9d3c3ffa40ecde86638e5e083eacc67578caebf4
Reviewed-on: https://go-review.googlesource.com/46491
Run-TryBot: Cherry Zhang <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Cherry Zhang <[email protected]>
  • Loading branch information
benshi001 authored and cherrymui committed Jun 23, 2017
1 parent ddeab53 commit 3785457
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cmd/asm/internal/asm/testdata/arm.s
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ jmp_label_3:
MULL R1, R2, (R4, R3) // 9231c4e0
MULL.S R1, R2, (R4, R3) // 9231d4e0
MMUL R1, R2, R3 // 12f153e7
MULBB R1, R2, R3 // 82f163e1
MULBB R1, R2, R3 // 820163e1
MULWB R1, R2, R3 // a20123e1
MULWT R1, R2, R3 // e20123e1

Expand Down
2 changes: 1 addition & 1 deletion src/cmd/internal/obj/arm/asm5.go
Original file line number Diff line number Diff line change
Expand Up @@ -2866,7 +2866,7 @@ func (c *ctxt5) oprrr(p *obj.Prog, a obj.As, sc int) uint32 {
return o&(0xf<<28) | 0x12<<20 | 0xa<<4

case AMULBB:
return o&(0xf<<28) | 0x16<<20 | 0xf<<12 | 0x8<<4
return o&(0xf<<28) | 0x16<<20 | 0x8<<4

case AMULAWT:
return o&(0xf<<28) | 0x12<<20 | 0xc<<4
Expand Down

0 comments on commit 3785457

Please sign in to comment.