]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/arm: better solution of .S/.P/.U/.W suffix check
authorBen Shi <powerman1st@163.com>
Sat, 14 Oct 2017 14:02:05 +0000 (14:02 +0000)
committerCherry Zhang <cherryyz@google.com>
Tue, 17 Oct 2017 15:18:12 +0000 (15:18 +0000)
commit47193dcc0c91a6e1a2d6f58d55b123fa626c19d6
tree26de64b77163b9a668b2e255aee6fe967778cb9c
parentf4faca60135bea528a29f454876efa642b00665e
cmd/internal/obj/arm: better solution of .S/.P/.U/.W suffix check

Current suffix check is based on instruction, which is not very
accurate. For example, "MOVW.S R1, R2" is valid, but
"MOVW.S $0xaaaaaaaa, R1" and "MOVW.P CPSR, R9" are not.

This patch fixes the above kinds of issues by checking suffix
based on []optab. And also more test cases are added.

fixes #20509

Change-Id: Ibad91be72c78eefa719412a83b4d44370d2202a8
Reviewed-on: https://go-review.googlesource.com/70910
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/asm/internal/asm/testdata/arm.s
src/cmd/asm/internal/asm/testdata/armerror.s
src/cmd/internal/obj/arm/asm5.go