cmd/dist: detect sse2 even with gccgo

Change-Id: Idfb20bfe130d9a54d9f5aae8eab8a34655d30610
Reviewed-on: https://go-review.googlesource.com/8865
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Shenghou Ma 2015-04-13 15:50:56 -04:00 committed by Minux Ma
parent 41e9f8c4ed
commit ce43e1fec8
1 changed files with 12 additions and 1 deletions

View File

@ -6,4 +6,15 @@
package main
func cansse2() bool { return false }
/*
int supports_sse2() {
#if defined(__i386__) || defined(__x86_64__)
return __builtin_cpu_supports("sse2");
#else
return 0;
#endif
}
*/
import "C"
func cansse2() bool { return C.supports_sse2() != 0 }