-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: mips32 soft float point support #18162
Comments
see also #14635. |
There are softfloat code for ARM that we can reuse. What still need to be done is MIPS instruction decoding. |
@juliandroid |
@vstefanovic |
@juliandroid |
After discussion with @cherrymui on this issue, we think it's
probably a good idea to always enable soft float for mips and
mips64 (for both endianness) so that we don't need to add
a GOMIPS knob.
We can make _sfloat return immediately without interpreting
the following FPU instructions if the machine does have an
FPU.
The rationale is that most MIPS machines do not have an
FPU, this is unlike the ARM situation where if we do drop
ARMv6 support, almost all supported machine will have an
FPU.
Of course, we should base our final decision on both binary
size and execution time overhead for this.
If we decide to add a $GOMIPS knob to mirror the existing
$GOARM, we should also consider add support for the
legacy 32-bit MIPS instruction sets (i.e. MIPS I/II) so that
our 32-bit port also runs on Loongson 2.
|
I have to disagree. Majority of modern MIPS boards do have FP |
@vstefanovic any progress? need any help with this? |
@aep |
@vstefanovic I just heard of this via https://groups.google.com/forum/#!topic/golang-nuts/DT_P9UPKHgI . Adding soft floating point support for MIPS(32) would be fantastic! As soon as a patch or release is ready, I'm excited to use it. Think that might be soon? |
@elimisteve great to hear that. I'd like to prepare docker diffs first, then get back to the soft-float with a rebase and some double-checking; presumably it'll be uploaded in a few weeks. |
I'm watching the calendar on the wall patiently too 👍 |
@vstefanovic any updates? I would be willing to be a guinea pig for any work-in-progress patch you might have. The device I would like to run Go binaries on is based on MT7628AN, mips32 little endian, if that matters. |
Hi @krasin, give me a few more days, then I'll upload the code to gerrit. |
@vstefanovic sure thing. As a workaround, I have compiled my kernel with FPU emulation flag, but that does not feel like the way to go, so a proper soft float support is highly appreciated. |
CL https://golang.org/cl/37954 mentions this issue. |
CL https://golang.org/cl/37955 mentions this issue. |
CL https://golang.org/cl/37958 mentions this issue. |
CL https://golang.org/cl/37956 mentions this issue. |
CL https://golang.org/cl/37957 mentions this issue. |
@vstefanovic
At mips system (openwrt):
Compiling with/without GOMIPS=soft-float,mips32r2 doesn't seem to make any difference:
However, the go compiler is parsing the GOMIPS env var:
Am I doing something wrong, or missing something? Are these patches not yet complete? BTW, thanks a lot for your work! |
@pqyptixa |
@vstefanovic |
@petar-jovanovic I pinged them yesterday asking for an update about the CLs and Cherry said they were all reviewed except this one: https://go-review.googlesource.com/c/go/+/37954. So as soon as that one is also |
I'm bumping this back to Go 1.10 because it might've been moved to Go1.11 along with a bunch of other bugs en masse. I'd prefer this go into Go 1.10 if @rsc doesn't find it too invasive. |
I would greatly appreciate if this ends up in Go 1.10 as @aclements pledged to try his best last time :) @bradfitz Thanks for pushing this into 1.10 👍 |
GOMIPS is a GOARCH=mips{,le} specific option, for a choice between hard-float and soft-float. Valid values are 'hardfloat' (default) and 'softfloat'. It is passed to the assembler as 'GOMIPS_{hardfloat,softfloat}'. Note: GOMIPS will later also be used for a choice of MIPS instruction set (mips32/mips32r2). Updates #18162 Change-Id: I35417db8625695f09d6ccc3042431dd2eaa756a6 Reviewed-on: https://go-review.googlesource.com/37954 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Russ Cox <[email protected]>
Updates #18162 Change-Id: Iee854f48b2d1432955fdb462f2073ebbe76c34f8 Reviewed-on: https://go-review.googlesource.com/37957 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Cherry Zhang <[email protected]>
Updates #18162 Change-Id: I591fcf71a02678a99a56a6487da9689d3c9b1bb6 Reviewed-on: https://go-review.googlesource.com/37955 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Cherry Zhang <[email protected]>
Updates #18162 (mostly fixes) Change-Id: I35bcb8a688bdaa432adb0ddbb73a2f7adda47b9e Reviewed-on: https://go-review.googlesource.com/37958 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Cherry Zhang <[email protected]>
We have a problem with the Go compiler on a MIPS target without the CONFIG_MIPS_FPU_EMULATOR being enabled. I thought in such case the soft-float support in go1.10RC1 would be sufficient but unfortunately be cannot build any runnable Go programs. The FPU configuration of the target is: Any ideas? |
@dtodor. Please open a new issue including how you built Go or the target binary. |
Is soft point support for mips64 ready? |
@wengerxin No, apparently. Softfloat for mips64 is issue #14635, which is still open. |
@wengerxin Soft float on MIPS64 are not officially supported. However, the functionality are all there. You are welcomed to try it, by setting |
I consulted the mips32 modification and modified the flowing files to shield the float instructions: 0001-add-mips64-soft-float.zip |
@wengerxin These modifications are needed only if you need CGO (you can disable it with CGO_ENABLED=0). But if you need it, you are on the right track. Are you planning to send the patch for review? |
@milanknezevic , Thank you for your answer. Yes, I need CGO to compile docker. |
I have built Golang by using the master branch and I have realized that there is no soft point support for the new mips32 target. That means the core like MIPS32 74Kc is not supported due to lack of FPU.
I have wrote an email to Vladimir Stefanovic, asking him to confirm the soft-float point support issue and his response was that in the near future there are no plans soft-point support to be implemented, but that might change later.
It would be great to have a ticket here to keep track the development of the issue and hopefully one day this issue to be resolved.
The text was updated successfully, but these errors were encountered: