[builtins] Improve compatibility with 16 bit targets
authorAnatoly Trosinenko <atrosinenko@accesssoftek.com>
Fri, 26 Jun 2020 12:31:04 +0000 (15:31 +0300)
committerAnton Korobeynikov <anton@korobeynikov.info>
Fri, 26 Jun 2020 12:31:11 +0000 (15:31 +0300)
commita4e8f7fe3f38085c0fdd6e34e870f8e9c6c72861
tree9142dfd37bcb092311d98345cecfa55d80957098
parent754f3c4af4b8526d7576c8e92959ad10d40b6e2e
[builtins] Improve compatibility with 16 bit targets

Some parts of existing codebase assume the default `int` type to be (at least) 32 bit wide. On 16 bit targets such as MSP430 this may cause Undefined Behavior or results being defined but incorrect.

Differential Revision: https://reviews.llvm.org/D81408
compiler-rt/lib/builtins/floatdidf.c
compiler-rt/lib/builtins/floatundidf.c
compiler-rt/lib/builtins/fp_lib.h