Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
3f150ffb
Commit
3f150ffb
authored
12 years ago
by
Ronald S. Bultje
Committed by
Martin Storsjö
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
x86/cpu: implement support for xgetbv through intrinsics
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
f80ddd5b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
configure
+2
-0
2 additions, 0 deletions
configure
libavutil/x86/cpu.c
+11
-0
11 additions, 0 deletions
libavutil/x86/cpu.c
with
13 additions
and
0 deletions
configure
+
2
−
0
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
...
...
This diff is collapsed.
Click to expand it.
libavutil/x86/cpu.c
+
11
−
0
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" \
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment