This is the first patch in a series to add support for the AVR target. This patch includes changes to make compiler-rt more target independent by not relying on the width of an int or long.
Some notes:
- I changed the integer types used in many builtins (si_int, du_int, etc) to specific integer widths. My rationale is that even though the libgcc documentation uses types such as int / long / long long, I believe their bit width is actually much more strictly defined. For example: LLVM has a file RuntimeLibcalls.def where it uses very specific bit widths for all these builtins.
- I changed some parameters and return types from si_int to just int when they are used for a number of bits (such as in shift instructions). Affected functions: __ashldi3, __ashrdi3, __ctzdi2, __ffsdi2, __ffssi2, __lshrdi3, __popcountdi2.
- I changed some bare int/unsigned int types to a more specific si_int/su_int. I think this has always been an issue but nobody noticed because they used to be the same. Affected functions: __floatsidf, __floatunsidf.
- I changed a few zero-counting builtin calls (__builtin_clz, __builtin_ctzl, etc) to use a bigger integer width. This seems to work, but perhaps it's better to define macros for these in int_lib.h: this change may have performance implications.
For context: I have a branch here where I collect all the patches needed to add support for AVR in the compiler-rt builtins. Some commits are already upstream, some are still in review, and some need some cleanup before I can post them on Phabricator.
si_int?