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

Unified Diff: src/conversions-inl.h

Issue 1128010: Modify FastD2I to use static_cast instead of lrint(). Benchmarks show that it... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 9 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
« no previous file with comments | « src/conversions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/conversions-inl.h
===================================================================
--- src/conversions-inl.h (revision 4210)
+++ src/conversions-inl.h (working copy)
@@ -41,24 +41,6 @@
namespace v8 {
namespace internal {
-// The fast double-to-int conversion routine does not guarantee
-// rounding towards zero.
-static inline int FastD2I(double x) {
-#ifdef __USE_ISOC99
- // The ISO C99 standard defines the lrint() function which rounds a
- // double to an integer according to the current rounding direction.
- return lrint(x);
-#else
- // This is incredibly slow on Intel x86. The reason is that rounding
- // towards zero is implied by the C standard. This means that the
- // status register of the FPU has to be changed with the 'fldcw'
- // instruction. This completely stalls the pipeline and takes many
- // hundreds of clock cycles.
- return static_cast<int>(x);
-#endif
-}
-
-
// The fast double-to-unsigned-int conversion routine does not guarantee
// rounding towards zero, or any reasonable value if the argument is larger
// than what fits in an unsigned 32-bit integer.
« no previous file with comments | « src/conversions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698