Commit 6db98a3c authored by David Chase's avatar David Chase

cmd/compile: repair MININT conversion bug in arm softfloat

Negative-case conversion code was wrong for minimum int32,
used negate-then-widen instead of widen-then-negate.

Test already exists; this fixes the failure.

Fixes #15563.

Change-Id: I4b0b3ae8f2c9714bdcc405d4d0b1502ccfba2b40
Reviewed-on: https://go-review.googlesource.com/22830
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: default avatarKeith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 5f83bf60
...@@ -530,7 +530,7 @@ execute: ...@@ -530,7 +530,7 @@ execute:
case 0xeeb80ac0: // D[regd] = S[regm] (MOVWF) case 0xeeb80ac0: // D[regd] = S[regm] (MOVWF)
cmp := int32(m.freglo[regm]) cmp := int32(m.freglo[regm])
if cmp < 0 { if cmp < 0 {
fputf(regd, f64to32(fintto64(int64(-cmp)))) fputf(regd, f64to32(fintto64(-int64(cmp))))
m.freglo[regd] ^= 0x80000000 m.freglo[regd] ^= 0x80000000
} else { } else {
fputf(regd, f64to32(fintto64(int64(cmp)))) fputf(regd, f64to32(fintto64(int64(cmp))))
...@@ -552,7 +552,7 @@ execute: ...@@ -552,7 +552,7 @@ execute:
case 0xeeb80bc0: // D[regd] = S[regm] (MOVWD) case 0xeeb80bc0: // D[regd] = S[regm] (MOVWD)
cmp := int32(m.freglo[regm]) cmp := int32(m.freglo[regm])
if cmp < 0 { if cmp < 0 {
fputd(regd, fintto64(int64(-cmp))) fputd(regd, fintto64(-int64(cmp)))
m.freghi[regd] ^= 0x80000000 m.freghi[regd] ^= 0x80000000
} else { } else {
fputd(regd, fintto64(int64(cmp))) fputd(regd, fintto64(int64(cmp)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment