go/src/math/bits
Michael Munday ab7a65f283 cmd/compile: clean up codegen for branch-on-carry on s390x
This CL optimizes code that uses a carry from a function such as
bits.Add64 as the condition in an if statement. For example:

    x, c := bits.Add64(a, b, 0)
    if c != 0 {
        panic("overflow")
    }

Rather than converting the carry into a 0 or a 1 value and using
that as an input to a comparison instruction the carry flag is now
used as the input to a conditional branch directly. This typically
removes an ADD LOGICAL WITH CARRY instruction when user code is
doing overflow detection and is closer to the code that a user
would expect to generate.

Change-Id: I950431270955ab72f1b5c6db873b6abe769be0da
Reviewed-on: https://go-review.googlesource.com/c/go/+/219757
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2020-04-22 20:11:06 +00:00
..
bits.go math/bits: add Rem, Rem32, Rem64 2019-10-18 13:47:36 +00:00
bits_errors.go math/bits: add gccgo-friendly code for compiler bootstrap 2019-04-04 18:17:30 +00:00
bits_errors_bootstrap.go math/bits: add gccgo-friendly code for compiler bootstrap 2019-04-04 18:17:30 +00:00
bits_tables.go
bits_test.go cmd/compile: clean up codegen for branch-on-carry on s390x 2020-04-22 20:11:06 +00:00
example_test.go math/bits: add example for OnesCount function 2019-05-20 18:16:09 +00:00
export_test.go
make_examples.go
make_tables.go