Skip to content

Commit ce43e1f

Browse files
committed
cmd/dist: detect sse2 even with gccgo
Change-Id: Idfb20bfe130d9a54d9f5aae8eab8a34655d30610 Reviewed-on: https://go-review.googlesource.com/8865 Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 41e9f8c commit ce43e1f

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/cmd/dist/util_gccgo.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,15 @@
66

77
package main
88

9-
func cansse2() bool { return false }
9+
/*
10+
int supports_sse2() {
11+
#if defined(__i386__) || defined(__x86_64__)
12+
return __builtin_cpu_supports("sse2");
13+
#else
14+
return 0;
15+
#endif
16+
}
17+
*/
18+
import "C"
19+
20+
func cansse2() bool { return C.supports_sse2() != 0 }

0 commit comments

Comments
 (0)