Commit 102436e8 authored by Shenghou Ma's avatar Shenghou Ma Committed by Minux Ma
Browse files

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: default avatarShenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/9570


Reviewed-by: default avatarDave Cheney <dave@cheney.net>
Reviewed-by: default avatarKeith Randall <khr@golang.org>
parent 62ea2c90
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment