From 6db98a3c51549eb5e1e481e9bca6ede7e8e15f54 Mon Sep 17 00:00:00 2001 From: David Chase Date: Thu, 5 May 2016 13:35:10 -0700 Subject: [PATCH] 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 Reviewed-by: Keith Randall TryBot-Result: Gobot Gobot --- src/runtime/softfloat_arm.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/softfloat_arm.go b/src/runtime/softfloat_arm.go index 648b2e1169..5f609c80d3 100644 --- a/src/runtime/softfloat_arm.go +++ b/src/runtime/softfloat_arm.go @@ -530,7 +530,7 @@ execute: case 0xeeb80ac0: // D[regd] = S[regm] (MOVWF) cmp := int32(m.freglo[regm]) if cmp < 0 { - fputf(regd, f64to32(fintto64(int64(-cmp)))) + fputf(regd, f64to32(fintto64(-int64(cmp)))) m.freglo[regd] ^= 0x80000000 } else { fputf(regd, f64to32(fintto64(int64(cmp)))) @@ -552,7 +552,7 @@ execute: case 0xeeb80bc0: // D[regd] = S[regm] (MOVWD) cmp := int32(m.freglo[regm]) if cmp < 0 { - fputd(regd, fintto64(int64(-cmp))) + fputd(regd, fintto64(-int64(cmp))) m.freghi[regd] ^= 0x80000000 } else { fputd(regd, fintto64(int64(cmp)))