ARM Floating Point

342 views
Skip to first unread message

James Ots

unread,
May 18, 2012, 6:39:55 PM5/18/12
to golan...@googlegroups.com
I have been playing with the Go language on my Raspberry Pi computer over the last few days. Because the ARM processor on the board is an ARM1176JZF-S with a floating point processor I thought I wouldn't have to export GOARM=5 in order for it to work, but when compiling the source go_bootstrap failed to run, bombing out with a SIGILL when it tried to execute 'vmov.f64 d0, #112'.

Looking in the ARM documentation it seems the immediate version of vmov is only available on VFPv3 devices (ARMv7), but the Pi has an ARMv6 device with VFPv2.

The Go documentation says to set GOARM to 5 for ARM devices without floating point, but leave it at the default 6 if the ARM device has floating point. I wonder if the variable should be renamed to something else to make it clearer that it's not about ARMv5 and ARMv6 devices. Perhaps GOVFP3=1/0? The documentation could make it clearer too.

Would it be feasible to add support for VFPv2?

James Ots

minux

unread,
May 19, 2012, 2:28:00 AM5/19/12
to James Ots, golan...@googlegroups.com
This is a known issue (issue 3456).
I have a CL to address it, http://codereview.appspot.com/5987063/, but I'm not sure it's the
correct approach (there are so many ARM variants, that I'm not sure GOARM alone could
handle all of them from ARMv5 above. Of course, the situation is changing, the tip includes
several CLs that auto detect architecture at runtime. Unfortunately, we can't auto detect VFP
without incurring huge overhead for machines that do have VFP).
With that CL applied, by default, we won't use "vmov (imm)" instruction, if you have VFPv3,
you can define GOARM=7 to use it (strictly, ARMv7 doesn't imply VFPv3, but I think the Go
team certainly doesn't want another environment variable; but as for now, GOARM's only
use is to switch VFP related behavior, so I think it should be renamed to GOVFP).
Reply all
Reply to author
Forward
0 new messages