aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/asm/internal
AgeCommit message (Collapse)Author
2024-01-25all: prealloc slice with possible minimum capabilitiesShulhan
2023-12-15cmd/asm: for arm, rewrite argument shifted right by 0 to left by 0.Keith Randall
Right shift by 0 has bad semantics. Make sure if we try to right shift by 0, do a left shift by 0 instead. CL 549955 handled full instructions with this strange no-op encoding. This CL handles the shift done to instruction register inputs. (The former is implemented using the latter, but not until deep inside the assembler.) Update #64715 Change-Id: Ibfabb4b13e2595551e58b977162fe005aaaa0ad1 Reviewed-on: https://go-review.googlesource.com/c/go/+/550335 Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com>
2023-12-15cmd/asm: fix encoding for arm right shift by constant 0Keith Randall
Right shifts, for some odd reasons, can encode shifts of constant 1-32 instead of 0-31. Left shifts, however, can encode shifts 0-31. When the shift amount is 0, arm recommends encoding right shifts using left shifts. Fixes #64715 Change-Id: Id3825349aa7195028037893dfe01fa0e405eaa51 Reviewed-on: https://go-review.googlesource.com/c/go/+/549955 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com>
2023-12-08cmd/internal/obj/arm64: fix invalid register pair for LDPeric fang
ZR register can be used in register pair of LDP, LDPW and LDPSW instructions, but now it's not allowed. This CL fixes this issue. Change-Id: I8467502de4664214e0b7dad0295c44f6cff16ee6 Reviewed-on: https://go-review.googlesource.com/c/go/+/547815 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Eric Fang <eric.fang@arm.com>
2023-12-07cmd/asm: print absolute PC for all patterns "off(PC)" in testEndToEndRuinan
Before this CL, testEndToEnd only turns the relative PC to absolute PC when pattern "off(PC)" is the suffix of an instruction. But there are some instructions like: ADR 10(PC), R10 it's also acceptable for the assembler while the pattern "off(PC)" is not a suffix, which makes the test fail. This CL fixes this issue by searching the pattern in the whole string instead of only in the suffix. Change-Id: I0cffedeb7b3c63abca7697671088cf993aff71ff Reviewed-on: https://go-review.googlesource.com/c/go/+/547235 Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ruinan Sun <Ruinan.Sun@arm.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
2023-11-22cmd/asm: fix the KMCTR instruction encoding and argument passingSrinivas Pokala
KMCTR encoding arguments incorrect way, which leading illegal instruction wherver we call KMCTR instruction.IBM z13 machine test's TestAESGCM test using gcmASM implementation, which uses KMCTR instruction to encrypt using AES in counter mode and the KIMD instruction for GHASH. z14+ machines onwards uses gcmKMA implementation for the same. Fixes #63387 Change-Id: I86aeb99573c3f636a71908c99e06a9530655aa5d Reviewed-on: https://go-review.googlesource.com/c/go/+/535675 Reviewed-by: Vishwanatha HD <vishwanatha.hd@ibm.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org>
2023-11-20all: add floating point option for ARM targetsLudi Rehak
This change introduces new options to set the floating point mode on ARM targets. The GOARM version number can optionally be followed by ',hardfloat' or ',softfloat' to select whether to use hardware instructions or software emulation for floating point computations, respectively. For example, GOARM=7,softfloat. Previously, software floating point support was limited to GOARM=5. With these options, software floating point is now extended to all ARM versions, including GOARM=6 and 7. This change also extends hardware floating point to GOARM=5. GOARM=5 defaults to softfloat and GOARM=6 and 7 default to hardfloat. For #61588 Change-Id: I23dc86fbd0733b262004a2ed001e1032cf371e94 Reviewed-on: https://go-review.googlesource.com/c/go/+/514907 Run-TryBot: Michael Knyszek <mknyszek@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Michael Knyszek <mknyszek@google.com>
2023-11-09cmd/internal/obj/ppc64: remove C_UCON optab matching classPaul E. Murphy
This optab matching rule was used to match signed 16 bit values shifted left by 16 bits. Unsigned 16 bit values greater than 0x7FFF<<16 were classified as C_U32CON which led to larger than necessary codegen. Instead, rewrite logical/arithmetic operations in the preprocessor pass to use the 16 bit shifted immediate operation (e.g ADDIS vs ADD). This simplifies the optab matching rules, while also minimizing codegen size for large unsigned values. Note, ADDIS sign-extends the constant argument, all others do not. For matching opcodes, this means: MOVD $is<<16,Rx becomes ADDIS $is,Rx or ORIS $is,Rx MOVW $is<<16,Rx becomes ADDIS $is,Rx ADD $is<<16,[Rx,]Ry becomes ADDIS $is[Rx,]Ry OR $is<<16,[Rx,]Ry becomes ORIS $is[Rx,]Ry XOR $is<<16,[Rx,]Ry becomes XORIS $is[Rx,]Ry Change-Id: I1a988d9f52517a04bb8dc2e41d7caf3d5fff867c Reviewed-on: https://go-review.googlesource.com/c/go/+/536735 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Run-TryBot: Paul Murphy <murp@ibm.com> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
2023-11-09cmd/internal/obj/riscv: improve handling of invalid assemblyJoel Sing
Currently, instruction validation failure will result in a panic during encoding. Furthermore, the errors generated do not include the PC or file/line information that is normally present. Fix this by: - Tracking and printing the *obj.Prog associated with the instruction, including the assembly instruction/opcode if it differs. This provides the standard PC and file/line prefix, which is also expected by assembly error end-to-end tests. - Not proceeding with assembly if errors exist - with the current design, errors are identified during validation, which is run via preprocess. Attempts to encode invalid instructions will intentionally panic. Add some additional riscv64 encoding errors, now that we can actually do so. Change-Id: I64a7b83680c4d12aebdc96c67f9df625b5ef90d3 Reviewed-on: https://go-review.googlesource.com/c/go/+/523459 Run-TryBot: Joel Sing <joel@sing.id.au> Reviewed-by: Mark Ryan <markdryan@rivosinc.com> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: M Zhuo <mzh@golangcn.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: M Zhuo <mzh@golangcn.org>
2023-11-07cmd/internal/obj/riscv: support subtraction with a constantJoel Sing
Allow SUB and SUBW to be specified with a constant, which are mapped to ADDI and ADDIW with negated values. Change-Id: I7dc55692febc81ea87393b0a3a7d23a43c30313b Reviewed-on: https://go-review.googlesource.com/c/go/+/538915 Run-TryBot: Joel Sing <joel@sing.id.au> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: M Zhuo <mzh@golangcn.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> Reviewed-by: Mark Ryan <markdryan@rivosinc.com> Reviewed-by: Wang Yaduo <wangyaduo@linux.alibaba.com> Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
2023-11-06cmd/internal/asm/ppc64: avoid generating exser nopsPaul E. Murphy
"OR $0, R31, R31" is the execution serializing nop called "exser" on ISA 3.1 processors such as Power10. In general, the "OR $0, Rx, Rx" where Rx != 0 form should be avoided unless used explicitly for the uarch side-effects. Change-Id: Id76e3a703c902676ba4a3ffb64dd90dad9a320bf Reviewed-on: https://go-review.googlesource.com/c/go/+/537855 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Run-TryBot: Paul Murphy <murp@ibm.com> Reviewed-by: Heschi Kreinick <heschi@google.com>
2023-10-20cmd/internal/obj/ppc64: refactor maskgenPaul E. Murphy
Refactor maskgen into decodeMask32. This is derived from from combining encodePPC64RotateMask and isWordRotateMask. Also, truncate me returned from decodeMask32/64 to be within range of [0,32/64). Change-Id: Ie9efff93d400b3066ac85276b1ad3c57c2fcf31b Reviewed-on: https://go-review.googlesource.com/c/go/+/536298 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Run-TryBot: Paul Murphy <murp@ibm.com> Reviewed-by: Than McIntosh <thanm@google.com>
2023-10-05cmd/internal/obj/ppc64: generate MOVD mask constants in registerPaul E. Murphy
Add a new form of RLDC which maps directly to the ISA definition of rldc: RLDC Rs, $sh, $mb, Ra. This is used to generate mask constants described below. Using MOVD $-1, Rx; RLDC Rx, $sh, $mb, Rx, any mask constant can be generated. A mask is a contiguous series of 1 bits, which may wrap. Change-Id: Ifcaae1114080ad58b5fdaa3e5fc9019e2051f282 Reviewed-on: https://go-review.googlesource.com/c/go/+/531120 Reviewed-by: Matthew Dempsky <mdempsky@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Run-TryBot: Paul Murphy <murp@ibm.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-10-04cmd/internal/obj/ppc64: generate small, shifted constants in registerPaul E. Murphy
Check for shifted 16b constants, and transform them to avoid the load penalty. This should be much faster than loading, and reduce binary size by reducing the constant pool size. Change-Id: I6834e08be7ca88e3b77449d226d08d199db84299 Reviewed-on: https://go-review.googlesource.com/c/go/+/531119 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Paul Murphy <murp@ibm.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-10-03cmd/internal/asm/ppc64: support 34b ADD/MOVD $const, RxPaul E. Murphy
For constant signed values which require 34b to represent, the assembler will generate a pli instruction on linux/power10/PPC64 instead of loading a constant. Similarly, ADD is extended to support 34b signed constants. On linux/power10/PPC64, this generates a paddi instruction. For assembler consistency, a second form is added if paddi cannot be used. The second form is provided for assembly writers. Change-Id: I98144306af766b02fbbe36b72856a23cdf51d247 Reviewed-on: https://go-review.googlesource.com/c/go/+/528317 TryBot-Result: Gopher Robot <gobot@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Eli Bendersky <eliben@google.com> Run-TryBot: Paul Murphy <murp@ibm.com> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
2023-09-19cmd/internal/obj/riscv,cmd/link: rework riscv64 call relocationsJoel Sing
The riscv64 assembler and linker generate three types of calls. Most calls are made via a single JAL instruction, however this is limited to +/-1MB of text. In the case where a call target is unreachable (or unknown), the JAL targets an AUIPC+JALR trampoline. All other cases use AUIPC+JALR pairs, including the case where a single function exceeds 1MB in text size, potentially making it impossible to reach trampolines. Currently, the single instruction JAL call is marked with R_RISCV_CALL and the two instruction AUIPC+JALR call is marked with R_RISCV_PCREL_ITYPE, which is also used for memory load instructions. This means that we have no way to identify that the latter is a call. Switch to using R_RISCV_CALL to mark the AUIPC+JALR pair (aligning somewhat with the elf.R_RISCV_CALL, which is deprecated in favour of elf.R_RISCV_CALL_PLT). Add R_RISCV_JAL and use this to mark the single instruction JAL direct calls. This is clearer and allows us to map elf.R_RISCV_CALL_PLT to Go's R_RISCV_CALL. Add all three types to IsDirectCall, so that direct calls are correctly identified when a function exceeds 1MB of text. Fixes #62465 Change-Id: Id3eea09688a2b7d6e481eae9ed0aa0d1f9a3a48f Reviewed-on: https://go-review.googlesource.com/c/go/+/520095 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Joel Sing <joel@sing.id.au> Reviewed-by: Than McIntosh <thanm@google.com>
2023-09-15cmd/internal/obj/ppc64: improve RLWNM encodingPaul E. Murphy
If the rotate argument is the constant 0, rlwnm may be generated instead of rlwinm. In all reasonable cases, this is OK as R0 should hold 0. However, this could be problematic in some cases when writing PPC64 assembly. This consolidates the RLWNM and RLWMI optab entries. Invalid RLWMI usage is still rejected, however the error will be be slightly different. The invalid usage will be caught in oprrr instead of oplook. Change-Id: I9958bd24660fea5f8fc9e3e50d51daa7349e3206 Reviewed-on: https://go-review.googlesource.com/c/go/+/527275 Reviewed-by: Heschi Kreinick <heschi@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Run-TryBot: Paul Murphy <murp@ibm.com>
2023-09-05cmd/asm: add KMA and KMCTR instructions on s390x.root
This CL is to add assembly instruction mnemonics for the following instructions, mainly used in crypto packages. * KMA - cipher message with authentication * KMCTR - cipher message with counter Fixes #61163 Change-Id: Iff9a69911aeb4fab4bca8755b23a106eaebb2332 Reviewed-on: https://go-review.googlesource.com/c/go/+/515195 Reviewed-by: Carlos Amedee <carlos@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com>
2023-08-29cmd/asm: stop using "" as the local package prefixMatthew Dempsky
Now that cmd/asm always knows its package path, we can create symbols with the appropriate package prefix instead of "". Change-Id: I56864089e8f1b38ff4197b3158131f976b329572 Reviewed-on: https://go-review.googlesource.com/c/go/+/523336 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Auto-Submit: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-08-29cmd: simplify some handling of package pathsMatthew Dempsky
We have obj.Link.Pkgpath, so we don't need to pass it redundantly in places where we already have an *obj.Link. Also, renaming the parser's "compilingRuntime" field to "allowABI", to match the "AllowAsmABI" name used by objabi.LookupPkgSpecial. Finally, push the handling of GOEXPERIMENT_* flags up to cmd/asm's main entry point, by simply appending them to flags.D. Change-Id: I6ada134522b0cbc90d35bcb145fbe045338fefb7 Reviewed-on: https://go-review.googlesource.com/c/go/+/523297 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-08-22cmd/asm,cmd/dist,cmd/go: remove asm -compiling-runtime flagAustin Clements
Currently, dist and go pass a -compiling-runtime flag to asm if they're compiling a runtime package. However, now that we always pass the package path to asm, it can make that determination just as well as its callers can. This CL moves that check into asm and drops the flag. This in turn makes dist's copy of IsRuntimePackagePath unnecessary, so we delete it. Change-Id: I6ecf2d50b5b83965012af34dbe5f9a973ba0778b Reviewed-on: https://go-review.googlesource.com/c/go/+/521697 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-08-11cmd/asm: add KDSA instruction supportSrinivas Pokala
KDSA(Compute Digital Signature Authentication) instruction provides support for the signing and verification of elliptic curves Change-Id: I19996a307162dd4f476a1cfe4f8d1a74a609e6c1 Reviewed-on: https://go-review.googlesource.com/c/go/+/503215 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-08-08cmd/internal/obj/mips: add SEB/SEH instructionsJunxian Zhu
Add support for SEB/SEH instructions, which are introduced in mips32r2. SEB/SEH can be used to sign-extend byte/halfword in registers directly without passing through memory. Ref: The MIPS32 Instruction Set, Revision 5.04: https://s3-eu-west-1.amazonaws.com/downloads-mips/documents/MD00086-2B-MIPS32BIS-AFP-05.04.pdf Updates #60072 Change-Id: I33175ae9d943ead5983ac004bd2a158039046d65 Reviewed-on: https://go-review.googlesource.com/c/go/+/515475 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Joel Sing <joel@sing.id.au>
2023-08-03cmd/asm,cmd/internal/obj/riscv,cmd/link: improve TLS handling on riscv64Joel Sing
The existing Thread Local Storage (TLS) implementation for riscv64 uses initial-exec (IE) mode, however a MOV of a TLS symbol currently loads the thread pointer offset and not the actual address or memory location. Rework TLS on riscv64 to generate the full instruction sequence needed to load from or store to a TLS symbol. Additionally, provide support for both initial-exec (IE) and local-exec (LE) TLS - in many cases we can use LE, which is slightly more efficient and easier to support in the linker. Change-Id: I1b43f8888b3b6b10354bbb79d604771e64d92645 Reviewed-on: https://go-review.googlesource.com/c/go/+/431103 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: M Zhuo <mzh@golangcn.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Joel Sing <joel@sing.id.au>
2023-08-03cmd/internal/obj/mips: add WSBH/DSBH/DSHD instructionsJunxian Zhu
Add support for WSBH/DSBH/DSHD instructions, which are introduced in mips{32,64}r2. WSBH reverse bytes within halfwords for 32-bit word, DSBH reverse bytes within halfwords for 64-bit doubleword, and DSHD reverse halfwords within doublewords. These instructions can be used to optimize byte swaps. Ref: The MIPS64 Instruction Set, Revision 5.04: https://s3-eu-west-1.amazonaws.com/downloads-mips/documents/MD00087-2B-MIPS64BIS-AFP-05.04.pdf Updates #60072 Change-Id: I31c043150fe8ac03027f413ef4cb2f3e435775e1 Reviewed-on: https://go-review.googlesource.com/c/go/+/493816 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Joel Sing <joel@sing.id.au> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Joel Sing <joel@sing.id.au>
2023-08-02cmd/asm: add s390x crypto related instructionsSrinivas Pokala
This CL add's the following instructions,useful for cipher and message digest operations: * KM - cipher message * KMC - cipher message with chaining * KLMD - compute last message digest * KIMD - compute intermediate message digest Fixes #61163 Change-Id: Ib0636430c3e4888ed61b86c5acae45ee596463ff Reviewed-on: https://go-review.googlesource.com/c/go/+/509075 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org>
2023-07-31cmd/internal/obj/arm64: improve splitting of 24 bit unsigned scaled immediatesJoel Sing
The previous implementation would limit itself to 0xfff000 | 0xfff << shift, while the maximum possible value is 0xfff000 + 0xfff << shift. In practical terms, this means that an additional ((1 << shift) - 1) * 0x1000 of offset is reachable for operations that use this splitting format. In the case of an 8 byte load/store, this is an additional 0x7000 that can be reached without needing to use the literal pool. Updates #59615 Change-Id: Ice7023104042d31c115eafb9398c2b999bdd6583 Reviewed-on: https://go-review.googlesource.com/c/go/+/512540 Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Joel Sing <joel@sing.id.au>
2023-07-31cmd/internal/obj/arm64: avoid unnecessary literal pool usage for movesJoel Sing
In a number of load and store cases, the use of the literal pool can be entirely avoided by simply adding or subtracting the offset from the register. This uses the same number of instructions, while avoiding a load from memory, along with the need for the value to be in the literal pool. Overall this reduces the size of binaries slightly and should have lower overhead. Updates #59615 Change-Id: I9cb6a403dc71e34a46af913f5db87dbf52f8688c Reviewed-on: https://go-review.googlesource.com/c/go/+/512539 Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Joel Sing <joel@sing.id.au>
2023-07-27cmd/asm/internal/asm: fix comment grammarJes Cok
Change-Id: I6fc0ae765c347669d1b061de018eb97d8e43461c GitHub-Last-Rev: 9e6c1f1f97c2c7edcc1dddd58db6d4d7bff57f1c GitHub-Pull-Request: golang/go#61131 Reviewed-on: https://go-review.googlesource.com/c/go/+/507515 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Joedian Reid <joedian@golang.org>
2023-07-27cmd/asm: add the fifth argument of the instruction to Optab on arm64erifan01
Currently the Optab structure contains four arguments of an instruction, excludes the fifth argument p.RegTo2. It does not participate in instruction matching and is usually handled separately. Instructions with five operands are common in the newer arm instruction set, so this CL adds the fifth argument to Optab, so that instruction matching is easier. This caused the oplook function also needs to be updated synchronously, this CL also made some cleaning and modifications to this function. Change-Id: I1d95ad99e72a44dfad1e00db182cfc369a0e55c6 Reviewed-on: https://go-review.googlesource.com/c/go/+/505975 Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Eric Fang <eric.fang@arm.com>
2023-07-26cmd/internal/obj/arm64: factor out splitting of 24 bit unsigned scaled ↵Joel Sing
immediates Rather than duplicating this code, factor it out into a function and add test coverage. Change-Id: I37ce568ded4659d98a4ff1361520c5fb2207e947 Reviewed-on: https://go-review.googlesource.com/c/go/+/512537 Run-TryBot: Joel Sing <joel@sing.id.au> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2023-07-24cmd/asm: initialize assembler before running error testserifan01
The Test{ARCH}Errors tests will call ctxt.Arch.Assemble, but this function requires the assembler has been initialized. So this CL adds a call to architecture.Init(ctxt) in testErrors, otherwise running Test{ARCH}Errors alone would fail. Change-Id: I4f3ba5a5fc1375d28779701989cf700cb4d1b635 Reviewed-on: https://go-review.googlesource.com/c/go/+/505976 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Eric Fang <eric.fang@arm.com>
2023-07-24cmd/asm: Fix encoding error of register offset shifted by 0 on arm64eric fang
The following instruction is wrongly encoded on arm64: MOVD (R2)(R3<<0), R1 It's incorrectly encoded as MOVD (R2)(R3<<3), R1 The reason for the error is that we hard-coded the shift encoding to 6, which is correct for the MOVB and MOVBU instructions because it only allows a shift amount of 0, but it is wrong for the MOVD instruction because it also allows other shift values. For instructions MOVB, MOVBU and FMOVB, the extension amount must be 0, encoded in "S" as 0 if omitted, or as 1 if present. But in Go, we don't distinguish between Rn.<EXT> and Rn.<EXT><<0, so we encode it as that does not present. This makes no difference to the function of the instruction. Change-Id: I2afe3498392cc9b2ecd524c7744f28b9d6d107b8 Reviewed-on: https://go-review.googlesource.com/c/go/+/510995 Reviewed-by: Heschi Kreinick <heschi@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Eric Fang <eric.fang@arm.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-07-20cmd/asm, cmd/internal/obj: generate proper atomic ops for riscv64Meng Zhuo
Go's memory model closely follows the approach C++ concurrency memory model (https://go.dev/ref/mem) and Go atomic "has the same semantics as C++'s sequentially consistent atomics". Meanwhile according to RISCV manual A.6 "Mappings from C/C++ primitives to RISC-V primitives". C/C++ atomic operations (memory_order_acq_rel) should be map to "amo<op>.{w|d}.aqrl" LR/SC (memory_order_acq_rel) should map to "lr.{w|d}.aq; <op>; sc.{w|d}.rl" goos: linux goarch: riscv64 pkg: runtime/internal/atomic │ atomic.old.bench │ atomic.new.bench │ │ sec/op │ sec/op vs base │ AtomicLoad64-4 4.216n ± 1% 4.202n ± 0% ~ (p=0.127 n=10) AtomicStore64-4 5.040n ± 0% 6.718n ± 0% +33.30% (p=0.000 n=10) AtomicLoad-4 4.217n ± 0% 4.213n ± 0% ~ (p=0.145 n=10) AtomicStore-4 5.040n ± 0% 6.718n ± 0% +33.30% (p=0.000 n=10) And8-4 9.237n ± 0% 9.240n ± 0% ~ (p=0.582 n=10) And-4 5.878n ± 0% 6.719n ± 0% +14.31% (p=0.000 n=10) And8Parallel-4 28.44n ± 0% 28.46n ± 0% +0.07% (p=0.000 n=10) AndParallel-4 28.40n ± 0% 28.43n ± 0% +0.11% (p=0.000 n=10) Or8-4 8.399n ± 0% 8.398n ± 0% ~ (p=0.357 n=10) Or-4 5.879n ± 0% 6.718n ± 0% +14.27% (p=0.000 n=10) Or8Parallel-4 28.43n ± 0% 28.45n ± 0% +0.09% (p=0.000 n=10) OrParallel-4 28.40n ± 0% 28.43n ± 0% +0.11% (p=0.000 n=10) Xadd-4 30.05n ± 0% 30.10n ± 0% +0.18% (p=0.000 n=10) Xadd64-4 30.05n ± 0% 30.09n ± 0% +0.12% (p=0.000 n=10) Cas-4 60.48n ± 0% 61.13n ± 0% +1.08% (p=0.000 n=10) Cas64-4 62.28n ± 0% 62.34n ± 0% ~ (p=0.810 n=10) Xchg-4 30.05n ± 0% 30.09n ± 0% +0.15% (p=0.000 n=10) Xchg64-4 30.05n ± 0% 30.09n ± 0% +0.13% (p=0.000 n=10) geomean 15.42n 16.17n +4.89% Fixes #61295 Change-Id: I97b5325db50467eeec36fb079bded7b09a32330f Reviewed-on: https://go-review.googlesource.com/c/go/+/508715 Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Joel Sing <joel@sing.id.au> Run-TryBot: M Zhuo <mzh@golangcn.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-29cmd/asm/internal/lex: fix comment, remove the first "has"Jes Cok
Change-Id: I429f0fa6c99ef576fe83c7bd0d1c1e176ecbb179 GitHub-Last-Rev: fb581b7f271f026182de0737c4fe5c360d5dea96 GitHub-Pull-Request: golang/go#61066 Reviewed-on: https://go-review.googlesource.com/c/go/+/507097 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com>
2023-06-15cmd/asm: fix encoding errors for FMOVD and FMOVS instructions on arm64eric fang
The encoding of instructions "FMOVD F1, ZR" and "FMOVS F1, ZR" is wrong, the assembler encodes them as "FMOVD F1, F31" and "FMOVS F1, F31". This CL fixes the bug. Change-Id: I2d31520b58f9950ce2534a04f4a3275bf103a673 Reviewed-on: https://go-review.googlesource.com/c/go/+/503135 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Eric Fang <eric.fang@arm.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2023-06-14all: fix spelling errorsAlexander Yastrebov
Fix spelling errors discovered using https://github.com/codespell-project/codespell. Errors in data files and vendored packages are ignored. Change-Id: I83c7818222f2eea69afbd270c15b7897678131dc GitHub-Last-Rev: 3491615b1b82832cc0064f535786546e89aa6184 GitHub-Pull-Request: golang/go#60758 Reviewed-on: https://go-review.googlesource.com/c/go/+/502576 Auto-Submit: Michael Pratt <mpratt@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com>
2023-05-24cmd/asm: refine some APIs related to Prog.RestArgs[]ruinan
Before this CL, we use GetFrom3&SetFrom3 to get or set a source operand which not fit into Prog.Reg. Those APIs operate the first element in Prog.RestArgs without checking the type so they're fragile to break if we have more than one different type of operands in the slice, which will be a common case in Arm64. This CL deprecates & renames some APIs related to Prog.RestArgs to make those APIs more reasonable and robust than before. Change-Id: I70d56edc1f23ccfffbcd6df34844e2cef2288432 Reviewed-on: https://go-review.googlesource.com/c/go/+/493355 Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Eric Fang <eric.fang@arm.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Eric Fang <eric.fang@arm.com>
2023-05-22cmd/asm: encode instructions like SHA1SU0 with a separate case for arm64Ruinan
Before this CL, instructions such as SHA1SU0, AESD and AESE are encoded in case 1 together with FMOV/ADD, and some error checking is missing, for example: SHA1SU0 V1.B16, V2.B16, V3.B16 // wrong data arrangement SHA1SU0 V1.4S, V2.S4, V3.S4 // correct Both will be accepted by the assembler, but the first one is totally incorrect. This CL fixes these potential encoding issues by moving them into separate cases, adds some error tests, and also fixes a wrong encoding operand for ASHA1C. Change-Id: Ic778321a567735d48bc34a1247ee005c4ed9e11f Reviewed-on: https://go-review.googlesource.com/c/go/+/493195 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-04-21internal/abi, runtime, cmd: merge PCDATA_* and FUNCDATA_* consts into ↵Austin Clements
internal/abi We also rename the constants related to unsafe-points: currently, they follow the same naming scheme as the PCDATA table indexes, but are not PCDATA table indexes. For #59670. Change-Id: I06529fecfae535be5fe7d9ac56c886b9106c74fd Reviewed-on: https://go-review.googlesource.com/c/go/+/485497 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Austin Clements <austin@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2023-04-11cmd/asm,cmd/internal/obj/x86: add RDPID instruction to x86 assemblerJoel Sing
Add support for the Read Processor ID (RDPID) instruction to the x86 assembler. This returns the current logical processor's ID in the specified register, as a faster alternative to RDTSCP. Fixes #56525 Change-Id: I43482e42431dfc385ce2e7f6d44b9746b0cc4548 Reviewed-on: https://go-review.googlesource.com/c/go/+/482955 Run-TryBot: Joel Sing <joel@sing.id.au> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com>
2023-04-10cmd/internal/obj/loong64, cmd/link/internal: switch to LoongArch ELF psABI ↵WANG Xuerui
v2 relocs The LoongArch ELF psABI v2 [1] relocs are vastly simplified from the v1 which involved a stack machine for computing the reloc values, but the details of PC-relative addressing are changed as well. Specifically, the `pcaddu12i` instruction is substituted with the `pcalau12i`, which is like arm64's `adrp` -- meaning the lower bits of a symbol's address now have to be absolute and not PC-relative. However, apart from the little bit of added complexity, the obvious advantage is that only 1 reloc needs to be emitted for every kind of external reloc we care about. This can mean substantial space savings (each RELA reloc occupies 24 bytes), and no open-coded stack ops has to remain any more. While at it, update the preset value for the output ELF's flags to indicate the psABI update. Fixes #58784 [1]: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html Change-Id: I5c13bc710eaf58293a32e930dd33feff2ef14c28 Reviewed-on: https://go-review.googlesource.com/c/go/+/455017 Run-TryBot: Ben Shi <powerman1st@163.com> Reviewed-by: xiaodong liu <teaofmoli@gmail.com> Reviewed-by: abner chenc <chenguoqi@loongson.cn> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Meidan Li <limeidan@loongson.cn> Auto-Submit: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2023-03-31cmd/internal/obj/loong64: assemble BEQ/BNEs comparing with 0 as beqz/bnezWANG Xuerui
LoongArch (except for the extremely reduced LA32 Primary subset) has dedicated beqz/bnez instructions as alternative encodings for beq/bne with one of the source registers being R0, that allow the offset field to occupy 5 more bits, giving 21 bits in total (equal to the FP branches). Make use of them instead of beq/bne if one source operand is omitted in asm, or if one of the registers being compared is R0. Multiple go1 benchmark runs indicate the change is not perf-sensitive. Change-Id: If6267623c82092e81d75578091fb4e013658b9f3 Reviewed-on: https://go-review.googlesource.com/c/go/+/478377 Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: abner chenc <chenguoqi@loongson.cn> Run-TryBot: Ben Shi <powerman1st@163.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Wayne Zuo <wdvxdr@golangcn.org>
2023-03-23all: replace leading spaces with tabs in assemblyMichael Pratt
Most of these are one-off mistakes. Only one file was all spaces. Change-Id: I277c3ce4a4811aa4248c90676f66bc775ae8d062 Reviewed-on: https://go-review.googlesource.com/c/go/+/478976 Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
2023-03-22cmd/internal/obj/loong64: realize all unconditional jumps with B/BLWANG Xuerui
The current practice of using the "PC-relative" `BEQ ZERO, ZERO` for short jumps is inherited from the MIPS port, where the pre-R6 long jumps are PC-regional instead of PC-relative. This quirk is not present in LoongArch from the very beginning so there is no reason to keep the behavior any more. While at it, simplify the code to not place anything in the jump offset field if a relocation is to take place. (It may be relic of a previous REL-era treatment where the addend is to be stored in the instruction word, but again, loong64 is exclusively RELA from day 1 so no point in doing so either.) Benchmark shows very slight improvement on a 3A5000 box, indicating the LA464 micro-architecture presumably *not* seeing the always-true BEQs as equivalent to B: goos: linux goarch: loong64 pkg: test/bench/go1 │ 2ef70d9d0f │ this CL │ │ sec/op │ sec/op vs base │ BinaryTree17 14.57 ± 4% 14.54 ± 1% ~ (p=0.353 n=10) Fannkuch11 3.570 ± 0% 3.570 ± 0% ~ (p=0.529 n=10) FmtFprintfEmpty 92.84n ± 0% 92.84n ± 0% ~ (p=0.970 n=10) FmtFprintfString 150.0n ± 0% 149.9n ± 0% ~ (p=0.350 n=10) FmtFprintfInt 153.3n ± 0% 153.3n ± 0% ~ (p=1.000 n=10) ¹ FmtFprintfIntInt 235.8n ± 0% 235.8n ± 0% ~ (p=0.963 n=10) FmtFprintfPrefixedInt 318.5n ± 0% 318.5n ± 0% ~ (p=0.474 n=10) FmtFprintfFloat 410.4n ± 0% 410.4n ± 0% ~ (p=0.628 n=10) FmtManyArgs 944.9n ± 0% 945.0n ± 0% ~ (p=0.240 n=10) GobDecode 13.97m ± 12% 12.83m ± 21% ~ (p=0.165 n=10) GobEncode 17.84m ± 5% 18.60m ± 4% ~ (p=0.123 n=10) Gzip 421.0m ± 0% 421.0m ± 0% ~ (p=0.579 n=10) Gunzip 89.80m ± 0% 89.77m ± 0% ~ (p=0.529 n=10) HTTPClientServer 86.54µ ± 1% 86.25µ ± 0% -0.33% (p=0.003 n=10) JSONEncode 18.57m ± 0% 18.57m ± 0% ~ (p=0.353 n=10) JSONDecode 77.48m ± 0% 77.30m ± 0% -0.23% (p=0.035 n=10) Mandelbrot200 7.217m ± 0% 7.217m ± 0% ~ (p=0.436 n=10) GoParse 7.599m ± 2% 7.632m ± 1% ~ (p=0.353 n=10) RegexpMatchEasy0_32 140.1n ± 0% 140.1n ± 0% ~ (p=0.582 n=10) RegexpMatchEasy0_1K 1.538µ ± 0% 1.538µ ± 0% ~ (p=1.000 n=10) ¹ RegexpMatchEasy1_32 161.7n ± 0% 161.7n ± 0% ~ (p=1.000 n=10) ¹ RegexpMatchEasy1_1K 1.632µ ± 0% 1.632µ ± 0% ~ (p=1.000 n=10) ¹ RegexpMatchMedium_32 1.369µ ± 0% 1.369µ ± 0% ~ (p=1.000 n=10) RegexpMatchMedium_1K 39.96µ ± 0% 39.96µ ± 0% +0.01% (p=0.010 n=10) RegexpMatchHard_32 2.099µ ± 0% 2.099µ ± 0% ~ (p=1.000 n=10) ¹ RegexpMatchHard_1K 62.50µ ± 0% 62.50µ ± 0% ~ (p=0.099 n=10) Revcomp 1.349 ± 0% 1.347 ± 0% -0.14% (p=0.001 n=10) Template 118.4m ± 0% 118.0m ± 0% -0.36% (p=0.023 n=10) TimeParse 407.8n ± 0% 407.9n ± 0% +0.02% (p=0.000 n=10) TimeFormat 508.0n ± 0% 507.9n ± 0% ~ (p=0.421 n=10) geomean 103.5µ 103.3µ -0.17% ¹ all samples are equal │ 2ef70d9d0f │ this CL │ │ B/s │ B/s vs base │ GobDecode 52.67Mi ± 11% 57.04Mi ± 17% ~ (p=0.149 n=10) GobEncode 41.03Mi ± 4% 39.35Mi ± 4% ~ (p=0.118 n=10) Gzip 43.95Mi ± 0% 43.95Mi ± 0% ~ (p=0.428 n=10) Gunzip 206.1Mi ± 0% 206.1Mi ± 0% ~ (p=0.399 n=10) JSONEncode 99.64Mi ± 0% 99.66Mi ± 0% ~ (p=0.304 n=10) JSONDecode 23.88Mi ± 0% 23.94Mi ± 0% +0.22% (p=0.030 n=10) GoParse 7.267Mi ± 2% 7.238Mi ± 1% ~ (p=0.360 n=10) RegexpMatchEasy0_32 217.8Mi ± 0% 217.8Mi ± 0% -0.00% (p=0.006 n=10) RegexpMatchEasy0_1K 635.0Mi ± 0% 635.0Mi ± 0% ~ (p=0.194 n=10) RegexpMatchEasy1_32 188.7Mi ± 0% 188.7Mi ± 0% ~ (p=0.338 n=10) RegexpMatchEasy1_1K 598.5Mi ± 0% 598.5Mi ± 0% -0.00% (p=0.000 n=10) RegexpMatchMedium_32 22.30Mi ± 0% 22.30Mi ± 0% ~ (p=0.211 n=10) RegexpMatchMedium_1K 24.43Mi ± 0% 24.43Mi ± 0% ~ (p=1.000 n=10) RegexpMatchHard_32 14.54Mi ± 0% 14.54Mi ± 0% ~ (p=0.474 n=10) RegexpMatchHard_1K 15.62Mi ± 0% 15.62Mi ± 0% ~ (p=1.000 n=10) ¹ Revcomp 179.7Mi ± 0% 180.0Mi ± 0% +0.14% (p=0.001 n=10) Template 15.63Mi ± 0% 15.68Mi ± 0% +0.34% (p=0.022 n=10) geomean 60.29Mi 60.44Mi +0.24% ¹ all samples are equal Change-Id: I112dd663c49567386ea75dd4966a9f8127ffb90e Reviewed-on: https://go-review.googlesource.com/c/go/+/478075 Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-03-22cmd/internal/obj/ppc64: add VC[LT]ZLSBB instructionsPaul E. Murphy
These are ISA 3.0 power9 instructions which are helpful when reducing a vector compare result into a GPR. They are used in a future patch to improve the bytes.IndexByte asm routine. Change-Id: I424e2628e577167b9b7c0fcbd82099daf568ea35 Reviewed-on: https://go-review.googlesource.com/c/go/+/478115 Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> Run-TryBot: Paul Murphy <murp@ibm.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
2023-03-21cmd/internal/obj/loong64: add support for movgr2cf and movcf2gr instructionsHuang Qiqi
Change-Id: I7ff3c8df24ed7990fe104bc2530354c0bd5fe018 Reviewed-on: https://go-review.googlesource.com/c/go/+/475576 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: abner chenc <chenguoqi@loongson.cn> Reviewed-by: xiaodong liu <teaofmoli@gmail.com> Reviewed-by: WANG Xuerui <git@xen0n.name>
2023-03-21cmd/asm, runtime: remove the RSB register from loong64WANG Xuerui
It was carryover from the mips64 port (where it represented the platform GP register) but LoongArch platform ABI doesn't have the GP concept. Change-Id: Iea326ae13676e95b040b52aaadc08d311b507bd3 Reviewed-on: https://go-review.googlesource.com/c/go/+/475815 Reviewed-by: abner chenc <chenguoqi@loongson.cn> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2023-03-15cmd/asm: improve detector for incorrect R15 usage when dynamic linkingKeith Randall
Fixes #58632 Change-Id: Idb19af2ac693ea5920da57c1808f1bc02702929d Reviewed-on: https://go-review.googlesource.com/c/go/+/476295 Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com> Run-TryBot: Keith Randall <khr@golang.org>
2023-03-08cmd/internal/obj/ppc64: add SETB instructionPaul E. Murphy
This ISA 3.0 (power9) instruction is helpful for some string functions in a future change. Change-Id: I1a659488ffb5099f8c89f480c39af4ef9c4b556a Reviewed-on: https://go-review.googlesource.com/c/go/+/472635 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Archana Ravindar <aravind5@in.ibm.com> Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Run-TryBot: Paul Murphy <murp@ibm.com> TryBot-Result: Gopher Robot <gobot@golang.org>