From 102436e800d161dfd8b884278d1ddc5101f562dd Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Thu, 30 Apr 2015 19:03:31 -0400 Subject: runtime: fix software FP regs corruption when emulating SQRT on ARM When emulating ARM FSQRT instruction, the sqrt function itself should not use any floating point arithmetics, otherwise it will clobber the user software FP registers. Fortunately, the sqrt function only uses floating point instructions to test for corner cases, so it's easy to make that function does all it job using pure integer arithmetic only. I've verified that after this change, runtime.stepflt and runtime.sqrt doesn't contain any call to _sfloat. (Perhaps we should add //go:nosfloat to make the compiler enforce this?) Fixes #10641. Change-Id: Ida4742c49000fae4fea4649f28afde630ce4c576 Signed-off-by: Shenghou Ma Reviewed-on: https://go-review.googlesource.com/9570 Reviewed-by: Dave Cheney Reviewed-by: Keith Randall --- src/runtime/export_test.go | 1 + 1 file changed, 1 insertion(+) (limited to 'src/runtime/export_test.go') diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go index 1b5f267b8b..e0c8b17bd3 100644 --- a/src/runtime/export_test.go +++ b/src/runtime/export_test.go @@ -17,6 +17,7 @@ var F32to64 = f32to64 var Fcmp64 = fcmp64 var Fintto64 = fintto64 var F64toint = f64toint +var Sqrt = sqrt var Entersyscall = entersyscall var Exitsyscall = exitsyscall -- cgit v1.3-5-g9baa