Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
3f150ffb
Commit
3f150ffb
authored
Jul 09, 2012
by
Ronald S. Bultje
Committed by
Martin Storsjö
Jul 10, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x86/cpu: implement support for xgetbv through intrinsics
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
f80ddd5b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
configure
configure
+2
-0
cpu.c
libavutil/x86/cpu.c
+11
-0
No files found.
configure
View file @
3f150ffb
...
...
@@ -1169,6 +1169,7 @@ HAVE_LIST="
windows_h
winsock2_h
xform_asm
xgetbv
xmm_clobbers
yasm
"
...
...
@@ -2742,6 +2743,7 @@ elif enabled sparc; then
elif
enabled x86
;
then
check_code ld immintrin.h
"__xgetbv(0)"
&&
enable
xgetbv
check_code ld intrin.h
"__rdtsc()"
&&
enable
rdtsc
check_code ld mmintrin.h
"_mm_empty()"
&&
enable
mm_empty
...
...
libavutil/x86/cpu.c
View file @
3f150ffb
...
...
@@ -34,8 +34,19 @@
: "=a" (eax), "=S" (ebx), "=c" (ecx), "=d" (edx) \
: "0" (index))
#if HAVE_INLINE_ASM
#define xgetbv(index, eax, edx) \
__asm__ (".byte 0x0f, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c" (index))
#elif HAVE_XGETBV
#include <immintrin.h>
#define xgetbv(index, eax, edx) \
do { \
uint64_t res = __xgetbv(index); \
eax = res; \
edx = res >> 32; \
} while (0)
#endif
/* HAVE_XGETBV */
#define get_eflags(x) \
__asm__ volatile ("pushfl \n" \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment