]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/arm: report invalid .S/.P/.W suffix in ARM instructions
authorBen Shi <powerman1st@163.com>
Wed, 17 May 2017 07:00:27 +0000 (07:00 +0000)
committerCherry Zhang <cherryyz@google.com>
Mon, 22 May 2017 13:44:12 +0000 (13:44 +0000)
commit5e797879350e749e49dc627d717ca069b6c833f3
treec38d10e14bd82e795a27a99860551aa7b0497ffd
parent4bf6c566d31ab46c5a9123708fb3585e621b2557
cmd/internal/obj/arm: report invalid .S/.P/.W suffix in ARM instructions

Many instructions can not have a .S suffix, such as MULS, SWI, CLZ,
CMP, STREX and others. And so do .P and .W suffixes. Even wrong
assembly code is generated for some instructions with invalid
suffixes.

This patch tries to simplify .S/.W/.P checks. And a wrong assembly
test for arm is added.

fixes #20377

Change-Id: Iba1c99d9e6b7b16a749b4d93ca2102e17c5822fe
Reviewed-on: https://go-review.googlesource.com/43561
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/asm/internal/asm/endtoend_test.go
src/cmd/asm/internal/asm/testdata/arm.s
src/cmd/asm/internal/asm/testdata/armerror.s [new file with mode: 0644]
src/cmd/internal/obj/arm/asm5.go