summaryrefslogtreecommitdiff
path: root/macros/ifunc.mac
Commit message (Collapse)AuthorAgeFilesLines
* preproc: standard macros now C-safe, %aliases off, fix %? recursionH. Peter Anvin2019-08-271-7/+7
| | | | | | | | | | | | | | | | | | | | Enough users expect the namespace starting with underscore to be safe for symbols. Change our private namespace from __foo__ to __?foo?__. Use %defalias to provide backwards compatiblity (by using %defalias instead of %define, we handle the case properly where the user changes the value.) Add a preprocessor directive: %aliases off ... to disable all smacro aliases and thereby making the namespace clean. Finally, fix infinite recursion when seeing %? or %?? due to paste_tokens(). If we don't paste anything, the expansion is done. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* ifunc.mac: the ilog2 warning may want to be both ceil and floorH. Peter Anvin2016-05-241-1/+3
| | | | | | | | | There is no reason why the warning-generating ilog2 has to be only the floor variant. However, I am pretty sure we can simply implement the ilog2cw() as a macro only; we can always fix that if that turns out to be incorrect. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* eval: add general support for "integer functions" and add ilog2*()H. Peter Anvin2012-05-311-0/+46
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>