summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/builtins/absvti2.c5
-rw-r--r--lib/builtins/addvti3.c4
-rw-r--r--lib/builtins/ashlti3.c4
-rw-r--r--lib/builtins/ashrti3.c4
-rw-r--r--lib/builtins/clzti2.c4
-rw-r--r--lib/builtins/cmpti2.c4
-rw-r--r--lib/builtins/ctzti2.c4
-rw-r--r--lib/builtins/divti3.c4
-rw-r--r--lib/builtins/ffsti2.c4
-rw-r--r--lib/builtins/fixdfti.c4
-rw-r--r--lib/builtins/fixsfti.c4
-rw-r--r--lib/builtins/fixunsdfti.c4
-rw-r--r--lib/builtins/fixunssfti.c4
-rw-r--r--lib/builtins/fixunsxfti.c4
-rw-r--r--lib/builtins/fixxfti.c4
-rw-r--r--lib/builtins/floattidf.c4
-rw-r--r--lib/builtins/floattisf.c4
-rw-r--r--lib/builtins/floattixf.c6
-rw-r--r--lib/builtins/floatuntidf.c6
-rw-r--r--lib/builtins/floatuntisf.c4
-rw-r--r--lib/builtins/floatuntixf.c2
-rw-r--r--lib/builtins/int_types.h7
-rw-r--r--lib/builtins/lshrti3.c4
-rw-r--r--lib/builtins/modti3.c4
-rw-r--r--lib/builtins/muloti4.c4
-rw-r--r--lib/builtins/multi3.c4
-rw-r--r--lib/builtins/mulvti3.c4
-rw-r--r--lib/builtins/negti2.c4
-rw-r--r--lib/builtins/negvti2.c4
-rw-r--r--lib/builtins/parityti2.c4
-rw-r--r--lib/builtins/popcountti2.c4
-rw-r--r--lib/builtins/subvti3.c4
-rw-r--r--lib/builtins/ucmpti2.c4
-rw-r--r--lib/builtins/udivmodti4.c4
-rw-r--r--lib/builtins/udivti3.c4
-rw-r--r--lib/builtins/umodti3.c4
36 files changed, 77 insertions, 73 deletions
diff --git a/lib/builtins/absvti2.c b/lib/builtins/absvti2.c
index c1c727798..437bc3ddc 100644
--- a/lib/builtins/absvti2.c
+++ b/lib/builtins/absvti2.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: absolute value */
@@ -30,4 +30,5 @@ __absvti2(ti_int a)
return (a ^ s) - s;
}
-#endif
+#endif /* CRT_HAS_128BIT */
+
diff --git a/lib/builtins/addvti3.c b/lib/builtins/addvti3.c
index 2efcf3b40..f2a5c5669 100644
--- a/lib/builtins/addvti3.c
+++ b/lib/builtins/addvti3.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: a + b */
@@ -37,4 +37,4 @@ __addvti3(ti_int a, ti_int b)
return s;
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/ashlti3.c b/lib/builtins/ashlti3.c
index 4bd8219b5..08d2181d4 100644
--- a/lib/builtins/ashlti3.c
+++ b/lib/builtins/ashlti3.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: a << b */
@@ -42,4 +42,4 @@ __ashlti3(ti_int a, si_int b)
return result.all;
}
-#endif /* __x86_64 */
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/ashrti3.c b/lib/builtins/ashrti3.c
index ed43641c7..6161bd599 100644
--- a/lib/builtins/ashrti3.c
+++ b/lib/builtins/ashrti3.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: arithmetic a >> b */
@@ -43,4 +43,4 @@ __ashrti3(ti_int a, si_int b)
return result.all;
}
-#endif /* __x86_64 */
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/clzti2.c b/lib/builtins/clzti2.c
index 355c20e42..d478db84d 100644
--- a/lib/builtins/clzti2.c
+++ b/lib/builtins/clzti2.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: the number of leading 0-bits */
@@ -30,4 +30,4 @@ __clzti2(ti_int a)
((si_int)f & ((si_int)(sizeof(di_int) * CHAR_BIT)));
}
-#endif /* __x86_64 */
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/cmpti2.c b/lib/builtins/cmpti2.c
index d0aec452a..d287fab82 100644
--- a/lib/builtins/cmpti2.c
+++ b/lib/builtins/cmpti2.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: if (a < b) returns 0
* if (a == b) returns 1
@@ -39,4 +39,4 @@ __cmpti2(ti_int a, ti_int b)
return 1;
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/ctzti2.c b/lib/builtins/ctzti2.c
index 66dc01b7a..43a8797a1 100644
--- a/lib/builtins/ctzti2.c
+++ b/lib/builtins/ctzti2.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: the number of trailing 0-bits */
@@ -30,4 +30,4 @@ __ctzti2(ti_int a)
((si_int)f & ((si_int)(sizeof(di_int) * CHAR_BIT)));
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/divti3.c b/lib/builtins/divti3.c
index 0242c1368..ad365ab40 100644
--- a/lib/builtins/divti3.c
+++ b/lib/builtins/divti3.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem);
@@ -32,4 +32,4 @@ __divti3(ti_int a, ti_int b)
return (__udivmodti4(a, b, (tu_int*)0) ^ s_a) - s_a; /* negate if s_a == -1 */
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/ffsti2.c b/lib/builtins/ffsti2.c
index 27e15d581..e64266d35 100644
--- a/lib/builtins/ffsti2.c
+++ b/lib/builtins/ffsti2.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* 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.
@@ -34,4 +34,4 @@ __ffsti2(ti_int a)
return __builtin_ctzll(x.s.low) + 1;
}
-#endif /* __x86_64 */
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/fixdfti.c b/lib/builtins/fixdfti.c
index b110a94b8..3b9ddb2cb 100644
--- a/lib/builtins/fixdfti.c
+++ b/lib/builtins/fixdfti.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: convert a to a signed long long, rounding toward zero. */
@@ -42,4 +42,4 @@ __fixdfti(double a)
return (r ^ s) - s;
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/fixsfti.c b/lib/builtins/fixsfti.c
index c730ae046..31c2702e3 100644
--- a/lib/builtins/fixsfti.c
+++ b/lib/builtins/fixsfti.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: convert a to a signed long long, rounding toward zero. */
@@ -42,4 +42,4 @@ __fixsfti(float a)
return (r ^ s) - s;
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/fixunsdfti.c b/lib/builtins/fixunsdfti.c
index fb0336f69..76c859268 100644
--- a/lib/builtins/fixunsdfti.c
+++ b/lib/builtins/fixunsdfti.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: convert a to a unsigned long long, rounding toward zero.
* Negative values all become zero.
@@ -44,4 +44,4 @@ __fixunsdfti(double a)
return r;
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/fixunssfti.c b/lib/builtins/fixunssfti.c
index 8f4c62627..2bb18afeb 100644
--- a/lib/builtins/fixunssfti.c
+++ b/lib/builtins/fixunssfti.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: convert a to a unsigned long long, rounding toward zero.
* Negative values all become zero.
@@ -44,4 +44,4 @@ __fixunssfti(float a)
return r;
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/fixunsxfti.c b/lib/builtins/fixunsxfti.c
index 260bfc01f..db3c0706f 100644
--- a/lib/builtins/fixunsxfti.c
+++ b/lib/builtins/fixunsxfti.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: convert a to a unsigned long long, rounding toward zero.
* Negative values all become zero.
@@ -46,4 +46,4 @@ __fixunsxfti(long double a)
return r;
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/fixxfti.c b/lib/builtins/fixxfti.c
index 973dc31bf..ca3082e87 100644
--- a/lib/builtins/fixxfti.c
+++ b/lib/builtins/fixxfti.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: convert a to a signed long long, rounding toward zero. */
@@ -44,4 +44,4 @@ __fixxfti(long double a)
return (r ^ s) - s;
}
-#endif /* __x86_64 */
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/floattidf.c b/lib/builtins/floattidf.c
index 77749f8d3..042c2031a 100644
--- a/lib/builtins/floattidf.c
+++ b/lib/builtins/floattidf.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: convert a to a double, rounding toward even.*/
@@ -82,4 +82,4 @@ __floattidf(ti_int a)
return fb.f;
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/floattisf.c b/lib/builtins/floattisf.c
index 4776125de..cb4e29aab 100644
--- a/lib/builtins/floattisf.c
+++ b/lib/builtins/floattisf.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: convert a to a float, rounding toward even. */
@@ -81,4 +81,4 @@ __floattisf(ti_int a)
return fb.f;
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/floattixf.c b/lib/builtins/floattixf.c
index 3813dc6b7..866051e2a 100644
--- a/lib/builtins/floattixf.c
+++ b/lib/builtins/floattixf.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: convert a to a long double, rounding toward even. */
@@ -47,7 +47,7 @@ __floattixf(ti_int a)
* P = bit LDBL_MANT_DIG-1 bits to the right of 1
* Q = bit LDBL_MANT_DIG bits to the right of 1
* R = "or" of all bits to the right of Q
- */
+ */
switch (sd)
{
case LDBL_MANT_DIG + 1:
@@ -83,4 +83,4 @@ __floattixf(ti_int a)
return fb.f;
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/floatuntidf.c b/lib/builtins/floatuntidf.c
index 4c1d3289f..e7d6416c1 100644
--- a/lib/builtins/floatuntidf.c
+++ b/lib/builtins/floatuntidf.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: convert a to a double, rounding toward even. */
@@ -43,7 +43,7 @@ __floatuntidf(tu_int a)
* P = bit DBL_MANT_DIG-1 bits to the right of 1
* Q = bit DBL_MANT_DIG bits to the right of 1
* R = "or" of all bits to the right of Q
- */
+ */
switch (sd)
{
case DBL_MANT_DIG + 1:
@@ -79,4 +79,4 @@ __floatuntidf(tu_int a)
return fb.f;
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/floatuntisf.c b/lib/builtins/floatuntisf.c
index c8da2601b..e65db57f1 100644
--- a/lib/builtins/floatuntisf.c
+++ b/lib/builtins/floatuntisf.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: convert a to a float, rounding toward even. */
@@ -78,4 +78,4 @@ __floatuntisf(tu_int a)
return fb.f;
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/floatuntixf.c b/lib/builtins/floatuntixf.c
index dbce80f16..d607cc305 100644
--- a/lib/builtins/floatuntixf.c
+++ b/lib/builtins/floatuntixf.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: convert a to a long double, rounding toward even. */
diff --git a/lib/builtins/int_types.h b/lib/builtins/int_types.h
index fcce390f9..5107f7155 100644
--- a/lib/builtins/int_types.h
+++ b/lib/builtins/int_types.h
@@ -56,8 +56,11 @@ typedef union
}s;
} udwords;
-#if __x86_64
+#if __LP64__
+#define CRT_HAS_128BIT
+#endif
+#ifdef CRT_HAS_128BIT
typedef int ti_int __attribute__ ((mode (TI)));
typedef unsigned tu_int __attribute__ ((mode (TI)));
@@ -105,7 +108,7 @@ static inline tu_int make_tu(du_int h, du_int l) {
return r.all;
}
-#endif /* __x86_64 */
+#endif /* CRT_HAS_128BIT */
typedef union
{
diff --git a/lib/builtins/lshrti3.c b/lib/builtins/lshrti3.c
index be768143b..6fc4e1f42 100644
--- a/lib/builtins/lshrti3.c
+++ b/lib/builtins/lshrti3.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: logical a >> b */
@@ -42,4 +42,4 @@ __lshrti3(ti_int a, si_int b)
return result.all;
}
-#endif /* __x86_64 */
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/modti3.c b/lib/builtins/modti3.c
index 752202d45..ded24a017 100644
--- a/lib/builtins/modti3.c
+++ b/lib/builtins/modti3.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem);
@@ -33,4 +33,4 @@ __modti3(ti_int a, ti_int b)
return (r ^ s) - s; /* negate if s == -1 */
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/muloti4.c b/lib/builtins/muloti4.c
index f58dd074e..0aa6f3b4c 100644
--- a/lib/builtins/muloti4.c
+++ b/lib/builtins/muloti4.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: a * b */
@@ -59,4 +59,4 @@ __muloti4(ti_int a, ti_int b, int* overflow)
return result;
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/multi3.c b/lib/builtins/multi3.c
index 0b8730f08..85a6cf45f 100644
--- a/lib/builtins/multi3.c
+++ b/lib/builtins/multi3.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: a * b */
@@ -55,4 +55,4 @@ __multi3(ti_int a, ti_int b)
return r.all;
}
-#endif /* __x86_64 */
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/mulvti3.c b/lib/builtins/mulvti3.c
index 31f7d2fd3..11d239ac9 100644
--- a/lib/builtins/mulvti3.c
+++ b/lib/builtins/mulvti3.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: a * b */
@@ -57,4 +57,4 @@ __mulvti3(ti_int a, ti_int b)
return a * b;
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/negti2.c b/lib/builtins/negti2.c
index f7e4ad3b9..28ef941e3 100644
--- a/lib/builtins/negti2.c
+++ b/lib/builtins/negti2.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: -a */
@@ -27,4 +27,4 @@ __negti2(ti_int a)
return -a;
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/negvti2.c b/lib/builtins/negvti2.c
index 05df6152f..d15167f53 100644
--- a/lib/builtins/negvti2.c
+++ b/lib/builtins/negvti2.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: -a */
@@ -29,4 +29,4 @@ __negvti2(ti_int a)
return -a;
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/parityti2.c b/lib/builtins/parityti2.c
index a1f47b1d9..fa2838087 100644
--- a/lib/builtins/parityti2.c
+++ b/lib/builtins/parityti2.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: 1 if number of bits is odd else returns 0 */
@@ -28,4 +28,4 @@ __parityti2(ti_int a)
return __paritydi2(x.s.high ^ x.s.low);
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/popcountti2.c b/lib/builtins/popcountti2.c
index 95666738f..d7223d926 100644
--- a/lib/builtins/popcountti2.c
+++ b/lib/builtins/popcountti2.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: count of 1 bits */
@@ -41,4 +41,4 @@ __popcountti2(ti_int a)
return (x + (x >> 8)) & 0xFF; /* (8 significant bits) */
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/subvti3.c b/lib/builtins/subvti3.c
index b32df5e6c..20a0814fc 100644
--- a/lib/builtins/subvti3.c
+++ b/lib/builtins/subvti3.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: a - b */
@@ -37,4 +37,4 @@ __subvti3(ti_int a, ti_int b)
return s;
}
-#endif /* __x86_64 */
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/ucmpti2.c b/lib/builtins/ucmpti2.c
index 5466d2174..95d1ff836 100644
--- a/lib/builtins/ucmpti2.c
+++ b/lib/builtins/ucmpti2.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Returns: if (a < b) returns 0
* if (a == b) returns 1
@@ -39,4 +39,4 @@ __ucmpti2(tu_int a, tu_int b)
return 1;
}
-#endif
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/udivmodti4.c b/lib/builtins/udivmodti4.c
index f619c7495..d8cea2ab7 100644
--- a/lib/builtins/udivmodti4.c
+++ b/lib/builtins/udivmodti4.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
/* Effects: if rem != 0, *rem = a % b
* Returns: a / b
@@ -253,4 +253,4 @@ __udivmodti4(tu_int a, tu_int b, tu_int* rem)
return q.all;
}
-#endif /* __x86_64 */
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/udivti3.c b/lib/builtins/udivti3.c
index d9e1bb46f..4a942b8ad 100644
--- a/lib/builtins/udivti3.c
+++ b/lib/builtins/udivti3.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem);
@@ -26,4 +26,4 @@ __udivti3(tu_int a, tu_int b)
return __udivmodti4(a, b, 0);
}
-#endif /* __x86_64 */
+#endif /* CRT_HAS_128BIT */
diff --git a/lib/builtins/umodti3.c b/lib/builtins/umodti3.c
index 8ebe7f0dc..2ab4dd250 100644
--- a/lib/builtins/umodti3.c
+++ b/lib/builtins/umodti3.c
@@ -14,7 +14,7 @@
#include "int_lib.h"
-#if __x86_64
+#ifdef CRT_HAS_128BIT
tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem);
@@ -28,4 +28,4 @@ __umodti3(tu_int a, tu_int b)
return r;
}
-#endif
+#endif /* CRT_HAS_128BIT */