FAQ
Hello.

I could not find a clear answer in the documentation for this.

Is Go using 387 or SSE2 for floating point operations? I suppose it will
use SSE2 in amd64 but what about in 386? and what about forcing GOARCH=386
in a amd64 OS?

http://golang.org/doc/install/source says that GO386 value is auto-detected
by default, but is there a way to print what is being auto-detected? Or
alternatively, an easy way to check what a Go executable is using?

Will the behaviour change on Go 1.5?

Thank you!


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Dave Cheney at May 28, 2015 at 9:37 am
    For the former, go env will show the value.

    It defaults to sse2.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Brendan Tracey at May 28, 2015 at 12:47 pm
    Depending on what you need, in github.com/gonum/floats Dot and the AddScaled variants are coded with sse2, and we'd like to eventually replace them with larger SIMD instructions when Go supports it

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Ignacio Grande at Jun 3, 2015 at 7:41 pm
    Thank you for your replies.

    I'm realizing that I made the wrong question. Recently we had some
    numerical issues in a Fortran code because some people were using 387 and
    other were using SSE2. I tried to replicate the numerical differences in Go
    (not too hard, I admit) and I could not get different results. I was
    wondering if it was because of the 387 or SSE2 but maybe the implementation
    is robust enough to avoid this (using Go compiler, gccgo is another matter,
    I assume).

    So, should I expect numerical differences in heavy float64 computations by
    compiling and using a program in 386/387 or amd64/SSE2, like it happens
    using GCC?

    Regards.

    On Thursday, May 28, 2015 at 2:47:38 PM UTC+2, Brendan Tracey wrote:

    Depending on what you need, in github.com/gonum/floats Dot and the
    AddScaled variants are coded with sse2, and we'd like to eventually replace
    them with larger SIMD instructions when Go supports it
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Ian Lance Taylor at Jun 3, 2015 at 8:47 pm

    On Wed, Jun 3, 2015 at 12:41 PM, Ignacio Grande wrote:
    I'm realizing that I made the wrong question. Recently we had some numerical
    issues in a Fortran code because some people were using 387 and other were
    using SSE2. I tried to replicate the numerical differences in Go (not too
    hard, I admit) and I could not get different results. I was wondering if it
    was because of the 387 or SSE2 but maybe the implementation is robust enough
    to avoid this (using Go compiler, gccgo is another matter, I assume).

    So, should I expect numerical differences in heavy float64 computations by
    compiling and using a program in 386/387 or amd64/SSE2, like it happens
    using GCC?
    Assuming you are using GOARCH=386, then, yes, the GO386 value will
    affect the results of floating point code.

    The default is normally sse2, unless you built your Go tools on a very
    very old system or you set GO386 in the environment when building Go.

    Ian

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMay 28, '15 at 8:56a
activeJun 3, '15 at 8:47p
posts5
users4
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase