Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/asm,cmd/compile,cmd/link,cmd/objdump: ppc64 ISA 3.1 support #44549

Open
pmur opened this issue Feb 23, 2021 · 8 comments
Open

cmd/asm,cmd/compile,cmd/link,cmd/objdump: ppc64 ISA 3.1 support #44549

pmur opened this issue Feb 23, 2021 · 8 comments
Labels
arch-ppc64x NeedsInvestigation
Milestone

Comments

@pmur
Copy link
Contributor

@pmur pmur commented Feb 23, 2021

This is a container task for implementing support for the upcoming POWER10 processor.

ISA 3.1 documentation can be found here.

Notable additions we would like to support in golang:

  • More crypto instructions
  • Support for PC relative load/store/add immediate
  • Prefixed instructions (two word instructions) for larger load/store/add immediate

The latter two features will require a bit of preparation work in the ppc64 backend. Go 1.17 development will focus on preparation work.

@cagedmantis cagedmantis added NeedsInvestigation arch-ppc64x labels Feb 24, 2021
@cagedmantis cagedmantis added this to the Backlog milestone Feb 24, 2021
@laboger
Copy link
Contributor

@laboger laboger commented Apr 7, 2021

There is work being done to provide support in the assembler and disassembler on ppc64x for some instructions in ISA 3.1. The Go compiler will not be generating any of these instructions yet but they can be assembled and verified that they assemble to the correct instruction bits. Based on the recent comment in golang-dev about the Go 1.17 freeze, should this be marked as part of the Go 1.17 milestone?

@pmur
Copy link
Contributor Author

@pmur pmur commented Apr 7, 2021

I would like to get the cmd/objdump support in for 1.17. It would be nice to get support for aligning prefixed opcodes in cmd/asm, but that is not a release blocker.

@Robert-M-Muench
Copy link

@Robert-M-Muench Robert-M-Muench commented Jul 11, 2021

A bit OT: Does/Can the Go compiler generate instructions for float128 FPU calculations on this architecture? I wonder because there is no float128 type. One of the big advantages of this architecture is the native float128 support.

@gopherbot
Copy link

@gopherbot gopherbot commented Sep 1, 2021

Change https://golang.org/cl/347050 mentions this issue: cmd/internal/obj/ppc64: support alignment of prefixed insn

@gopherbot
Copy link

@gopherbot gopherbot commented Sep 24, 2021

Change https://golang.org/cl/350152 mentions this issue: cmd/internal/obj/ppc64: rework argument classifications

@gopherbot
Copy link

@gopherbot gopherbot commented Sep 28, 2021

Change https://golang.org/cl/352791 mentions this issue: internal/cpu, internal/buildcfg: support GOPPC64=power10

@gopherbot
Copy link

@gopherbot gopherbot commented Oct 11, 2021

Change https://golang.org/cl/355149 mentions this issue: cmd/link: support ppc64 prefixed relocations for power10

@gopherbot
Copy link

@gopherbot gopherbot commented Oct 11, 2021

Change https://golang.org/cl/355150 mentions this issue: cmd/internal/obj: Use prefix insn in MOV* opcodes for GOPPC64=power10

gopherbot pushed a commit that referenced this issue Oct 12, 2021
Insert machine NOPs when a prefixed instruction crosses a 64B boundary.
ISA 3.1 prohibits prefixed instructions being placed across them. Such
instructions generate SIGILL if executed.

Likewise, adjust the function alignment to guarantee such instructions
can never cross one. And, don't pad the PC based on alignment. The
linker can fit these more optimally.

Likewise, include the function alignment when printing function debug
information. This is needed to verify function alignment happens.

Updates #44549

Change-Id: I434fb0ee4e984ca00dc4566f7569c3bcdf93f910
Reviewed-on: https://go-review.googlesource.com/c/go/+/347050
Run-TryBot: Paul Murphy <murp@ibm.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
gopherbot pushed a commit that referenced this issue Oct 21, 2021
This introduces a number of new classifications which will make it
easier to generate functions to assemble the new instructions of
ISA 3.1, and potentially earlier versions.

No code generation changes should occur as a result of these. These
allow finer control over how an opcode is matched to an optab entry.

Literal values are now classified based on the smallest number of bits
needed to encode, and matching rules will accept a literal if it
can be zero/sign extended to fit a larger literal class.

Likewise, support classifying even register numbers for GPR, VSX, and
FPR instructions. Some instructions require and even/odd register pair,
and these are usually represented by specifying the even register, and
similarly encoded.

Likewise, add a unit test for the argument classifier function (aclass).
This caught an off-by-one bug in aclass which is also fixed.

Updates #44549

Change-Id: Ia03013aea8b56c4d59b7c3812cdd67ddb3b720b9
Reviewed-on: https://go-review.googlesource.com/c/go/+/350152
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-ppc64x NeedsInvestigation
Projects
None yet
Development

No branches or pull requests

5 participants