-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
cmd/compile: Illegal instruction 'fucomip' on 386 with GO386=387 #13923
Comments
"The FCOMI/FCOMIP/FUCOMI/FUCOMIP instructions were introduced to the IA-32 Architecture in the P6 family processors and are not available in earlier IA-32 processors." And the code in /cc @randall77 @minux @rsc |
Yes, it looks like fucomip and friends are Pentium Pro, not MMX. We should use the non-i versions which are MMX. (The i versions put the comparison results in the eflags register, the non-i ones put the comparison results in the FP status word.) go 1.4 uses the correct instructions. go 1.5 and 1.6 do not. Looks like Josh's CL 8738 introduced these new ops. I think the fix should be easy. This is a candidate for 1.5.3. |
Not a candidate for 1.5.3. On Tue, Jan 12, 2016 at 2:57 PM, Keith Randall [email protected]
|
CL https://golang.org/cl/18590 mentions this issue. |
It turns out we've been generating FUCOMIP since Go 1.1. We'll fix this for Go 1.6 but because it's such a long-standing bug we likely will not issue the fix in a Go 1.5 point release. |
Thanks for the quick response on this issue. I knew that Go binaries (since at least 1.4) always crashed on this machine but didn't investigate until I wanted to run my own Go binaries. I don't imagine many others are running into this issue, so 1.6 is fine. I'd like to know when this fix becomes available in the tree so I can get running in the meantime. |
The fix has been submitted. Please try it out on your processor. |
It seems like it made it past the runtime check but ended up crashing again:
The illegal instruction in question is CMOVS:
From
It seems like the 'fucomip' issue was fixed but I'm not sure because 'cmovs' showed up. |
cmov fix out for review. This one is my fault from a ways back. maps, selects, string ==, all used cmov. How did this ever work? Hopefully there won't be too many rounds of this. We really need a Pentium MMX builder so we don't regress yet again. |
The documentation may be wrong. Pentium Pro was the minimum since 2009. From Issue 447: Feel free. You'll have to add them in 8l first |
CL https://golang.org/cl/18621 mentions this issue. |
cmov fixed. Please try again. Hopefully we won't have to go around too many times. @cldorian : that comment is quite old. I suspect it was before the 387/sse2 split. |
@randall77 : it may be old, but, for example, expm1_386.s was written when it was valid. |
Hooray, Go binaries now work on this ancient machine! Thanks again for all the help. |
I'm running Go 1.5 on FreeBSD i386 using a "AMD-K6(tm) 3D processor (350.02-MHz 586-class CPU)". I cross-compiled a binary on a modern machine with GOARCH=386 and GO386=387, but the resulting binary crashes:
Disassembling the problematic instruction reveals:
The documentation advertises:
GO386=387: use x87 for floating point operations; should support all x86 chips (Pentium MMX or later).
MMX is supported, as indicated by the CPU features string:
This contradicts the documentation; either the documentation should indicate that not all processors with MMX are supported, or the 'fucomip' instruction (and friends) should not be emitted when GO386=387 is set.
The text was updated successfully, but these errors were encountered: