]> Cypherpunks repositories - gostls13.git/commit
cmd/asm: add check for register and shift/extension combination on arm64
authoreric fang <eric.fang@arm.com>
Wed, 21 Apr 2021 03:12:20 +0000 (03:12 +0000)
committereric fang <eric.fang@arm.com>
Wed, 28 Apr 2021 01:19:40 +0000 (01:19 +0000)
commit9726c78539f4945087c837201c1ec3545a318389
tree377e22c003d5b6e7d6ca6ffb6bc3458bb366ac09
parentf439a762533f3a75eb928b67d0415010aa8a81d7
cmd/asm: add check for register and shift/extension combination on arm64

The current code lacks a check on whether the register and shift/extension
combination is valid, for example the follow instructions also compiles.
ADD     F1<<1, R1, R3
ADD     V1<<1, R1, R3
MOVW    (R9)(F8.SXTW<<2), R19
VST1    R4.D[1], (R0)

Actually only general registers can perform shift operations, and element
and arrangement extensions are only applicable to vector registers. This
CL adds a check for the register and shift/extension combination on arm64.

Change-Id: I93dd9343e92a66899cba8eaf4e0ac5430e94692b
Reviewed-on: https://go-review.googlesource.com/c/go/+/312571
Trust: eric fang <eric.fang@arm.com>
Reviewed-by: eric fang <eric.fang@arm.com>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: eric fang <eric.fang@arm.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/cmd/asm/internal/arch/arm64.go
src/cmd/asm/internal/asm/parse.go
src/cmd/asm/internal/asm/testdata/arm64error.s