aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorH. Peter Anvin (Intel) <hpa@zytor.com>2019-08-06 22:33:14 -0700
committerH. Peter Anvin (Intel) <hpa@zytor.com>2019-08-06 22:33:14 -0700
commitd13a6f9708af6dab58b245a9ac2702ecc8e23304 (patch)
tree5c932588a38c4ecdc9c1653b1879b46ecac8903a /include
parentc9cbd03dba0ef318babb6c989e0d4262b811f9ef (diff)
downloadnasm-d13a6f9708af6dab58b245a9ac2702ecc8e23304.tar.gz
nasm-d13a6f9708af6dab58b245a9ac2702ecc8e23304.tar.xz
nasm-d13a6f9708af6dab58b245a9ac2702ecc8e23304.zip
iflag.h: fix IF_CPU_LEVEL_MASK, add missing CPU definitions
Fix the definition of IF_CPU_LEVEL_MASK (which was missing the top bit, IFM_ANY itself). Add CPU definitions that we actually have into directiv.c. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Diffstat (limited to 'include')
-rw-r--r--include/iflag.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/iflag.h b/include/iflag.h
index 0486278f..7cf38eaa 100644
--- a/include/iflag.h
+++ b/include/iflag.h
@@ -86,7 +86,7 @@ IF_GEN_HELPER(xor, ^)
* IF_ANY is the highest CPU level by definition
*/
#define IF_PLEVEL IF_ANY /* Default CPU level */
-#define IF_CPU_LEVEL_MASK (IFM_ANY - 1)
+#define IF_CPU_LEVEL_MASK ((IFM_ANY << 1) - 1)
static inline int iflag_cmp_cpu(const iflag_t *a, const iflag_t *b)
{
@@ -106,7 +106,7 @@ static inline int iflag_cmp_cpu_level(const iflag_t *a, const iflag_t *b)
/* Returns true if the CPU level is at least a certain value */
static inline bool iflag_cpu_level_ok(const iflag_t *a, unsigned int bit)
{
- return _iflag_cpu_level(a) >= IF_GENBIT(bit & 31);
+ return _iflag_cpu_level(a) >= IF_GENBIT(bit);
}
static inline void iflag_set_all_features(iflag_t *a)