-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcpuinfo.go
52 lines (39 loc) · 809 Bytes
/
cpuinfo.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package sdl
// #include <SDL.h>
import "C"
const (
CACHELINE_SIZE = C.SDL_CACHELINE_SIZE
)
func GetCPUCount() int {
return int(C.SDL_GetCPUCount())
}
func GetCPUCacheLineSize() int {
return int(C.SDL_GetCPUCacheLineSize())
}
func HasRDTSC() bool {
return C.SDL_HasRDTSC() == C.SDL_TRUE
}
func HasAltiVec() bool {
return C.SDL_HasAltiVec() == C.SDL_TRUE
}
func HasMMX() bool {
return C.SDL_HasMMX() == C.SDL_TRUE
}
func Has3DNow() bool {
return C.SDL_Has3DNow() == C.SDL_TRUE
}
func HasSSE() bool {
return C.SDL_HasSSE() == C.SDL_TRUE
}
func HasSSE2() bool {
return C.SDL_HasSSE2() == C.SDL_TRUE
}
func HasSSE3() bool {
return C.SDL_HasSSE3() == C.SDL_TRUE
}
func HasSSE41() bool {
return C.SDL_HasSSE41() == C.SDL_TRUE
}
func HasSSE42() bool {
return C.SDL_HasSSE42() == C.SDL_TRUE
}