summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Canon <scanon@apple.com>2010-07-26 18:17:00 +0000
committerStephen Canon <scanon@apple.com>2010-07-26 18:17:00 +0000
commitc41370b2c334c673a95eda48e93c07b28dccd949 (patch)
treea5f743b921af0647be0d146c25a710cedb7a2b73
parentc8c6359f296d4f9e03b378b16ae34fb301e6b155 (diff)
downloadcompiler-rt-c41370b2c334c673a95eda48e93c07b28dccd949.tar.gz
Fix error in rep_clz on non-LP64 targets. Patch by Christoph Gerum
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@109416 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/fp_lib.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/fp_lib.h b/lib/fp_lib.h
index ab425afa6..eac670d7f 100644
--- a/lib/fp_lib.h
+++ b/lib/fp_lib.h
@@ -57,9 +57,9 @@ static inline int rep_clz(rep_t a) {
return __builtin_clzl(a);
#else
if (a & REP_C(0xffffffff00000000))
- return 32 + __builtin_clz(a >> 32);
+ return __builtin_clz(a >> 32);
else
- return __builtin_clz(a & REP_C(0xffffffff));
+ return 32 + __builtin_clz(a & REP_C(0xffffffff));
#endif
}