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

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

Issue 11227042: isEven, isOdd, isNegative, isMaxValue, isMinValue, isInfinite, isPositive, isSingleValue. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase. Created 8 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "vm/globals.h" // Needed here to get TARGET_ARCH_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/intrinsifier.h" 8 #include "vm/intrinsifier.h"
9 9
10 #include "vm/assembler.h" 10 #include "vm/assembler.h"
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1249 &fall_through, 1249 &fall_through,
1250 Assembler::kNearJump, 1250 Assembler::kNearJump,
1251 RAX); // Result register. 1251 RAX); // Result register.
1252 __ movsd(FieldAddress(RAX, Double::value_offset()), XMM0); 1252 __ movsd(FieldAddress(RAX, Double::value_offset()), XMM0);
1253 __ ret(); 1253 __ ret();
1254 __ Bind(&fall_through); 1254 __ Bind(&fall_through);
1255 return false; 1255 return false;
1256 } 1256 }
1257 1257
1258 1258
1259 bool Intrinsifier::Double_isNaN(Assembler* assembler) { 1259 bool Intrinsifier::Double_getIsNaN(Assembler* assembler) {
1260 const Bool& bool_true = Bool::ZoneHandle(Bool::True()); 1260 const Bool& bool_true = Bool::ZoneHandle(Bool::True());
1261 const Bool& bool_false = Bool::ZoneHandle(Bool::False()); 1261 const Bool& bool_false = Bool::ZoneHandle(Bool::False());
1262 Label is_true; 1262 Label is_true;
1263 __ movq(RAX, Address(RSP, +1 * kWordSize)); 1263 __ movq(RAX, Address(RSP, +1 * kWordSize));
1264 __ movsd(XMM0, FieldAddress(RAX, Double::value_offset())); 1264 __ movsd(XMM0, FieldAddress(RAX, Double::value_offset()));
1265 __ comisd(XMM0, XMM0); 1265 __ comisd(XMM0, XMM0);
1266 __ j(PARITY_EVEN, &is_true, Assembler::kNearJump); // NaN -> true; 1266 __ j(PARITY_EVEN, &is_true, Assembler::kNearJump); // NaN -> true;
1267 __ LoadObject(RAX, bool_false); 1267 __ LoadObject(RAX, bool_false);
1268 __ ret(); 1268 __ ret();
1269 __ Bind(&is_true); 1269 __ Bind(&is_true);
1270 __ LoadObject(RAX, bool_true); 1270 __ LoadObject(RAX, bool_true);
1271 __ ret(); 1271 __ ret();
1272 return true; // Method is complete, no slow case. 1272 return true; // Method is complete, no slow case.
1273 } 1273 }
1274 1274
1275 1275
1276 bool Intrinsifier::Double_isNegative(Assembler* assembler) { 1276 bool Intrinsifier::Double_getIsNegative(Assembler* assembler) {
1277 const Bool& bool_true = Bool::ZoneHandle(Bool::True()); 1277 const Bool& bool_true = Bool::ZoneHandle(Bool::True());
1278 const Bool& bool_false = Bool::ZoneHandle(Bool::False()); 1278 const Bool& bool_false = Bool::ZoneHandle(Bool::False());
1279 Label is_false, is_true, is_zero; 1279 Label is_false, is_true, is_zero;
1280 __ movq(RAX, Address(RSP, +1 * kWordSize)); 1280 __ movq(RAX, Address(RSP, +1 * kWordSize));
1281 __ movsd(XMM0, FieldAddress(RAX, Double::value_offset())); 1281 __ movsd(XMM0, FieldAddress(RAX, Double::value_offset()));
1282 __ xorpd(XMM1, XMM1); // 0.0 -> XMM1. 1282 __ xorpd(XMM1, XMM1); // 0.0 -> XMM1.
1283 __ comisd(XMM0, XMM1); 1283 __ comisd(XMM0, XMM1);
1284 __ j(PARITY_EVEN, &is_false, Assembler::kNearJump); // NaN -> false. 1284 __ j(PARITY_EVEN, &is_false, Assembler::kNearJump); // NaN -> false.
1285 __ j(EQUAL, &is_zero, Assembler::kNearJump); // Check for negative zero. 1285 __ j(EQUAL, &is_zero, Assembler::kNearJump); // Check for negative zero.
1286 __ j(ABOVE_EQUAL, &is_false, Assembler::kNearJump); // >= 0 -> false. 1286 __ j(ABOVE_EQUAL, &is_false, Assembler::kNearJump); // >= 0 -> false.
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1567 __ LoadObject(RAX, bool_true); 1567 __ LoadObject(RAX, bool_true);
1568 __ ret(); 1568 __ ret();
1569 return true; 1569 return true;
1570 } 1570 }
1571 1571
1572 #undef __ 1572 #undef __
1573 1573
1574 } // namespace dart 1574 } // namespace dart
1575 1575
1576 #endif // defined TARGET_ARCH_X64 1576 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698