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: request softfloat for all platform (not only mips) #32760

Closed
mohanson opened this issue Jun 25, 2019 · 6 comments
Closed

runtime: request softfloat for all platform (not only mips) #32760

mohanson opened this issue Jun 25, 2019 · 6 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@mohanson
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.12.6 linux/amd64

I can use GOMIPS=softfloat to use softfloat on MIPS since go1.10 or go1.11, do you guys intend to bring it to other platforms? like x86 or arm.

@mohanson mohanson changed the title runtime: softfloat for all platform(not only mips) runtime: request softfloat for all platform(not only mips) Jun 25, 2019
@martisch
Copy link
Contributor

martisch commented Jun 25, 2019

Could you give some details why soft float on x86 would be useful?

The minimum requirement due to 64bit atomics for Go is Pentium MMX on x86 and thereby all supported chips should have floating point support in hardware.

arm has softfloat support for supported arm versions that do not have hardware support. See https://github.com/golang/go/wiki/GoArm

arch.SoftFloat = objabi.GOARM == 5

@martisch martisch added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jun 25, 2019
@martisch martisch added this to the Unplanned milestone Jun 25, 2019
@ALTree ALTree changed the title runtime: request softfloat for all platform(not only mips) runtime: request softfloat for all platform (not only mips) Jun 25, 2019
@mohanson
Copy link
Author

I'm interested on riscv, as we known, floating point on rsicv chip is optional, So I think If there is a general softfloat implementation(not limited on MIPs), it would be fine.

@martisch
Copy link
Contributor

martisch commented Jun 25, 2019

Go gc does not support RISC-V yet. Once it does soft float for RISC-V if not yet implemented can be considered. Which leaves the question why soft float for platforms that always support hardware float operations (x86 as mentioned) should be supported?

I can see not much demand/use for soft float for e.g. x86 yet and its something that needs to be kept maintained and tested.

Once RISC-V is supported I think it would be better to open a specific issue about soft float support for RISC-V if not present. But I assume that is more likely to trigger an implementation with compiler intrinsics and asm code to have better performance.

@mohanson
Copy link
Author

For some cross-architecture solutions, the most hacked solution is to translate the source architecture machine language to the target architecture machine language, and if the source machine language uses floating point instructions, it will cause a lot of trouble for the translation. It's my personal interst.

I understand that this is not your current focus, and most people doesn't need it. Thank you for your reply! :)

@martisch
Copy link
Contributor

Thanks for the explanation. I can see how it makes this very special use case a bit easier but I do not think there is sufficient demand to out way the complexity and maintenance burden that would be added.

GCC supports -msoft-float but I do not know if https://golang.org/doc/install/gccgo does.

@elvin-du
Copy link

In the area of blockchain, smart contracts run floating-point computing. If golang can support soft floating-point computing on all platforms, it will be very useful.

@golang golang locked and limited conversation to collaborators Nov 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants