]> Cypherpunks repositories - gostls13.git/commit
math: simplify comparison in FMA when swapping p and z
authorsmasher164 <aindurti@gmail.com>
Thu, 6 Aug 2020 22:37:10 +0000 (18:37 -0400)
committerEmmanuel Odeke <emmanuel@orijtech.com>
Mon, 29 Mar 2021 06:45:05 +0000 (06:45 +0000)
commit6f90ee36e90cb6a6adfd29ee51f0ef8f7e507003
tree698be71c19ce5535080898d65bd42724211abaa5
parentd10241fcf63826d51e8d9c914ab0ad2ef9173151
math: simplify comparison in FMA when swapping p and z

Discovered by Junchen Li on CL 246858, the comparison before p and z are
swapped can be simplified from

    pe < ze || (pe == ze && (pm1 < zm1 || (pm1 == zm1 && pm2 < zm2)))

to

    pe < ze || pe == ze && pm1 < zm1

because zm2 is initialized to 0 before the branch.

Change-Id: Iee92d570038df2b0f8941ef6e422a022654ab2d6
Reviewed-on: https://go-review.googlesource.com/c/go/+/247241
Run-TryBot: Akhil Indurti <aindurti@gmail.com>
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/math/fma.go