summaryrefslogtreecommitdiff
path: root/tokens.dat
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2012-05-31 10:25:37 -0700
committerH. Peter Anvin <hpa@zytor.com>2012-05-31 10:25:37 -0700
commit290b4cb3a4d32ec8260e88b4e67fc968cf9adb5e (patch)
treede83fd4983a16831905213858b417239aa58cb75 /tokens.dat
parent3d1d159e1c876308712fd5e21089dfddfbad1e69 (diff)
downloadnasm-290b4cb3a4d32ec8260e88b4e67fc968cf9adb5e.tar.gz
nasm-290b4cb3a4d32ec8260e88b4e67fc968cf9adb5e.tar.bz2
nasm-290b4cb3a4d32ec8260e88b4e67fc968cf9adb5e.zip
eval: add general support for "integer functions" and add ilog2*()
Add general support in the function parser for "integer functions" (actually implemented as special unary operators, then wrapped in macros) and implement a family of integer logarithms. The only difference is the behavior on a non-power-of-two argument: ilog2[e] -- throw an error ilog2w -- throw a warning ilog2f -- round down to power of 2 ilog2c -- round up to power of 2 This is useful for back-converting from masks to bit values. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'tokens.dat')
-rw-r--r--tokens.dat6
1 files changed, 6 insertions, 0 deletions
diff --git a/tokens.dat b/tokens.dat
index bb5fccb..c2df469 100644
--- a/tokens.dat
+++ b/tokens.dat
@@ -97,6 +97,12 @@ __utf32__
__utf32le__
__utf32be__
+% TOKEN_IFUNC, 0, IFUNC_{__*__}
+__ilog2e__
+__ilog2w__
+__ilog2f__
+__ilog2c__
+
% TOKEN_*, 0, 0
seg
wrt