We implement the LEADZ and TRAILZ intrinsics in terms of the built-in clz() and ctz() functions. Since these are not available for 128-bit integer types, we used to have support functions _gfortran_clz128() and _gfortran_ctz128() in libgfortran. In 2010, I applied a patch to avoid this and emit the necessary arithmetic directly from the front-end (https://gcc.gnu.org/ml/fortran/2010-09/msg00181.html). The support functions were kept in libgfortran for backward compatibility, but we can now remove them as we break the ABI.
Attached patch is bootstrapped and regtested on x86_64-apple-darwin13.6.0. OK to commit? FX
bitint.ChangeLog
Description: Binary data
bitint.diff
Description: Binary data