Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(573)

Unified Diff: nss/mozilla/nsprpub/pr/src/misc/prdtoa.c

Issue 3135002: Update to NSS 3.12.7 and NSPR 4.8.6.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: nss/mozilla/nsprpub/pr/src/misc/prdtoa.c
===================================================================
--- nss/mozilla/nsprpub/pr/src/misc/prdtoa.c (revision 55475)
+++ nss/mozilla/nsprpub/pr/src/misc/prdtoa.c (working copy)
@@ -46,6 +46,7 @@
#endif
#include "primpl.h"
+#include "prbit.h"
#define MULTIPLE_THREADS
#define ACQUIRE_DTOA_LOCK(n) PR_Lock(dtoa_lock[n])
@@ -742,6 +743,9 @@
(register ULong x)
#endif
{
+#ifdef PR_HAVE_BUILTIN_BITSCAN32
+ return( (!x) ? 32 : pr_bitscan_clz32(x) );
+#else
register int k = 0;
if (!(x & 0xffff0000)) {
@@ -766,6 +770,7 @@
return 32;
}
return k;
+#endif /* PR_HAVE_BUILTIN_BITSCAN32 */
}
static int
@@ -776,6 +781,15 @@
(ULong *y)
#endif
{
+#ifdef PR_HAVE_BUILTIN_BITSCAN32
+ int k;
+ ULong x = *y;
+
+ if (x>1)
+ *y = ( x >> (k = pr_bitscan_ctz32(x)) );
+ else
+ k = ((x ^ 1) << 5);
+#else
register int k;
register ULong x = *y;
@@ -813,6 +827,7 @@
return 32;
}
*y = x;
+#endif /* PR_HAVE_BUILTIN_BITSCAN32 */
return k;
}

Powered by Google App Engine
This is Rietveld 408576698