diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2022-09-03 02:33:36 +0200 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2022-09-03 02:33:36 +0200 |
| commit | 0171c276f0880d6915254b728e9519ad5fc49256 (patch) | |
| tree | 2e01b17c1459190c40d90934537484278c7a4376 /core/sys/info/cpu_intel.odin | |
| parent | 0743dd195d28837896eafbf6396461b3c0179407 (diff) | |
[sys/info] Support FreeBSD 13
Diffstat (limited to 'core/sys/info/cpu_intel.odin')
| -rw-r--r-- | core/sys/info/cpu_intel.odin | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/sys/info/cpu_intel.odin b/core/sys/info/cpu_intel.odin index eeb9c2416..e0b5090ca 100644 --- a/core/sys/info/cpu_intel.odin +++ b/core/sys/info/cpu_intel.odin @@ -67,8 +67,15 @@ init_cpu_features :: proc "c" () { try_set(&set, .os_xsave, 27, ecx1) try_set(&set, .rdrand, 30, ecx1) + when ODIN_OS == .FreeBSD { + // xgetbv is an illegal instruction under FreeBSD 13 + // return before probing further + cpu_features = set + return + } + os_supports_avx := false - if .os_xsave in set { + if .os_xsave in set { eax, _ := xgetbv(0) os_supports_avx = is_set(1, eax) && is_set(2, eax) } |