summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/runmath.in
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/asymptote/runmath.in')
-rw-r--r--Build/source/utils/asymptote/runmath.in8
1 files changed, 4 insertions, 4 deletions
diff --git a/Build/source/utils/asymptote/runmath.in b/Build/source/utils/asymptote/runmath.in
index 5e26311c53c..ed4ad9e7bc8 100644
--- a/Build/source/utils/asymptote/runmath.in
+++ b/Build/source/utils/asymptote/runmath.in
@@ -297,14 +297,14 @@ Int NOT(Int a)
Int CLZ(Int a)
{
- if((unsignedInt) a > 0xFFFFFFFF) return -1;
+ if((uint32_t) a > 0xFFFFFFFF) return -1;
return CLZ((uint32_t) a);
}
Int CTZ(Int a)
{
- if((unsignedInt) a > 0xFFFFFFFF) return -1;
-#ifdef __GNUC__
+ if((uint32_t) a > 0xFFFFFFFF) return -1;
+#if __GNUC_PREREQ(3,4)
return __builtin_ctz(a);
#else
// find the number of trailing zeros in a 32-bit number
@@ -312,7 +312,7 @@ Int CTZ(Int a)
0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8,
31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9
};
- return MultiplyDeBruijnBitPosition[((unsignedInt)((a & -a) * 0x077CB531U))
+ return MultiplyDeBruijnBitPosition[((uint32_t)((a & -a) * 0x077CB531U))
>> 27];
#endif
}