1
0
mirror of https://github.com/golang/go synced 2024-11-23 07:10:05 -07:00

build: change GO386=sse to GO386=sse2

sse2 is a more precise description of the requirement,
and it matches what people will see in, for example
        grep sse2 /proc/cpuinfo # linux
        sysctl hw.optional.sse2 # os x

R=golang-dev, dsymonds, iant
CC=golang-dev
https://golang.org/cl/7057050
This commit is contained in:
Russ Cox 2013-01-18 15:10:36 -05:00
parent ebf35167ee
commit d795f07718
6 changed files with 18 additions and 9 deletions

2
src/cmd/dist/a.h vendored
View File

@ -123,7 +123,7 @@ void runv(Buf *b, char *dir, int mode, Vec *argv);
void bgrunv(char *dir, int mode, Vec *argv);
void bgwait(void);
bool streq(char*, char*);
bool cansse(void);
bool cansse2(void);
void writefile(Buf*, char*, int);
void xatexit(void (*f)(void));
void xexit(int);

View File

@ -105,8 +105,8 @@ init(void)
xgetenv(&b, "GO386");
if(b.len == 0) {
if(cansse())
bwritestr(&b, "sse");
if(cansse2())
bwritestr(&b, "sse2");
else
bwritestr(&b, "387");
}

View File

@ -759,7 +759,7 @@ xtryexecfunc(void (*f)(void))
}
bool
cansse(void)
cansse2(void)
{
// if we had access to cpuid, could answer this question
// less conservatively.

2
src/cmd/dist/unix.c vendored
View File

@ -780,7 +780,7 @@ __cpuid(int dst[4], int ax)
}
bool
cansse(void)
cansse2(void)
{
int info[4];

View File

@ -987,7 +987,7 @@ cpuid(int dst[4], int ax)
}
bool
cansse(void)
cansse2(void)
{
int info[4];

View File

@ -217,7 +217,6 @@ main(int argc, char *argv[])
goroot = getgoroot();
goos = getgoos();
goarch = thestring;
use_sse = strcmp(getgo386(), "sse") == 0;
setexp();
@ -261,6 +260,9 @@ main(int argc, char *argv[])
flagparse(&argc, &argv, usage);
if(argc < 1)
usage();
if(flag_race) {
racepkg = mkpkg(strlit("runtime/race"));
racepkg->name = "race";
@ -273,8 +275,15 @@ main(int argc, char *argv[])
if(debug['l'] <= 1)
debug['l'] = 1 - debug['l'];
if(argc < 1)
usage();
if(thechar == '8') {
p = getgo386();
if(strcmp(p, "387") == 0)
use_sse = 0;
else if(strcmp(p, "sse2") == 0)
use_sse = 1;
else
sysfatal("unsupported setting GO386=%s", p);
}
pathname = mal(1000);
if(getwd(pathname, 999) == 0)