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

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

Issue 15822008: Implements intrinsics for ARM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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
« no previous file with comments | « runtime/vm/intrinsifier_ia32.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <math.h> // for isnan. 5 #include <math.h> // for isnan.
6 #include <setjmp.h> 6 #include <setjmp.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #if defined(TARGET_ARCH_ARM) 10 #if defined(TARGET_ARCH_ARM)
(...skipping 1666 matching lines...) Expand 10 before | Expand all | Expand 10 after
1677 if (lo_res != 0) { 1677 if (lo_res != 0) {
1678 // Collapse bits 0..31 into bit 32 so that 32-bit Z check works. 1678 // Collapse bits 0..31 into bit 32 so that 32-bit Z check works.
1679 hi_res |= 1; 1679 hi_res |= 1;
1680 } 1680 }
1681 ASSERT((result == 0) == (hi_res == 0)); // Z bit 1681 ASSERT((result == 0) == (hi_res == 0)); // Z bit
1682 ASSERT(((result & (1LL << 63)) != 0) == (hi_res < 0)); // N bit 1682 ASSERT(((result & (1LL << 63)) != 0) == (hi_res < 0)); // N bit
1683 SetNZFlags(hi_res); 1683 SetNZFlags(hi_res);
1684 } 1684 }
1685 break; 1685 break;
1686 } 1686 }
1687 case 7: {
1688 // Registers rd_lo, rd_hi, rn, rm are encoded as rd, rn, rm, rs.
1689 // Format(instr, "smlal'cond's 'rd, 'rn, 'rm, 'rs");
1690 int32_t rd_lo_val = get_register(rd);
1691 int32_t rd_hi_val = get_register(rn);
1692 int64_t left_op = static_cast<int32_t>(rm_val);
1693 int64_t right_op = static_cast<int32_t>(rs_val);
1694 uint32_t accum_lo = static_cast<uint32_t>(rd_lo_val);
1695 int32_t accum_hi = static_cast<int32_t>(rd_hi_val);
1696 int64_t accum = Utils::LowHighTo64Bits(accum_lo, accum_hi);
1697 int64_t result = accum + left_op * right_op;
1698 int32_t hi_res = Utils::High32Bits(result);
1699 int32_t lo_res = Utils::Low32Bits(result);
1700 set_register(rd, lo_res);
1701 set_register(rn, hi_res);
1702 if (instr->HasS()) {
1703 if (lo_res != 0) {
1704 // Collapse bits 0..31 into bit 32 so that 32-bit Z check works.
1705 hi_res |= 1;
1706 }
1707 ASSERT((result == 0) == (hi_res == 0)); // Z bit
1708 ASSERT(((result & (1LL << 63)) != 0) == (hi_res < 0)); // N bit
1709 SetNZFlags(hi_res);
1710 }
1711 break;
1712 }
1687 default: { 1713 default: {
1688 UnimplementedInstruction(instr); 1714 UnimplementedInstruction(instr);
1689 break; 1715 break;
1690 } 1716 }
1691 } 1717 }
1692 } else { 1718 } else {
1693 // synchronization primitives 1719 // synchronization primitives
1694 Register rd = instr->RdField(); 1720 Register rd = instr->RdField();
1695 Register rn = instr->RnField(); 1721 Register rn = instr->RnField();
1696 uword addr = get_register(rn); 1722 uword addr = get_register(rn);
(...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after
3030 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); 3056 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace));
3031 } 3057 }
3032 buf->Longjmp(); 3058 buf->Longjmp();
3033 } 3059 }
3034 3060
3035 } // namespace dart 3061 } // namespace dart
3036 3062
3037 #endif // !defined(HOST_ARCH_ARM) 3063 #endif // !defined(HOST_ARCH_ARM)
3038 3064
3039 #endif // defined TARGET_ARCH_ARM 3065 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698