]> Cypherpunks repositories - gostls13.git/commit
cmd/asm: add 'insert program mask' instruction for s390x
authorMichael Munday <mike.munday@ibm.com>
Thu, 7 Mar 2019 13:18:38 +0000 (13:18 +0000)
committerMichael Munday <mike.munday@ibm.com>
Fri, 29 Mar 2019 17:34:06 +0000 (17:34 +0000)
commit6966b67510df9a96dd798e5f6e26c5ad6dd925a5
tree2932b588962019cdbeb3185d9bfdf17ce975b441
parent95f18757a0fa283c4237ca03b48049980fe9b9c3
cmd/asm: add 'insert program mask' instruction for s390x

This CL adds the 'insert program mask' (IPM) instruction to s390x.
IPM stores the current program mask (which contains the condition
code) into a general purpose register.

This instruction will be useful when implementing intrinsics for
the arithmetic functions in the math/bits package. We can also
potentially use it to convert some condition codes into bool
values.

The condition code can be saved and restored using an instruction
sequence such as:

  IPM  R4          // save condition code to R4
  ...
  TMLH R4, $0x3000 // restore condition code from R4

We can also use IPM to save the carry bit to a register using an
instruction sequence such as:

  IPM     R4                   // save condition code to R4
  RISBLGZ $31, $31, $3, R4, R4 // isolate carry bit in R4

Change-Id: I169d450b6ea1a7ff8c0286115ddc42618da8a2f4
Reviewed-on: https://go-review.googlesource.com/c/go/+/165997
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/asm/internal/asm/testdata/s390x.s
src/cmd/internal/obj/s390x/a.out.go
src/cmd/internal/obj/s390x/anames.go
src/cmd/internal/obj/s390x/asmz.go