[x265] [PATCH 04 of 20] x86inc: Make cpuflag() and notcpuflag() return 0 or 1

vignesh at multicorewareinc.com vignesh at multicorewareinc.com
Mon Jun 12 07:37:46 CEST 2017


# HG changeset patch
# User Vignesh Vijayakumar
# Date 1496741949 -19800
#      Tue Jun 06 15:09:09 2017 +0530
# Node ID 058fd37ef0f152731c29494e995c3114cb6362a0
# Parent  042023014fd0be6bfa5722915b306c68a8f909e8
x86inc: Make cpuflag() and notcpuflag() return 0 or 1

diff -r 042023014fd0 -r 058fd37ef0f1 source/common/x86/x86inc.asm
--- a/source/common/x86/x86inc.asm	Tue May 30 12:29:43 2017 +0530
+++ b/source/common/x86/x86inc.asm	Tue Jun 06 15:09:09 2017 +0530
@@ -754,8 +754,9 @@
 %assign cpuflags_aligned  (1<<22) ; not a cpu feature, but a function variant
 %assign cpuflags_atom     (1<<23)
 
-%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.


More information about the x265-devel mailing list