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

Side by Side Diff: runtime/vm/simulator_dbc.cc

Issue 2341683003: DBC: Double converstion instructions (Closed)
Patch Set: Fix FloatToDouble Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include <setjmp.h> // NOLINT 5 #include <setjmp.h> // NOLINT
6 #include <stdlib.h> 6 #include <stdlib.h>
7 7
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 #if defined(TARGET_ARCH_DBC) 9 #if defined(TARGET_ARCH_DBC)
10 10
(...skipping 1951 matching lines...) Expand 10 before | Expand all | Expand 10 after
1962 1962
1963 { 1963 {
1964 BYTECODE(DMax, A_B_C); 1964 BYTECODE(DMax, A_B_C);
1965 const double lhs = bit_cast<double, RawObject*>(FP[rB]); 1965 const double lhs = bit_cast<double, RawObject*>(FP[rB]);
1966 const double rhs = bit_cast<double, RawObject*>(FP[rC]); 1966 const double rhs = bit_cast<double, RawObject*>(FP[rC]);
1967 FP[rA] = bit_cast<RawObject*, double>(fmax(lhs, rhs)); 1967 FP[rA] = bit_cast<RawObject*, double>(fmax(lhs, rhs));
1968 DISPATCH(); 1968 DISPATCH();
1969 } 1969 }
1970 1970
1971 { 1971 {
1972 BYTECODE(DTruncate, A_D);
1973 const double value = bit_cast<double, RawObject*>(FP[rD]);
1974 FP[rA] = bit_cast<RawObject*, double>(trunc(value));
1975 DISPATCH();
1976 }
1977
1978 {
1979 BYTECODE(DFloor, A_D);
1980 const double value = bit_cast<double, RawObject*>(FP[rD]);
1981 FP[rA] = bit_cast<RawObject*, double>(floor(value));
1982 DISPATCH();
1983 }
1984
1985 {
1986 BYTECODE(DCeil, A_D);
1987 const double value = bit_cast<double, RawObject*>(FP[rD]);
1988 FP[rA] = bit_cast<RawObject*, double>(ceil(value));
1989 DISPATCH();
1990 }
1991
1992 {
1993 BYTECODE(DoubleToFloat, A_D);
1994 const double value = bit_cast<double, RawObject*>(FP[rD]);
1995 const float valuef = static_cast<float>(value);
1996 *reinterpret_cast<float*>(&FP[rA]) = valuef;
1997 DISPATCH();
1998 }
1999
2000 {
2001 BYTECODE(FloatToDouble, A_D);
2002 const float valuef = *reinterpret_cast<float*>(&FP[rD]);
2003 const double value = static_cast<double>(valuef);
2004 FP[rA] = bit_cast<RawObject*, double>(value);
2005 DISPATCH();
2006 }
2007
2008 {
1972 BYTECODE(LoadIndexedFloat64, A_B_C); 2009 BYTECODE(LoadIndexedFloat64, A_B_C);
1973 uint8_t* data = SimulatorHelpers::GetTypedData(FP[rB], FP[rC], 3); 2010 uint8_t* data = SimulatorHelpers::GetTypedData(FP[rB], FP[rC], 3);
1974 *reinterpret_cast<uint64_t*>(&FP[rA]) = *reinterpret_cast<uint64_t*>(data); 2011 *reinterpret_cast<uint64_t*>(&FP[rA]) = *reinterpret_cast<uint64_t*>(data);
1975 DISPATCH(); 2012 DISPATCH();
1976 } 2013 }
1977 2014
1978 { 2015 {
1979 BYTECODE(LoadIndexed8Float64, A_B_C); 2016 BYTECODE(LoadIndexed8Float64, A_B_C);
1980 ASSERT(RawObject::IsTypedDataClassId(FP[rB]->GetClassId())); 2017 ASSERT(RawObject::IsTypedDataClassId(FP[rB]->GetClassId()));
1981 RawTypedData* array = reinterpret_cast<RawTypedData*>(FP[rB]); 2018 RawTypedData* array = reinterpret_cast<RawTypedData*>(FP[rB]);
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
2119 DISPATCH(); 2156 DISPATCH();
2120 } 2157 }
2121 2158
2122 { 2159 {
2123 BYTECODE(DMax, A_B_C); 2160 BYTECODE(DMax, A_B_C);
2124 UNREACHABLE(); 2161 UNREACHABLE();
2125 DISPATCH(); 2162 DISPATCH();
2126 } 2163 }
2127 2164
2128 { 2165 {
2166 BYTECODE(DTruncate, A_D);
2167 UNREACHABLE();
2168 DISPATCH();
2169 }
2170
2171 {
2172 BYTECODE(DFloor, A_D);
2173 UNREACHABLE();
2174 DISPATCH();
2175 }
2176
2177 {
2178 BYTECODE(DCeil, A_D);
2179 UNREACHABLE();
2180 DISPATCH();
2181 }
2182
2183 {
2184 BYTECODE(DoubleToFloat, A_D);
2185 UNREACHABLE();
2186 DISPATCH();
2187 }
2188
2189 {
2190 BYTECODE(FloatToDouble, A_D);
2191 UNREACHABLE();
2192 DISPATCH();
2193 }
2194
2195 {
2129 BYTECODE(LoadIndexedFloat64, A_B_C); 2196 BYTECODE(LoadIndexedFloat64, A_B_C);
2130 UNREACHABLE(); 2197 UNREACHABLE();
2131 DISPATCH(); 2198 DISPATCH();
2132 } 2199 }
2133 2200
2134 { 2201 {
2135 BYTECODE(LoadIndexed8Float64, A_B_C); 2202 BYTECODE(LoadIndexed8Float64, A_B_C);
2136 UNREACHABLE(); 2203 UNREACHABLE();
2137 DISPATCH(); 2204 DISPATCH();
2138 } 2205 }
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after
3327 pc_ = pc; 3394 pc_ = pc;
3328 special_[kExceptionSpecialIndex] = raw_exception; 3395 special_[kExceptionSpecialIndex] = raw_exception;
3329 special_[kStacktraceSpecialIndex] = raw_stacktrace; 3396 special_[kStacktraceSpecialIndex] = raw_stacktrace;
3330 buf->Longjmp(); 3397 buf->Longjmp();
3331 UNREACHABLE(); 3398 UNREACHABLE();
3332 } 3399 }
3333 3400
3334 } // namespace dart 3401 } // namespace dart
3335 3402
3336 #endif // defined TARGET_ARCH_DBC 3403 #endif // defined TARGET_ARCH_DBC
OLDNEW
« runtime/vm/intermediate_language_dbc.cc ('K') | « runtime/vm/intermediate_language_dbc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698