[PATCH] D86221: [compiler-rt][builtins] Do not assume int to be at least 32 bit wide
Anatoly Trosinenko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 19 08:45:33 PDT 2020
atrosinenko created this revision.
atrosinenko added reviewers: efriedma, MaskRay, aykevl, uabelho.
Herald added subscribers: Sanitizers, dberris.
Herald added a project: Sanitizers.
atrosinenko requested review of this revision.
This patch drops implicit assumptions on int/unsigned types being at least 32 bit wide. This is not always true on 16 bit targets such as MSP430.
This patch contains the following changes:
- `rep_clz(a)` and `src_rep_t_clz(a)` for 64-bit rep_t from soft-float utility headers are moved to `int_lib.h` as a common `clzdi(a)` implementation (signedness was changed to match one of __builtin_clz series of intrinsics). The original functions was turned into inline proxy functions that merely adapt the signedness
- `__floatsi[st]f` and `__floatunsi[st]f3` are updated to accept a signed/unsigned integer argument of a specific width
- similar changes were made for some unit tests
- `__udivmoddi4` switched to `ctzsi` macro defined in `int_lib.h` instead of `__builtin_ctz`
- the `*vfp` LibCall versions were NOT touched
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D86221
Files:
compiler-rt/lib/builtins/floatsisf.c
compiler-rt/lib/builtins/floatsitf.c
compiler-rt/lib/builtins/floatunsisf.c
compiler-rt/lib/builtins/floatunsitf.c
compiler-rt/lib/builtins/fp_extend.h
compiler-rt/lib/builtins/fp_lib.h
compiler-rt/lib/builtins/int_lib.h
compiler-rt/lib/builtins/udivmoddi4.c
compiler-rt/test/builtins/Unit/floatditf_test.c
compiler-rt/test/builtins/Unit/floatsitf_test.c
compiler-rt/test/builtins/Unit/floatunditf_test.c
compiler-rt/test/builtins/Unit/floatunsitf_test.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86221.286572.patch
Type: text/x-patch
Size: 8227 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200819/a182cdaa/attachment-0001.bin>
More information about the cfe-commits
mailing list