]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/arm64: mark branch instructions in optab
authoreric fang <eric.fang@arm.com>
Tue, 9 Aug 2022 06:10:16 +0000 (06:10 +0000)
committerEric Fang <eric.fang@arm.com>
Fri, 18 Nov 2022 02:33:33 +0000 (02:33 +0000)
commit0613418c9865bb3fb04e26822f3d4f4a317a2540
tree1b886475559f2fe8c20ee6637b380cc4cbabf71c
parent0789ca4951f9c72e0a09051783276e3730d6db06
cmd/internal/obj/arm64: mark branch instructions in optab

Currently, we judge whether we need to fix up the branch instruction
based on Optab.type_ field, but the type_ field in optab may change.
This CL marks the branch instruction in optab, and checks whether to
do fixing up according to the mark. Depending on the constant parameter
range of the branch instruction, there are two labels, BRANCH14BITS,
BRANCH19BITS. For the 26-bit branch, linker will handle it.

Besides this CL removes the unnecessary alignment of the DWORD
instruction. Because the ISA doesn't require it and no 64-bit load
assume it. The only effect is that there is some performance penalty
for loading from DWORDs if the 8-byte DWORD instruction crosses the
cache line, but this is very rare.

Change-Id: I993902b3fb5ad8e081dd6c441e86bcf581031835
Reviewed-on: https://go-review.googlesource.com/c/go/+/424135
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Eric Fang <eric.fang@arm.com>
Reviewed-by: Joedian Reid <joedian@golang.org>
src/cmd/internal/obj/arm64/asm7.go