diff options
author | Henrik Gramner <henrik@gramner.com> | 2015-09-30 23:17:41 +0200 |
---|---|---|
committer | Henrik Gramner <henrik@gramner.com> | 2015-10-01 18:14:12 +0200 |
commit | 17710550c483cc7779ed9ce6129bd85c5fa83a8e (patch) | |
tree | 8f9a3ad928c4b449da80f720cbf887614dddf87a | |
parent | 5d4a3563f23d39338bf6807caaec0e90cce90f3c (diff) | |
download | ffmpeg-streaming-17710550c483cc7779ed9ce6129bd85c5fa83a8e.zip ffmpeg-streaming-17710550c483cc7779ed9ce6129bd85c5fa83a8e.tar.gz |
x86inc: Make cpuflag() and notcpuflag() return 0 or 1
Makes it possible to use them in arithmetic expressions.
-rw-r--r-- | libavutil/x86/x86inc.asm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm index 6ad9785..afcd6b8 100644 --- a/libavutil/x86/x86inc.asm +++ b/libavutil/x86/x86inc.asm @@ -773,8 +773,9 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae, %assign cpuflags_bmi1 (1<<22)|cpuflags_lzcnt %assign cpuflags_bmi2 (1<<23)|cpuflags_bmi1 -%define cpuflag(x) ((cpuflags & (cpuflags_ %+ x)) == (cpuflags_ %+ x)) -%define notcpuflag(x) ((cpuflags & (cpuflags_ %+ x)) != (cpuflags_ %+ x)) +; Returns a boolean value expressing whether or not the specified cpuflag is enabled. +%define cpuflag(x) (((((cpuflags & (cpuflags_ %+ x)) ^ (cpuflags_ %+ x)) - 1) >> 31) & 1) +%define notcpuflag(x) (cpuflag(x) ^ 1) ; Takes an arbitrary number of cpuflags from the above list. ; All subsequent functions (up to the next INIT_CPUFLAGS) is built for the specified cpu. |