FAQ
Reviewers: golang-dev_googlegroups.com,

Message:
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com),

I'd like you to review this change to
https://go.googlecode.com/hg/


Description:
cmd/dist, cmd/8g: implement GO386=387/sse to choose FPU flavour.

A new environment variable GO386 is introduced to choose between
code generation targeting 387 or SSE2. No auto-detection is
performed and the setting defaults to 387 to preserve previous
behaviour.

Fixes issue 3912.

Please review this at https://codereview.appspot.com/6962043/

Affected files:
M include/libc.h
M src/cmd/8g/cgen.c
M src/cmd/8g/gg.h
M src/cmd/8g/ggen.c
M src/cmd/8g/gsubr.c
M src/cmd/8g/list.c
M src/cmd/8g/peep.c
M src/cmd/8g/reg.c
M src/cmd/dist/build.c
M src/cmd/gc/go.h
M src/cmd/gc/lex.c
M src/lib9/goos.c

Search Discussions

  • Remyoudompheng at Dec 19, 2012 at 9:18 pm
  • Minux at Dec 19, 2012 at 9:57 pm
    thank you. i will try to implement the auto detection part for cmd/dist.
  • Russ Cox at Dec 20, 2012 at 7:23 pm
    i think you can get it from the cpuid w/ eax=1.
  • Rsc at Dec 22, 2012 at 10:19 pm
    Can you create a global use_sse variable instead of the repeated strcmp
    calls? It probably doesn't matter but still...

    For detecting SSE2 I think this will work with msvc and gcc (msvc
    provides __cpuid automatically):

    #include <stdio.h>

    #ifndef COMPILER_MSVC
    static void
    __cpuid(int dst[4], int ax)
    {
    asm volatile("cpuid"
    : "=a" (dst[0]), "=b" (dst[1]), "=c" (dst[2]), "=d" (dst[3])
    : "a" (ax));
    }
    #endif

    int
    main(void)
    {
    int info[4];

    __cpuid(info, 1);
    printf("%#x\n", info[3] & (1<<26));
    return 0;
    }



    https://codereview.appspot.com/6962043/diff/5002/src/cmd/8g/ggen.c
    File src/cmd/8g/ggen.c (right):

    https://codereview.appspot.com/6962043/diff/5002/src/cmd/8g/ggen.c#newcode868
    src/cmd/8g/ggen.c:868: // floating-point. 387 (not SSE2) to
    interoperate with 8c
    s/ to interoperate with 8c//
    that was never true, just a misunderstanding on my part (sse2 and 387
    coexist, i was thinking of mmx).

    https://codereview.appspot.com/6962043/
  • Russ Cox at Jan 2, 2013 at 8:44 pm
    ping...
  • Remyoudompheng at Jan 2, 2013 at 9:48 pm
    Hello minux.ma@gmail.com, rsc@golang.org (cc:
    golang-dev@googlegroups.com),

    Please take another look.


    https://codereview.appspot.com/6962043/
  • Rsc at Jan 2, 2013 at 9:53 pm
    LGTM

    I'd like to autodetect the default GO386 setting but we can do that in a
    separate CL.



    https://codereview.appspot.com/6962043/diff/5002/src/cmd/8g/ggen.c
    File src/cmd/8g/ggen.c (right):

    https://codereview.appspot.com/6962043/diff/5002/src/cmd/8g/ggen.c#newcode868
    src/cmd/8g/ggen.c:868: // floating-point. 387 (not SSE2) to
    interoperate with 8c
    On 2012/12/22 22:19:46, rsc wrote:
    s/ to interoperate with 8c//
    that was never true, just a misunderstanding on my part (sse2 and 387
    coexist, i
    was thinking of mmx).
    still applies

    https://codereview.appspot.com/6962043/
  • Remyoudompheng at Jan 2, 2013 at 9:54 pm
    https://codereview.appspot.com/6962043/diff/5002/src/cmd/8g/ggen.c
    File src/cmd/8g/ggen.c (right):

    https://codereview.appspot.com/6962043/diff/5002/src/cmd/8g/ggen.c#newcode868
    src/cmd/8g/ggen.c:868: // floating-point. 387 (not SSE2) to
    interoperate with 8c
    On 2013/01/02 21:52:04, rsc wrote:
    On 2012/12/22 22:19:46, rsc wrote:
    s/ to interoperate with 8c//
    that was never true, just a misunderstanding on my part (sse2 and
    387 coexist,
    i
    was thinking of mmx).
    still applies
    Done.

    https://codereview.appspot.com/6962043/
  • Remyoudompheng at Jan 2, 2013 at 10:04 pm
    *** Submitted as
    https://code.google.com/p/go/source/detail?r=be005b410410 ***

    cmd/dist, cmd/8g: implement GO386=387/sse to choose FPU flavour.

    A new environment variable GO386 is introduced to choose between
    code generation targeting 387 or SSE2. No auto-detection is
    performed and the setting defaults to 387 to preserve previous
    behaviour.

    The patch is a reorganization of CL6549052 by rsc.

    Fixes issue 3912.

    R=minux.ma, rsc
    CC=golang-dev
    https://codereview.appspot.com/6962043


    https://codereview.appspot.com/6962043/
  • Russ Cox at Jan 2, 2013 at 10:08 pm
    thanks. i started the autodetect in CL 7035055.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedDec 19, '12 at 9:16p
activeJan 2, '13 at 10:08p
posts11
users3
websitegolang.org

3 users in discussion

Russ Cox: 5 posts Remyoudompheng: 5 posts Minux: 1 post

People

Translate

site design / logo © 2022 Grokbase