[PATCH] D81285: [builtins] Change si_int to int in some helper declarations

Anatoly Trosinenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 5 11:11:15 PDT 2020


atrosinenko created this revision.
atrosinenko added a reviewer: howard.hinnant.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

This patch changes types of some integer function arguments or return values from `si_int` to the default `int` type (`typedef`ed to `native_int` to make it obvious this is intentional) to make it more compatible with `libgcc`.

The compiler-rt/lib/builtins/README.txt has a link to the libgcc specification <http://gcc.gnu.org/onlinedocs/gccint/Libgcc.html#Libgcc>. This specification has an explicit note on `int`, `float` and other such types being just illustrations in some cases while the actual types are expressed with machine modes.

Such usage of always-32-bit-wide integer type may lead to issues on 16-bit platforms such as MSP430. Provided libgcc2.h <https://gcc.gnu.org/git/?p=gcc.git;a=blob_plain;f=libgcc/libgcc2.h;hb=HEAD> can be used as a reference for all targets supported by the libgcc, this patch fixes some existing differences in helper declarations.

This patch is expected to not change behavior at all for targets with 32-bit `int` type.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81285

Files:
  compiler-rt/lib/builtins/README.txt
  compiler-rt/lib/builtins/clzdi2.c
  compiler-rt/lib/builtins/clzsi2.c
  compiler-rt/lib/builtins/clzti2.c
  compiler-rt/lib/builtins/ctzdi2.c
  compiler-rt/lib/builtins/ctzsi2.c
  compiler-rt/lib/builtins/ctzti2.c
  compiler-rt/lib/builtins/ffsdi2.c
  compiler-rt/lib/builtins/ffssi2.c
  compiler-rt/lib/builtins/ffsti2.c
  compiler-rt/lib/builtins/int_lib.h
  compiler-rt/lib/builtins/int_types.h
  compiler-rt/lib/builtins/paritydi2.c
  compiler-rt/lib/builtins/paritysi2.c
  compiler-rt/lib/builtins/parityti2.c
  compiler-rt/lib/builtins/popcountdi2.c
  compiler-rt/lib/builtins/popcountsi2.c
  compiler-rt/lib/builtins/popcountti2.c
  compiler-rt/lib/builtins/powidf2.c
  compiler-rt/lib/builtins/powisf2.c
  compiler-rt/lib/builtins/powitf2.c
  compiler-rt/lib/builtins/powixf2.c
  compiler-rt/test/builtins/Unit/clzdi2_test.c
  compiler-rt/test/builtins/Unit/clzsi2_test.c
  compiler-rt/test/builtins/Unit/clzti2_test.c
  compiler-rt/test/builtins/Unit/ctzdi2_test.c
  compiler-rt/test/builtins/Unit/ctzsi2_test.c
  compiler-rt/test/builtins/Unit/ctzti2_test.c
  compiler-rt/test/builtins/Unit/ffsdi2_test.c
  compiler-rt/test/builtins/Unit/ffssi2_test.c
  compiler-rt/test/builtins/Unit/ffsti2_test.c
  compiler-rt/test/builtins/Unit/paritydi2_test.c
  compiler-rt/test/builtins/Unit/paritysi2_test.c
  compiler-rt/test/builtins/Unit/parityti2_test.c
  compiler-rt/test/builtins/Unit/popcountdi2_test.c
  compiler-rt/test/builtins/Unit/popcountsi2_test.c
  compiler-rt/test/builtins/Unit/popcountti2_test.c
  compiler-rt/test/builtins/Unit/powidf2_test.c
  compiler-rt/test/builtins/Unit/powisf2_test.c
  compiler-rt/test/builtins/Unit/powitf2_test.c
  compiler-rt/test/builtins/Unit/powixf2_test.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81285.268883.patch
Type: text/x-patch
Size: 42726 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200605/1f44319f/attachment-0001.bin>


More information about the cfe-commits mailing list