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

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

Issue 620553002: Provide ia32 intrinsics for bigint add, sub, quotient digit estimation, and (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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
« no previous file with comments | « runtime/vm/assembler_ia32.cc ('k') | runtime/vm/disassembler_ia32.cc » ('j') | 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) 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" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/os.h" 10 #include "vm/os.h"
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 __ ret(); 710 __ ret();
711 } 711 }
712 712
713 713
714 ASSEMBLER_TEST_RUN(SignedDivide, test) { 714 ASSEMBLER_TEST_RUN(SignedDivide, test) {
715 typedef int (*SignedDivide)(); 715 typedef int (*SignedDivide)();
716 EXPECT_EQ(-87 / 42, reinterpret_cast<SignedDivide>(test->entry())()); 716 EXPECT_EQ(-87 / 42, reinterpret_cast<SignedDivide>(test->entry())());
717 } 717 }
718 718
719 719
720 ASSEMBLER_TEST_GENERATE(UnsignedDivide, assembler) {
721 __ movl(EAX, Immediate(0xffffffbe));
722 __ movl(EDX, Immediate(0x41));
723 __ movl(ECX, Immediate(-1));
724 __ divl(ECX);
725 __ ret();
726 }
727
728
729 ASSEMBLER_TEST_RUN(UnsignedDivide, test) {
730 typedef int (*UnsignedDivide)();
731 EXPECT_EQ(0x42, reinterpret_cast<UnsignedDivide>(test->entry())());
732 }
733
734
720 ASSEMBLER_TEST_GENERATE(Exchange, assembler) { 735 ASSEMBLER_TEST_GENERATE(Exchange, assembler) {
721 __ movl(EAX, Immediate(123456789)); 736 __ movl(EAX, Immediate(123456789));
722 __ movl(EDX, Immediate(987654321)); 737 __ movl(EDX, Immediate(987654321));
723 __ xchgl(EAX, EDX); 738 __ xchgl(EAX, EDX);
724 __ subl(EAX, EDX); 739 __ subl(EAX, EDX);
725 __ ret(); 740 __ ret();
726 } 741 }
727 742
728 743
729 ASSEMBLER_TEST_RUN(Exchange, test) { 744 ASSEMBLER_TEST_RUN(Exchange, test) {
(...skipping 2650 matching lines...) Expand 10 before | Expand all | Expand 10 after
3380 3395
3381 ASSEMBLER_TEST_RUN(BitTest, test) { 3396 ASSEMBLER_TEST_RUN(BitTest, test) {
3382 typedef int (*BitTest)(); 3397 typedef int (*BitTest)();
3383 EXPECT_EQ(1, reinterpret_cast<BitTest>(test->entry())()); 3398 EXPECT_EQ(1, reinterpret_cast<BitTest>(test->entry())());
3384 } 3399 }
3385 3400
3386 3401
3387 } // namespace dart 3402 } // namespace dart
3388 3403
3389 #endif // defined TARGET_ARCH_IA32 3404 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/assembler_ia32.cc ('k') | runtime/vm/disassembler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698