Commit Graph

7 Commits

Author SHA1 Message Date
H. Peter Anvin
0a126062fb ilog2(): inline functions if practical
For many (most?) targets these will be very small functions, so inline
them.  However, just in case make these external library functions.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-09-27 13:34:42 -07:00
H. Peter Anvin
97408d67dd Merge remote-tracking branch 'origin/elf' 2017-04-29 13:28:12 -07:00
H. Peter Anvin
65ce38a819 nasmlib/ilog2.c: force the shift in ROUND() to be an uint32_t
Some compilers apparently warn on 1 << w for w == 31; fix it by
explicitly making it UINT32_C(1).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-29 13:13:59 -07:00
H. Peter Anvin
e558dfd249 configure, ilog2: add some MSVC intrinsics
Add MSVC intrinsics for byte swapping and for BSF (ilog2).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-18 16:05:22 -07:00
H. Peter Anvin
8d4fb26ad4 Various fixes to the ilog2 functions
Fix several bugs in the ilog2 functions.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-11-15 14:23:54 -08:00
H. Peter Anvin
069ad5fc18 nasmlib: we need the exact size for the clz functions
We need to use the exact size for the clz functions, otherwise we will
generate the wrong result.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-11-15 14:05:53 -08:00
H. Peter Anvin
3ef4f00d5a lib: split library into stdlib and nasmlib; header handling fixes
Split lib/ into nasmlib/ (for nasm-specific functions) and stdlib/
(for replacements for C library functions which may be missing.)

Rename the ersatz inttypes.h to nasmint.h so we can use a simple test
in compiler.h instead of dealing with include path magic.

Remove tests in configure.in for ancient missing functions (which will
break the build anyway.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 12:20:02 -08:00