]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix uint64 to float casts on ppc64
authorMichael Munday <munday@ca.ibm.com>
Wed, 4 May 2016 18:26:46 +0000 (14:26 -0400)
committerMichael Munday <munday@ca.ibm.com>
Wed, 4 May 2016 23:23:58 +0000 (23:23 +0000)
commit1f4f2d0d39ceac483f3d42eb25ec992cdaf257f3
tree44cefa163a11afb4894bc524adb7a0a60dc2c67e
parent3747c00923b140847f5d8f7978e672fa79e3ec37
cmd/compile: fix uint64 to float casts on ppc64

Adds the FCFIDU instruction and uses it instead of the FCFID
instruction for unsigned integer to float casts. This change means
that unsigned integers do not have to be cast to signed integers
before being cast to a floating point value. Therefore it is no
longer necessary to insert instructions to detect and fix
values that overflow int64.

The previous code generating the uint64 to int64 cast handled
overflow by truncating the uint64 value. This truncation can
change the result of the rounding performed by the integer to
float cast.

The FCFIDU instruction was added in Power ISA 2.06B.

Fixes #15539.

Change-Id: Ia37a9631293eff91032d4cd9a9bec759d2142437
Reviewed-on: https://go-review.googlesource.com/22772
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/ppc64/gsubr.go
src/cmd/compile/internal/ppc64/peep.go
src/cmd/compile/internal/ppc64/prog.go
src/cmd/internal/obj/ppc64/a.out.go
src/cmd/internal/obj/ppc64/anames.go
src/cmd/internal/obj/ppc64/asm9.go