]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: detect sse2 even with gccgo
authorShenghou Ma <minux@golang.org>
Mon, 13 Apr 2015 19:50:56 +0000 (15:50 -0400)
committerMinux Ma <minux@golang.org>
Mon, 13 Apr 2015 23:27:35 +0000 (23:27 +0000)
Change-Id: Idfb20bfe130d9a54d9f5aae8eab8a34655d30610
Reviewed-on: https://go-review.googlesource.com/8865
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/dist/util_gccgo.go

index f680e7b64970c3aad0ab56b0b1896e83d25fada7..14ac70bca5d8eee4e474a54048d40279f2f48cdd 100644 (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 }