Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: softfloat emulation doesn't support conditional execution #3638

Closed
davecheney opened this issue May 17, 2012 · 7 comments
Closed

runtime: softfloat emulation doesn't support conditional execution #3638

davecheney opened this issue May 17, 2012 · 7 comments

Comments

@davecheney
Copy link
Contributor

What steps will reproduce the problem?

My arm5 host is slowly ceasing to be able to build Go normally (at some point I will
have to switch to cross compiling from another arm system), however after doing a
successful ./make.bash it looks like there is a problem in the softfloat emulation.

stora(~/go/src) % go test -v std
sfloat2 0x71924 0x159fb010
Unsupported floating point instruction
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x7624c]

goroutine 3 [running]:
created by main.(*builder).do
        /home/dfc/go/src/cmd/go/build.go:608 +0x53c

goroutine 1 [chan receive]:
main.(*builder).do(0x10db72c0, 0x10ce7770, 0x10963dc0)
        /home/dfc/go/src/cmd/go/build.go:611 +0x568
main.runTest(0x456f90, 0x1094d410, 0x2)
        /home/dfc/go/src/cmd/go/test.go:367 +0x24b8
main.main()
        /home/dfc/go/src/cmd/go/main.go:141 +0x5c8

goroutine 2 [syscall]:
created by runtime.main
        /home/dfc/go/src/pkg/runtime/proc.c:221

goroutine 10 [syscall]:
created by addtimer
        /home/dfc/go/src/pkg/runtime/ztime_linux_arm.c:69
@minux
Copy link
Member

minux commented May 17, 2012

Comment 1:

0x159fb010 is "ldrne   fp, [pc, #16]"
unfortunately the softfloat emulator doesn't handle conditional execution of
instructions.
The surrounding instructions are:
   6d010:       159fb010        ldrne   fp, [pc, #16]   ; 6d028 <_ul2d+0x70>
   6d014:       1d9b2a00        vldrne  s4, [fp]
   6d018:       1e311a02        vaddne.f32      s2, s2, s4
   6d01c:       eeb00b41        vmov.f64        d0, d1
   6d020:       e28ef000        add     pc, lr, #0
Three of them are all conditional, so we must support conditional execution in
stepflt(), this will
take some time, for I must verify that all the instruction executed by it supports
conditional execution
(although I think so).
A temp. workaround is to disable optimizer in 5c again in softfloat builds.
(add "debug['N'] = 1;" to main() in cc/lex.c:L96 after "memset(debug, 0,
sizeof(debug));".)
I will tackle the general problem. Should we setup a soft float ARMv5 builder to avoid
introduce these
kind of bugs latter? (I have a custom built qemu-system-arm without VFP support, but it
took 2 hours
to run make.bash and 'go test -short std')

Labels changed: added priority-later, removed priority-triage.

@davecheney
Copy link
Contributor Author

Comment 2:

Would a pandaboard running GOARM=5 be sufficient, or does the host
need to be ARMv5 spec ?

@minux
Copy link
Member

minux commented May 17, 2012

Comment 3:

the host must not support any VFP instruction to test the softfloat emulation code.

@minux
Copy link
Member

minux commented May 17, 2012

Comment 4:

after consulting VFP reference again, I think we might be able to disable VFP for
select process by some kernel modification, which will make the pandaboard approach
viable.

@minux
Copy link
Member

minux commented May 19, 2012

Comment 5:

http://golang.org/cl/6213057

Status changed to Started.

@minux
Copy link
Member

minux commented May 19, 2012

Comment 6:

http://golang.org/cl/6213057

@minux
Copy link
Member

minux commented May 22, 2012

Comment 7:

This issue was closed by revision fb3a1b6.

Status changed to Fixed.

minux added a commit that referenced this issue May 11, 2015
…ftfloat

««« backport 87ef5e0baaf5
runtime: support conditional execution in ARM softfloat
        Fixes #3638.

R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/6213057

»»»
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants