Commit d795f077 authored by Russ Cox's avatar Russ Cox

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
parent ebf35167
...@@ -123,7 +123,7 @@ void runv(Buf *b, char *dir, int mode, Vec *argv); ...@@ -123,7 +123,7 @@ void runv(Buf *b, char *dir, int mode, Vec *argv);
void bgrunv(char *dir, int mode, Vec *argv); void bgrunv(char *dir, int mode, Vec *argv);
void bgwait(void); void bgwait(void);
bool streq(char*, char*); bool streq(char*, char*);
bool cansse(void); bool cansse2(void);
void writefile(Buf*, char*, int); void writefile(Buf*, char*, int);
void xatexit(void (*f)(void)); void xatexit(void (*f)(void));
void xexit(int); void xexit(int);
......
...@@ -105,8 +105,8 @@ init(void) ...@@ -105,8 +105,8 @@ init(void)
xgetenv(&b, "GO386"); xgetenv(&b, "GO386");
if(b.len == 0) { if(b.len == 0) {
if(cansse()) if(cansse2())
bwritestr(&b, "sse"); bwritestr(&b, "sse2");
else else
bwritestr(&b, "387"); bwritestr(&b, "387");
} }
......
...@@ -759,7 +759,7 @@ xtryexecfunc(void (*f)(void)) ...@@ -759,7 +759,7 @@ xtryexecfunc(void (*f)(void))
} }
bool bool
cansse(void) cansse2(void)
{ {
// if we had access to cpuid, could answer this question // if we had access to cpuid, could answer this question
// less conservatively. // less conservatively.
......
...@@ -780,7 +780,7 @@ __cpuid(int dst[4], int ax) ...@@ -780,7 +780,7 @@ __cpuid(int dst[4], int ax)
} }
bool bool
cansse(void) cansse2(void)
{ {
int info[4]; int info[4];
......
...@@ -987,7 +987,7 @@ cpuid(int dst[4], int ax) ...@@ -987,7 +987,7 @@ cpuid(int dst[4], int ax)
} }
bool bool
cansse(void) cansse2(void)
{ {
int info[4]; int info[4];
......
...@@ -217,7 +217,6 @@ main(int argc, char *argv[]) ...@@ -217,7 +217,6 @@ main(int argc, char *argv[])
goroot = getgoroot(); goroot = getgoroot();
goos = getgoos(); goos = getgoos();
goarch = thestring; goarch = thestring;
use_sse = strcmp(getgo386(), "sse") == 0;
setexp(); setexp();
...@@ -261,6 +260,9 @@ main(int argc, char *argv[]) ...@@ -261,6 +260,9 @@ main(int argc, char *argv[])
flagparse(&argc, &argv, usage); flagparse(&argc, &argv, usage);
if(argc < 1)
usage();
if(flag_race) { if(flag_race) {
racepkg = mkpkg(strlit("runtime/race")); racepkg = mkpkg(strlit("runtime/race"));
racepkg->name = "race"; racepkg->name = "race";
...@@ -273,8 +275,15 @@ main(int argc, char *argv[]) ...@@ -273,8 +275,15 @@ main(int argc, char *argv[])
if(debug['l'] <= 1) if(debug['l'] <= 1)
debug['l'] = 1 - debug['l']; debug['l'] = 1 - debug['l'];
if(argc < 1) if(thechar == '8') {
usage(); 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); pathname = mal(1000);
if(getwd(pathname, 999) == 0) if(getwd(pathname, 999) == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment