[compiler-rt] 4d41df6 - [builtins] Support architectures with 16-bit int

Ayke van Laethem via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 25 16:23:12 PDT 2020


Author: Ayke van Laethem
Date: 2020-04-26T01:22:10+02:00
New Revision: 4d41df64828195aa24cddc5d34d3f446ca7bb6d1

URL: https://github.com/llvm/llvm-project/commit/4d41df64828195aa24cddc5d34d3f446ca7bb6d1
DIFF: https://github.com/llvm/llvm-project/commit/4d41df64828195aa24cddc5d34d3f446ca7bb6d1.diff

LOG: [builtins] Support architectures with 16-bit int

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.

Differential Revision: https://reviews.llvm.org/D78662

Added: 
    

Modified: 
    compiler-rt/lib/builtins/absvsi2.c
    compiler-rt/lib/builtins/ashldi3.c
    compiler-rt/lib/builtins/ashrdi3.c
    compiler-rt/lib/builtins/clzdi2.c
    compiler-rt/lib/builtins/ctzdi2.c
    compiler-rt/lib/builtins/ffsdi2.c
    compiler-rt/lib/builtins/ffssi2.c
    compiler-rt/lib/builtins/floatdisf.c
    compiler-rt/lib/builtins/floatsidf.c
    compiler-rt/lib/builtins/floatundisf.c
    compiler-rt/lib/builtins/floatunsidf.c
    compiler-rt/lib/builtins/fp_extend.h
    compiler-rt/lib/builtins/fp_lib.h
    compiler-rt/lib/builtins/int_div_impl.inc
    compiler-rt/lib/builtins/int_types.h
    compiler-rt/lib/builtins/lshrdi3.c
    compiler-rt/lib/builtins/popcountdi2.c
    compiler-rt/lib/builtins/udivmoddi4.c
    compiler-rt/test/builtins/Unit/ashldi3_test.c
    compiler-rt/test/builtins/Unit/ashrdi3_test.c
    compiler-rt/test/builtins/Unit/ctzdi2_test.c
    compiler-rt/test/builtins/Unit/ffsdi2_test.c
    compiler-rt/test/builtins/Unit/ffssi2_test.c
    compiler-rt/test/builtins/Unit/lshrdi3_test.c
    compiler-rt/test/builtins/Unit/popcountdi2_test.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/builtins/absvsi2.c b/compiler-rt/lib/builtins/absvsi2.c
index 44ada169e7e6..9d5de7e8a3f2 100644
--- a/compiler-rt/lib/builtins/absvsi2.c
+++ b/compiler-rt/lib/builtins/absvsi2.c
@@ -18,7 +18,7 @@
 
 COMPILER_RT_ABI si_int __absvsi2(si_int a) {
   const int N = (int)(sizeof(si_int) * CHAR_BIT);
-  if (a == (1 << (N - 1)))
+  if (a == ((si_int)1 << (N - 1)))
     compilerrt_abort();
   const si_int t = a >> (N - 1);
   return (a ^ t) - t;

diff  --git a/compiler-rt/lib/builtins/ashldi3.c b/compiler-rt/lib/builtins/ashldi3.c
index 7c81057a2284..04f22228f11d 100644
--- a/compiler-rt/lib/builtins/ashldi3.c
+++ b/compiler-rt/lib/builtins/ashldi3.c
@@ -16,7 +16,7 @@
 
 // Precondition:  0 <= b < bits_in_dword
 
-COMPILER_RT_ABI di_int __ashldi3(di_int a, si_int b) {
+COMPILER_RT_ABI di_int __ashldi3(di_int a, int b) {
   const int bits_in_word = (int)(sizeof(si_int) * CHAR_BIT);
   dwords input;
   dwords result;

diff  --git a/compiler-rt/lib/builtins/ashrdi3.c b/compiler-rt/lib/builtins/ashrdi3.c
index b9939132205c..934a5c47fd69 100644
--- a/compiler-rt/lib/builtins/ashrdi3.c
+++ b/compiler-rt/lib/builtins/ashrdi3.c
@@ -16,7 +16,7 @@
 
 // Precondition:  0 <= b < bits_in_dword
 
-COMPILER_RT_ABI di_int __ashrdi3(di_int a, si_int b) {
+COMPILER_RT_ABI di_int __ashrdi3(di_int a, int b) {
   const int bits_in_word = (int)(sizeof(si_int) * CHAR_BIT);
   dwords input;
   dwords result;

diff  --git a/compiler-rt/lib/builtins/clzdi2.c b/compiler-rt/lib/builtins/clzdi2.c
index a0bacb2ae39e..d64e9eda8513 100644
--- a/compiler-rt/lib/builtins/clzdi2.c
+++ b/compiler-rt/lib/builtins/clzdi2.c
@@ -30,6 +30,6 @@ COMPILER_RT_ABI si_int __clzdi2(di_int a) {
   dwords x;
   x.all = a;
   const si_int f = -(x.s.high == 0);
-  return __builtin_clz((x.s.high & ~f) | (x.s.low & f)) +
+  return clzsi((x.s.high & ~f) | (x.s.low & f)) +
          (f & ((si_int)(sizeof(si_int) * CHAR_BIT)));
 }

diff  --git a/compiler-rt/lib/builtins/ctzdi2.c b/compiler-rt/lib/builtins/ctzdi2.c
index 9384aa6055a1..8335f5cbb314 100644
--- a/compiler-rt/lib/builtins/ctzdi2.c
+++ b/compiler-rt/lib/builtins/ctzdi2.c
@@ -26,10 +26,10 @@ extern si_int __ctzsi2(si_int);
 
 // Precondition: a != 0
 
-COMPILER_RT_ABI si_int __ctzdi2(di_int a) {
+COMPILER_RT_ABI int __ctzdi2(di_int a) {
   dwords x;
   x.all = a;
   const si_int f = -(x.s.low == 0);
-  return __builtin_ctz((x.s.high & f) | (x.s.low & ~f)) +
+  return ctzsi((x.s.high & f) | (x.s.low & ~f)) +
          (f & ((si_int)(sizeof(si_int) * CHAR_BIT)));
 }

diff  --git a/compiler-rt/lib/builtins/ffsdi2.c b/compiler-rt/lib/builtins/ffsdi2.c
index 9c1a24260956..beae5530430e 100644
--- a/compiler-rt/lib/builtins/ffsdi2.c
+++ b/compiler-rt/lib/builtins/ffsdi2.c
@@ -15,13 +15,13 @@
 // Returns: the index of the least significant 1-bit in a, or
 // the value zero if a is zero. The least significant bit is index one.
 
-COMPILER_RT_ABI si_int __ffsdi2(di_int a) {
+COMPILER_RT_ABI int __ffsdi2(di_int a) {
   dwords x;
   x.all = a;
   if (x.s.low == 0) {
     if (x.s.high == 0)
       return 0;
-    return __builtin_ctz(x.s.high) + (1 + sizeof(si_int) * CHAR_BIT);
+    return ctzsi(x.s.high) + (1 + sizeof(si_int) * CHAR_BIT);
   }
-  return __builtin_ctz(x.s.low) + 1;
+  return ctzsi(x.s.low) + 1;
 }

diff  --git a/compiler-rt/lib/builtins/ffssi2.c b/compiler-rt/lib/builtins/ffssi2.c
index cba1f72fdc61..ddb52927f8db 100644
--- a/compiler-rt/lib/builtins/ffssi2.c
+++ b/compiler-rt/lib/builtins/ffssi2.c
@@ -15,9 +15,9 @@
 // Returns: the index of the least significant 1-bit in a, or
 // the value zero if a is zero. The least significant bit is index one.
 
-COMPILER_RT_ABI si_int __ffssi2(si_int a) {
+COMPILER_RT_ABI int __ffssi2(si_int a) {
   if (a == 0) {
     return 0;
   }
-  return __builtin_ctz(a) + 1;
+  return ctzsi(a) + 1;
 }

diff  --git a/compiler-rt/lib/builtins/floatdisf.c b/compiler-rt/lib/builtins/floatdisf.c
index cd9e0a3b78a5..faaa1bcb3c8e 100644
--- a/compiler-rt/lib/builtins/floatdisf.c
+++ b/compiler-rt/lib/builtins/floatdisf.c
@@ -26,7 +26,7 @@ COMPILER_RT_ABI float __floatdisf(di_int a) {
   const di_int s = a >> (N - 1);
   a = (a ^ s) - s;
   int sd = N - __builtin_clzll(a); // number of significant digits
-  int e = sd - 1;                  // exponent
+  si_int e = sd - 1;               // exponent
   if (sd > FLT_MANT_DIG) {
     //  start:  0000000000000000000001xxxxxxxxxxxxxxxxxxxxxxPQxxxxxxxxxxxxxxxxxx
     //  finish: 000000000000000000000000000000000000001xxxxxxxxxxxxxxxxxxxxxxPQR

diff  --git a/compiler-rt/lib/builtins/floatsidf.c b/compiler-rt/lib/builtins/floatsidf.c
index 2c66167d794d..28cf32f6388b 100644
--- a/compiler-rt/lib/builtins/floatsidf.c
+++ b/compiler-rt/lib/builtins/floatsidf.c
@@ -17,7 +17,7 @@
 
 #include "int_lib.h"
 
-COMPILER_RT_ABI fp_t __floatsidf(int a) {
+COMPILER_RT_ABI fp_t __floatsidf(si_int a) {
 
   const int aWidth = sizeof a * CHAR_BIT;
 
@@ -33,14 +33,14 @@ COMPILER_RT_ABI fp_t __floatsidf(int a) {
   }
 
   // Exponent of (fp_t)a is the width of abs(a).
-  const int exponent = (aWidth - 1) - __builtin_clz(a);
+  const int exponent = (aWidth - 1) - clzsi(a);
   rep_t result;
 
   // Shift a into the significand field and clear the implicit bit.  Extra
   // cast to unsigned int is necessary to get the correct behavior for
   // the input INT_MIN.
   const int shift = significandBits - exponent;
-  result = (rep_t)(unsigned int)a << shift ^ implicitBit;
+  result = (rep_t)(su_int)a << shift ^ implicitBit;
 
   // Insert the exponent
   result += (rep_t)(exponent + exponentBias) << significandBits;
@@ -50,7 +50,7 @@ COMPILER_RT_ABI fp_t __floatsidf(int a) {
 
 #if defined(__ARM_EABI__)
 #if defined(COMPILER_RT_ARMHF_TARGET)
-AEABI_RTABI fp_t __aeabi_i2d(int a) { return __floatsidf(a); }
+AEABI_RTABI fp_t __aeabi_i2d(si_int a) { return __floatsidf(a); }
 #else
 COMPILER_RT_ALIAS(__floatsidf, __aeabi_i2d)
 #endif

diff  --git a/compiler-rt/lib/builtins/floatundisf.c b/compiler-rt/lib/builtins/floatundisf.c
index 87841b761ded..00d61b0c6310 100644
--- a/compiler-rt/lib/builtins/floatundisf.c
+++ b/compiler-rt/lib/builtins/floatundisf.c
@@ -24,7 +24,7 @@ COMPILER_RT_ABI float __floatundisf(du_int a) {
     return 0.0F;
   const unsigned N = sizeof(du_int) * CHAR_BIT;
   int sd = N - __builtin_clzll(a); // number of significant digits
-  int e = sd - 1;                  // 8 exponent
+  si_int e = sd - 1;               // 8 exponent
   if (sd > FLT_MANT_DIG) {
     //  start:  0000000000000000000001xxxxxxxxxxxxxxxxxxxxxxPQxxxxxxxxxxxxxxxxxx
     //  finish: 000000000000000000000000000000000000001xxxxxxxxxxxxxxxxxxxxxxPQR

diff  --git a/compiler-rt/lib/builtins/floatunsidf.c b/compiler-rt/lib/builtins/floatunsidf.c
index 2c01c3041434..9b3e5fea0e45 100644
--- a/compiler-rt/lib/builtins/floatunsidf.c
+++ b/compiler-rt/lib/builtins/floatunsidf.c
@@ -17,7 +17,7 @@
 
 #include "int_lib.h"
 
-COMPILER_RT_ABI fp_t __floatunsidf(unsigned int a) {
+COMPILER_RT_ABI fp_t __floatunsidf(su_int a) {
 
   const int aWidth = sizeof a * CHAR_BIT;
 
@@ -26,7 +26,7 @@ COMPILER_RT_ABI fp_t __floatunsidf(unsigned int a) {
     return fromRep(0);
 
   // Exponent of (fp_t)a is the width of abs(a).
-  const int exponent = (aWidth - 1) - __builtin_clz(a);
+  const int exponent = (aWidth - 1) - clzsi(a);
   rep_t result;
 
   // Shift a into the significand field and clear the implicit bit.
@@ -40,7 +40,7 @@ COMPILER_RT_ABI fp_t __floatunsidf(unsigned int a) {
 
 #if defined(__ARM_EABI__)
 #if defined(COMPILER_RT_ARMHF_TARGET)
-AEABI_RTABI fp_t __aeabi_ui2d(unsigned int a) { return __floatunsidf(a); }
+AEABI_RTABI fp_t __aeabi_ui2d(su_int a) { return __floatunsidf(a); }
 #else
 COMPILER_RT_ALIAS(__floatunsidf, __aeabi_ui2d)
 #endif

diff  --git a/compiler-rt/lib/builtins/fp_extend.h b/compiler-rt/lib/builtins/fp_extend.h
index d2083c426722..fb512672e35e 100644
--- a/compiler-rt/lib/builtins/fp_extend.h
+++ b/compiler-rt/lib/builtins/fp_extend.h
@@ -21,7 +21,7 @@ typedef float src_t;
 typedef uint32_t src_rep_t;
 #define SRC_REP_C UINT32_C
 static const int srcSigBits = 23;
-#define src_rep_t_clz __builtin_clz
+#define src_rep_t_clz clzsi
 
 #elif defined SRC_DOUBLE
 typedef double src_t;

diff  --git a/compiler-rt/lib/builtins/fp_lib.h b/compiler-rt/lib/builtins/fp_lib.h
index e2a906681c46..e6ba077d2313 100644
--- a/compiler-rt/lib/builtins/fp_lib.h
+++ b/compiler-rt/lib/builtins/fp_lib.h
@@ -69,9 +69,9 @@ static __inline int rep_clz(rep_t a) {
   return __builtin_clzl(a);
 #else
   if (a & REP_C(0xffffffff00000000))
-    return __builtin_clz(a >> 32);
+    return clzsi(a >> 32);
   else
-    return 32 + __builtin_clz(a & REP_C(0xffffffff));
+    return 32 + clzsi(a & REP_C(0xffffffff));
 #endif
 }
 

diff  --git a/compiler-rt/lib/builtins/int_div_impl.inc b/compiler-rt/lib/builtins/int_div_impl.inc
index d194ae1e3028..de0373889078 100644
--- a/compiler-rt/lib/builtins/int_div_impl.inc
+++ b/compiler-rt/lib/builtins/int_div_impl.inc
@@ -10,7 +10,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define clz(a) (sizeof(a) == sizeof(unsigned long long) ? __builtin_clzll(a) : __builtin_clz(a))
+#define clz(a) (sizeof(a) == sizeof(unsigned long long) ? __builtin_clzll(a) : clzsi(a))
 
 // Adapted from Figure 3-40 of The PowerPC Compiler Writer's Guide
 static __inline fixuint_t __udivXi3(fixuint_t n, fixuint_t d) {

diff  --git a/compiler-rt/lib/builtins/int_types.h b/compiler-rt/lib/builtins/int_types.h
index f89220d54350..a575c0745656 100644
--- a/compiler-rt/lib/builtins/int_types.h
+++ b/compiler-rt/lib/builtins/int_types.h
@@ -22,11 +22,20 @@
 #ifdef si_int
 #undef si_int
 #endif
-typedef int si_int;
-typedef unsigned su_int;
+typedef int32_t si_int;
+typedef uint32_t su_int;
+#if UINT_MAX == 0xFFFFFFFF
+#define clzsi __builtin_clz
+#define ctzsi __builtin_ctz
+#elif ULONG_MAX == 0xFFFFFFFF
+#define clzsi __builtin_clzl
+#define ctzsi __builtin_ctzl
+#else
+#error could not determine appropriate clzsi macro for this system
+#endif
 
-typedef long long di_int;
-typedef unsigned long long du_int;
+typedef int64_t di_int;
+typedef uint64_t du_int;
 
 typedef union {
   di_int all;

diff  --git a/compiler-rt/lib/builtins/lshrdi3.c b/compiler-rt/lib/builtins/lshrdi3.c
index 97e08e1e9ba0..6072152583ac 100644
--- a/compiler-rt/lib/builtins/lshrdi3.c
+++ b/compiler-rt/lib/builtins/lshrdi3.c
@@ -16,7 +16,7 @@
 
 // Precondition:  0 <= b < bits_in_dword
 
-COMPILER_RT_ABI di_int __lshrdi3(di_int a, si_int b) {
+COMPILER_RT_ABI di_int __lshrdi3(di_int a, int b) {
   const int bits_in_word = (int)(sizeof(si_int) * CHAR_BIT);
   udwords input;
   udwords result;

diff  --git a/compiler-rt/lib/builtins/popcountdi2.c b/compiler-rt/lib/builtins/popcountdi2.c
index 9bbc39c6608a..20dd0b0239ef 100644
--- a/compiler-rt/lib/builtins/popcountdi2.c
+++ b/compiler-rt/lib/builtins/popcountdi2.c
@@ -14,7 +14,7 @@
 
 // Returns: count of 1 bits
 
-COMPILER_RT_ABI si_int __popcountdi2(di_int a) {
+COMPILER_RT_ABI int __popcountdi2(di_int a) {
   du_int x2 = (du_int)a;
   x2 = x2 - ((x2 >> 1) & 0x5555555555555555uLL);
   // Every 2 bits holds the sum of every pair of bits (32)

diff  --git a/compiler-rt/lib/builtins/udivmoddi4.c b/compiler-rt/lib/builtins/udivmoddi4.c
index 5b297c32d790..10b41df28f84 100644
--- a/compiler-rt/lib/builtins/udivmoddi4.c
+++ b/compiler-rt/lib/builtins/udivmoddi4.c
@@ -87,7 +87,7 @@ COMPILER_RT_ABI du_int __udivmoddi4(du_int a, du_int b, du_int *rem) {
     // K K
     // ---
     // K 0
-    sr = __builtin_clz(d.s.high) - __builtin_clz(n.s.high);
+    sr = clzsi(d.s.high) - clzsi(n.s.high);
     // 0 <= sr <= n_uword_bits - 2 or sr large
     if (sr > n_uword_bits - 2) {
       if (rem)
@@ -120,7 +120,7 @@ COMPILER_RT_ABI du_int __udivmoddi4(du_int a, du_int b, du_int *rem) {
       // K X
       // ---
       // 0 K
-      sr = 1 + n_uword_bits + __builtin_clz(d.s.low) - __builtin_clz(n.s.high);
+      sr = 1 + n_uword_bits + clzsi(d.s.low) - clzsi(n.s.high);
       // 2 <= sr <= n_udword_bits - 1
       // q.all = n.all << (n_udword_bits - sr);
       // r.all = n.all >> sr;
@@ -145,7 +145,7 @@ COMPILER_RT_ABI du_int __udivmoddi4(du_int a, du_int b, du_int *rem) {
       // K X
       // ---
       // K K
-      sr = __builtin_clz(d.s.high) - __builtin_clz(n.s.high);
+      sr = clzsi(d.s.high) - clzsi(n.s.high);
       // 0 <= sr <= n_uword_bits - 1 or sr large
       if (sr > n_uword_bits - 1) {
         if (rem)

diff  --git a/compiler-rt/test/builtins/Unit/ashldi3_test.c b/compiler-rt/test/builtins/Unit/ashldi3_test.c
index 6061421d4110..82ba51a80278 100644
--- a/compiler-rt/test/builtins/Unit/ashldi3_test.c
+++ b/compiler-rt/test/builtins/Unit/ashldi3_test.c
@@ -19,9 +19,9 @@
 
 // Precondition:  0 <= b < bits_in_dword
 
-COMPILER_RT_ABI di_int __ashldi3(di_int a, si_int b);
+COMPILER_RT_ABI di_int __ashldi3(di_int a, int b);
 
-int test__ashldi3(di_int a, si_int b, di_int expected)
+int test__ashldi3(di_int a, int b, di_int expected)
 {
     di_int x = __ashldi3(a, b);
     if (x != expected)

diff  --git a/compiler-rt/test/builtins/Unit/ashrdi3_test.c b/compiler-rt/test/builtins/Unit/ashrdi3_test.c
index d3749f1b21ef..03bff4fc610e 100644
--- a/compiler-rt/test/builtins/Unit/ashrdi3_test.c
+++ b/compiler-rt/test/builtins/Unit/ashrdi3_test.c
@@ -19,9 +19,9 @@
 
 // Precondition:  0 <= b < bits_in_dword
 
-COMPILER_RT_ABI di_int __ashrdi3(di_int a, si_int b);
+COMPILER_RT_ABI di_int __ashrdi3(di_int a, int b);
 
-int test__ashrdi3(di_int a, si_int b, di_int expected)
+int test__ashrdi3(di_int a, int b, di_int expected)
 {
     di_int x = __ashrdi3(a, b);
     if (x != expected)

diff  --git a/compiler-rt/test/builtins/Unit/ctzdi2_test.c b/compiler-rt/test/builtins/Unit/ctzdi2_test.c
index ebec5fab138f..19994ec1a3f5 100644
--- a/compiler-rt/test/builtins/Unit/ctzdi2_test.c
+++ b/compiler-rt/test/builtins/Unit/ctzdi2_test.c
@@ -19,11 +19,11 @@
 
 // Precondition: a != 0
 
-COMPILER_RT_ABI si_int __ctzdi2(di_int a);
+COMPILER_RT_ABI int __ctzdi2(di_int a);
 
-int test__ctzdi2(di_int a, si_int expected)
+int test__ctzdi2(di_int a, int expected)
 {
-    si_int x = __ctzdi2(a);
+    int x = __ctzdi2(a);
     if (x != expected)
         printf("error in __ctzdi2(0x%llX) = %d, expected %d\n", a, x, expected);
     return x != expected;

diff  --git a/compiler-rt/test/builtins/Unit/ffsdi2_test.c b/compiler-rt/test/builtins/Unit/ffsdi2_test.c
index 50cb0bf68fd3..0a2d1cf16fe4 100644
--- a/compiler-rt/test/builtins/Unit/ffsdi2_test.c
+++ b/compiler-rt/test/builtins/Unit/ffsdi2_test.c
@@ -18,11 +18,11 @@
 // Returns: the index of the least significant 1-bit in a, or
 // the value zero if a is zero. The least significant bit is index one.
 
-COMPILER_RT_ABI si_int __ffsdi2(di_int a);
+COMPILER_RT_ABI int __ffsdi2(di_int a);
 
-int test__ffsdi2(di_int a, si_int expected)
+int test__ffsdi2(di_int a, int expected)
 {
-    si_int x = __ffsdi2(a);
+    int x = __ffsdi2(a);
     if (x != expected)
         printf("error in __ffsdi2(0x%llX) = %d, expected %d\n", a, x, expected);
     return x != expected;

diff  --git a/compiler-rt/test/builtins/Unit/ffssi2_test.c b/compiler-rt/test/builtins/Unit/ffssi2_test.c
index a4876ea3e830..0f0966c0b730 100644
--- a/compiler-rt/test/builtins/Unit/ffssi2_test.c
+++ b/compiler-rt/test/builtins/Unit/ffssi2_test.c
@@ -18,11 +18,11 @@
 // Returns: the index of the least significant 1-bit in a, or
 // the value zero if a is zero. The least significant bit is index one.
 
-COMPILER_RT_ABI si_int __ffssi2(si_int a);
+COMPILER_RT_ABI int __ffssi2(si_int a);
 
-int test__ffssi2(si_int a, si_int expected)
+int test__ffssi2(si_int a, int expected)
 {
-    si_int x = __ffssi2(a);
+    int x = __ffssi2(a);
     if (x != expected)
         printf("error in __ffssi2(0x%X) = %d, expected %d\n", a, x, expected);
     return x != expected;

diff  --git a/compiler-rt/test/builtins/Unit/lshrdi3_test.c b/compiler-rt/test/builtins/Unit/lshrdi3_test.c
index 3e3c4b634520..9afd4e4fa481 100644
--- a/compiler-rt/test/builtins/Unit/lshrdi3_test.c
+++ b/compiler-rt/test/builtins/Unit/lshrdi3_test.c
@@ -19,9 +19,9 @@
 
 // Precondition:  0 <= b < bits_in_dword
 
-COMPILER_RT_ABI di_int __lshrdi3(di_int a, si_int b);
+COMPILER_RT_ABI di_int __lshrdi3(di_int a, int b);
 
-int test__lshrdi3(di_int a, si_int b, di_int expected)
+int test__lshrdi3(di_int a, int b, di_int expected)
 {
     di_int x = __lshrdi3(a, b);
     if (x != expected)

diff  --git a/compiler-rt/test/builtins/Unit/popcountdi2_test.c b/compiler-rt/test/builtins/Unit/popcountdi2_test.c
index 5bec9ce9d152..3b2b5e52ccd6 100644
--- a/compiler-rt/test/builtins/Unit/popcountdi2_test.c
+++ b/compiler-rt/test/builtins/Unit/popcountdi2_test.c
@@ -18,7 +18,7 @@
 
 // Returns: count of 1 bits
 
-COMPILER_RT_ABI si_int __popcountdi2(di_int a);
+COMPILER_RT_ABI int __popcountdi2(di_int a);
 
 int naive_popcount(di_int a)
 {
@@ -30,8 +30,8 @@ int naive_popcount(di_int a)
 
 int test__popcountdi2(di_int a)
 {
-    si_int x = __popcountdi2(a);
-    si_int expected = naive_popcount(a);
+    int x = __popcountdi2(a);
+    int expected = naive_popcount(a);
     if (x != expected)
         printf("error in __popcountdi2(0x%llX) = %d, expected %d\n",
                a, x, expected);


        


More information about the llvm-commits mailing list