diff options
author | H. Peter Anvin <hpa@zytor.com> | 2012-05-31 10:25:37 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2012-05-31 10:25:37 -0700 |
commit | 290b4cb3a4d32ec8260e88b4e67fc968cf9adb5e (patch) | |
tree | de83fd4983a16831905213858b417239aa58cb75 /test | |
parent | 3d1d159e1c876308712fd5e21089dfddfbad1e69 (diff) | |
download | nasm-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 'test')
0 files changed, 0 insertions, 0 deletions