]> Cypherpunks repositories - gostls13.git/commit
[dev.cc] runtime: decode power64 branch instructions the way the CPU does
authorAustin Clements <austin@google.com>
Wed, 19 Nov 2014 19:24:41 +0000 (14:24 -0500)
committerAustin Clements <austin@google.com>
Wed, 19 Nov 2014 19:24:41 +0000 (14:24 -0500)
commitd11a42595940df79bbd73bfe54469f840952ab79
tree580722bccef788a4081ae7f897213490d392875d
parentb76e836042dd65b39cfe7af0f8ff5f73f12142a2
[dev.cc] runtime: decode power64 branch instructions the way the CPU does

Previously, this used the top 8 bits of an instruction as a
sort-of opcode and ignored the top two bits of the relative
PC.  This worked because these jumps are always negative and
never big enough for the top two bits of the relative PC (also
the bottom 2 bits of the sort-of opcode) to be anything other
than 0b11, but the code is confusing because it doesn't match
the actual structure of the instruction.

Instead, use the real 6 bit opcode and use all 24 bits of
relative PC.

LGTM=rsc
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/179960043
src/runtime/sys_power64x.go