[mirror] architecture code
Перейти к файлу
Lynn Boger 5a4828bb70 ppc64: fixes for ppc64 objdump
The current output for the Go objdump on ppc64 is not correct
in many cases, generating opcodes that are not acceptable by the
Go assembler, and generating operands in the wrong order.

This adds some changes to generate an objdump for ppc64 code so that
the instructions generated are acceptable by the Go assembler,
and where some of the non-obvious operands have more meaningful names.

This includes the following changes:
- Correct some errors in ppc64map to make it work.
- Make a minor update to ppc64.csv to add the Go opcodes that have been
added to the Go assembler that were not in the table.
- Fix ppc64map to generate correct Go opcodes for ppc64 opcodes that end with '.'
indicating condition codes are set. The previous ppc64map was adding '_' at the end
for this case, but then had to be translated in plan9.go to 'CC' and many were not
being translated. This generates the correct suffix in the first step when
generating tables.go.
- Handle compare instructions correctly, since the names don't quite match
and the CR was not always handled correctly.
- Handle index loads and stores correctly, including VMX and VSX.
- Add mappings for all the names where the Go opcode does not match the ppc64 opcode.
- Handle all CR values, not just CR0 for those instructions that use them.
- Provide more information on BC instructions and generate the correct
branch mnemonic (BEQ, BNE, etc.) where possible.
- Make the output more consistent in spacing.
- Add some more testcases to testdata/decode.txt.
- If the instruction word is all 0s, the Go assembler will output WORD $0,
otherwise unrecognized instructions will be identified with '?'. For GNU,
all 0s will decode to .long 0x0 like the binutils objdump. This can happen
following a call to a panic or throw as a trap, or at the end of a function
for alignment purposes.

Note: the decoder does not handle extended opcodes correctly yet. I will add
that support in the next release and add the corresponding testcases.

We are working on an updated ppc64.csv, but I believe what is
there now covers the opcodes that are supported by the Go assembler.

Change-Id: If7fe1a2205512b476f4fb6b29a21f5459430e50c
Reviewed-on: https://go-review.googlesource.com/c/148574
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2018-12-03 22:54:21 +00:00
arm all: use io.SeekStart constant instead of 0 2018-04-06 14:08:48 +00:00
arm64 arm64/arm64asm: recognise new ssbb/pssbb mnemonics from objdump 2018-09-20 14:58:03 +00:00
ppc64 ppc64: fixes for ppc64 objdump 2018-12-03 22:54:21 +00:00
vendor arm/armspec, vendor/rsc.io/pdf: require Go 1.6+ for use of vendored packages 2016-07-15 20:53:32 +00:00
x86 x86/x86avxgen: enable AVX512 encoder tables generation 2018-05-16 17:50:55 +00:00
AUTHORS arch: initial boilerplate 2015-08-27 12:23:37 -04:00
CONTRIBUTING.md CONTRIBUTING.md: remove note about not accepting Pull Requests 2018-03-14 18:02:28 +00:00
CONTRIBUTORS arch: initial boilerplate 2015-08-27 12:23:37 -04:00
LICENSE arch: initial boilerplate 2015-08-27 12:23:37 -04:00
PATENTS arch: initial boilerplate 2015-08-27 12:23:37 -04:00
README.md README: style syntax to markdown 2017-09-29 20:28:58 +00:00
codereview.cfg arch: initial boilerplate 2015-08-27 12:23:37 -04:00

README.md

arch

This repository holds machine architecture information used by the Go toolchain. The parts needed in the main Go repository are copied in.

This repository requires Go 1.5+ with the vendor experiment enabled.