| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 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 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 __ LoadObject(R0, Bool::False()); // Smi == Mint -> false. | 942 __ LoadObject(R0, Bool::False()); // Smi == Mint -> false. |
| 943 __ Ret(); | 943 __ Ret(); |
| 944 | 944 |
| 945 __ Bind(&receiver_not_smi); | 945 __ Bind(&receiver_not_smi); |
| 946 // R1:: receiver. | 946 // R1:: receiver. |
| 947 | 947 |
| 948 __ CompareClassId(R1, kMintCid, R2); | 948 __ CompareClassId(R1, kMintCid, R2); |
| 949 __ b(&fall_through, NE); | 949 __ b(&fall_through, NE); |
| 950 // Receiver is Mint, return false if right is Smi. | 950 // Receiver is Mint, return false if right is Smi. |
| 951 __ tst(R0, Operand(kSmiTagMask)); | 951 __ tst(R0, Operand(kSmiTagMask)); |
| 952 __ b(&fall_through, NE); | 952 __ LoadObject(R0, Bool::False(), EQ); |
| 953 __ LoadObject(R0, Bool::False()); | 953 __ bx(LR, EQ); |
| 954 __ Ret(); | |
| 955 // TODO(srdjan): Implement Mint == Mint comparison. | 954 // TODO(srdjan): Implement Mint == Mint comparison. |
| 956 | 955 |
| 957 __ Bind(&fall_through); | 956 __ Bind(&fall_through); |
| 958 } | 957 } |
| 959 | 958 |
| 960 | 959 |
| 961 void Intrinsifier::Integer_equal(Assembler* assembler) { | 960 void Intrinsifier::Integer_equal(Assembler* assembler) { |
| 962 Integer_equalToInteger(assembler); | 961 Integer_equalToInteger(assembler); |
| 963 } | 962 } |
| 964 | 963 |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1221 // convert NaN to an int. | 1220 // convert NaN to an int. |
| 1222 __ vcmpd(D0, D0); | 1221 __ vcmpd(D0, D0); |
| 1223 __ vmstat(); | 1222 __ vmstat(); |
| 1224 __ b(&fall_through, VS); | 1223 __ b(&fall_through, VS); |
| 1225 | 1224 |
| 1226 __ vcvtid(S0, D0); | 1225 __ vcvtid(S0, D0); |
| 1227 __ vmovrs(R0, S0); | 1226 __ vmovrs(R0, S0); |
| 1228 // Overflow is signaled with minint. | 1227 // Overflow is signaled with minint. |
| 1229 // Check for overflow and that it fits into Smi. | 1228 // Check for overflow and that it fits into Smi. |
| 1230 __ CompareImmediate(R0, 0xC0000000); | 1229 __ CompareImmediate(R0, 0xC0000000); |
| 1231 __ b(&fall_through, MI); | 1230 __ SmiTag(R0, PL); |
| 1232 __ SmiTag(R0); | 1231 __ bx(LR, PL); |
| 1233 __ Ret(); | |
| 1234 __ Bind(&fall_through); | 1232 __ Bind(&fall_through); |
| 1235 } | 1233 } |
| 1236 } | 1234 } |
| 1237 | 1235 |
| 1238 | 1236 |
| 1239 void Intrinsifier::Math_sqrt(Assembler* assembler) { | 1237 void Intrinsifier::Math_sqrt(Assembler* assembler) { |
| 1240 if (TargetCPUFeatures::vfp_supported()) { | 1238 if (TargetCPUFeatures::vfp_supported()) { |
| 1241 Label fall_through, is_smi, double_op; | 1239 Label fall_through, is_smi, double_op; |
| 1242 TestLastArgumentIsDouble(assembler, &is_smi, &fall_through); | 1240 TestLastArgumentIsDouble(assembler, &is_smi, &fall_through); |
| 1243 // Argument is double and is in R0. | 1241 // Argument is double and is in R0. |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1699 Isolate* isolate = Isolate::Current(); | 1697 Isolate* isolate = Isolate::Current(); |
| 1700 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); | 1698 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); |
| 1701 // Set return value to Isolate::current_tag_. | 1699 // Set return value to Isolate::current_tag_. |
| 1702 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); | 1700 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); |
| 1703 __ Ret(); | 1701 __ Ret(); |
| 1704 } | 1702 } |
| 1705 | 1703 |
| 1706 } // namespace dart | 1704 } // namespace dart |
| 1707 | 1705 |
| 1708 #endif // defined TARGET_ARCH_ARM | 1706 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |