diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2022-07-11 10:03:44 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2022-07-18 10:42:04 -0400 |
commit | f67ab1eb20ae357fd004815ec25c5350e5813a46 (patch) | |
tree | e25b2cf83e53263f9f7967e5ba5d3a20de4da7e0 /vendor/golang.org/x/sys/cpu | |
parent | 5f848d89edef76adff6d203859803be9b791d258 (diff) | |
download | podman-f67ab1eb20ae357fd004815ec25c5350e5813a46.tar.gz podman-f67ab1eb20ae357fd004815ec25c5350e5813a46.tar.bz2 podman-f67ab1eb20ae357fd004815ec25c5350e5813a46.zip |
Vendor in containers/(storage,image, common, buildah)
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/golang.org/x/sys/cpu')
-rw-r--r-- | vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c b/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c index e363c7d13..a4605e6d1 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c +++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c @@ -7,6 +7,7 @@ #include <cpuid.h> #include <stdint.h> +#include <x86intrin.h> // Need to wrap __get_cpuid_count because it's declared as static. int @@ -17,27 +18,21 @@ gccgoGetCpuidCount(uint32_t leaf, uint32_t subleaf, return __get_cpuid_count(leaf, subleaf, eax, ebx, ecx, edx); } +#pragma GCC diagnostic ignored "-Wunknown-pragmas" +#pragma GCC push_options +#pragma GCC target("xsave") +#pragma clang attribute push (__attribute__((target("xsave"))), apply_to=function) + // xgetbv reads the contents of an XCR (Extended Control Register) // specified in the ECX register into registers EDX:EAX. // Currently, the only supported value for XCR is 0. -// -// TODO: Replace with a better alternative: -// -// #include <xsaveintrin.h> -// -// #pragma GCC target("xsave") -// -// void gccgoXgetbv(uint32_t *eax, uint32_t *edx) { -// unsigned long long x = _xgetbv(0); -// *eax = x & 0xffffffff; -// *edx = (x >> 32) & 0xffffffff; -// } -// -// Note that _xgetbv is defined starting with GCC 8. void gccgoXgetbv(uint32_t *eax, uint32_t *edx) { - __asm(" xorl %%ecx, %%ecx\n" - " xgetbv" - : "=a"(*eax), "=d"(*edx)); + uint64_t v = _xgetbv(0); + *eax = v & 0xffffffff; + *edx = v >> 32; } + +#pragma clang attribute pop +#pragma GCC pop_options |