summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2012-07-09 02:21:28 +0200
committerMartin Storsjö <martin@martin.st>2012-07-10 14:33:32 +0300
commit358d854df80e035c9d47bae21492b51b406dbe68 (patch)
tree6abb1927a4d953cc3fc4c2a2160638e819a19ef5 /libavutil
parentc0ee695bd7b278f83252c9f93803b107d7aa1e9a (diff)
x86/cpu: implement get/set_eflags using intrinsics
Signed-off-by: Diego Biurrun <diego@biurrun.de> Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/x86/cpu.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavutil/x86/cpu.c b/libavutil/x86/cpu.c
index 7d65c6075e..d3b1bd5ea6 100644
--- a/libavutil/x86/cpu.c
+++ b/libavutil/x86/cpu.c
@@ -62,6 +62,8 @@
} while (0)
#endif /* HAVE_XGETBV */
+#if HAVE_INLINE_ASM
+
#define get_eflags(x) \
__asm__ volatile ("pushfl \n" \
"pop %0 \n" \
@@ -72,6 +74,18 @@
"popfl \n" \
:: "r"(x))
+#elif HAVE_RWEFLAGS
+
+#include <intrin.h>
+
+#define get_eflags(x) \
+ x = __readeflags()
+
+#define set_eflags(x) \
+ __writeeflags(x)
+
+#endif /* HAVE_INLINE_ASM */
+
/* Function to test if multimedia instructions are supported... */
int ff_get_cpu_flags_x86(void)
{