]> Cypherpunks repositories - gostls13.git/commit
cmd/asm: add new classification for index memory operands on PPC64
authorArchana R <aravind5@in.ibm.com>
Wed, 11 May 2022 15:48:48 +0000 (10:48 -0500)
committerLynn Boger <laboger@linux.vnet.ibm.com>
Tue, 30 Aug 2022 12:42:54 +0000 (12:42 +0000)
commit67d85ad00f9d9be0cc2bb1bb96d01c3d40dcb376
treebdf38d3afd2557a4f6f0695578a2a624a518c497
parent4381c61c58315dbdb8004bf56e54a5d2aa5d0498
cmd/asm: add new classification for index memory operands on PPC64

When a base+displacement kind of operand is given in an index-mode
instruction, the assembler does not flag it as an invalid instruction
causing the user to get an incorrect encoding of that instruction
leading to incorrect execution of the program.
Enable assembler to recognize valid and invalid operands used in index
mode instructions by classifying SOREG type into two further types
XOREG (used uniquely in index addressing mode instructions) and SOREG
for instructions working on base+displacement operands.
Also cleaned up usage of obj.Addr.Scale on PPC64.

Change-Id: Ib4d84343ae57477c6c074f44c4c2749496e11b91
Reviewed-on: https://go-review.googlesource.com/c/go/+/405542
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Archana Ravindar <aravind5@in.ibm.com>
src/cmd/asm/internal/asm/operand_test.go
src/cmd/asm/internal/asm/parse.go
src/cmd/asm/internal/asm/testdata/ppc64.s
src/cmd/internal/obj/ppc64/a.out.go
src/cmd/internal/obj/ppc64/anames9.go
src/cmd/internal/obj/ppc64/asm9.go
src/cmd/internal/obj/ppc64/asm_test.go