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

Unified Diff: src/conversions-inl.h

Issue 594493002: [turbofan] Add operators for float32 support. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 6 years, 3 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') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/conversions-inl.h
diff --git a/src/conversions-inl.h b/src/conversions-inl.h
index bac15768270f4fe0808c31332e261dac81312dce..ae87dc4d31b01763eef756a1058a05ca0dc1561e 100644
--- a/src/conversions-inl.h
+++ b/src/conversions-inl.h
@@ -67,6 +67,14 @@ inline unsigned int FastD2UI(double x) {
}
+inline float DoubleToFloat32(double x) {
+ // TODO(yanggou): This static_cast is implementation-defined behaviour in C++,
+ // so we may need to do the conversion manually instead to match the spec.
+ volatile float f = static_cast<float>(x);
+ return f;
+}
+
+
inline double DoubleToInteger(double x) {
if (std::isnan(x)) return 0;
if (!std::isfinite(x) || x == 0) return x;
« no previous file with comments | « src/conversions.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698