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

Side by Side Diff: test/cctest/test-assembler-a64.cc

Issue 164793003: A64: Use a scope utility to allocate scratch registers. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase. Created 6 years, 9 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 | « src/a64/stub-cache-a64.cc ('k') | test/cctest/test-utils-a64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 5596 matching lines...) Expand 10 before | Expand all | Expand 10 after
5607 5607
5608 5608
5609 TEST(fcmp) { 5609 TEST(fcmp) {
5610 INIT_V8(); 5610 INIT_V8();
5611 SETUP(); 5611 SETUP();
5612 5612
5613 START(); 5613 START();
5614 5614
5615 // Some of these tests require a floating-point scratch register assigned to 5615 // Some of these tests require a floating-point scratch register assigned to
5616 // the macro assembler, but most do not. 5616 // the macro assembler, but most do not.
5617 __ SetFPScratchRegister(NoFPReg); 5617 {
5618 // We're going to mess around with the available scratch registers in this
5619 // test. A UseScratchRegisterScope will make sure that they are restored to
5620 // the default values once we're finished.
5621 UseScratchRegisterScope temps(&masm);
5622 masm.FPTmpList()->set_list(0);
5618 5623
5619 __ Fmov(s8, 0.0); 5624 __ Fmov(s8, 0.0);
5620 __ Fmov(s9, 0.5); 5625 __ Fmov(s9, 0.5);
5621 __ Mov(w18, 0x7f800001); // Single precision NaN. 5626 __ Mov(w18, 0x7f800001); // Single precision NaN.
5622 __ Fmov(s18, w18); 5627 __ Fmov(s18, w18);
5623 5628
5624 __ Fcmp(s8, s8); 5629 __ Fcmp(s8, s8);
5625 __ Mrs(x0, NZCV); 5630 __ Mrs(x0, NZCV);
5626 __ Fcmp(s8, s9); 5631 __ Fcmp(s8, s9);
5627 __ Mrs(x1, NZCV); 5632 __ Mrs(x1, NZCV);
5628 __ Fcmp(s9, s8); 5633 __ Fcmp(s9, s8);
5629 __ Mrs(x2, NZCV); 5634 __ Mrs(x2, NZCV);
5630 __ Fcmp(s8, s18); 5635 __ Fcmp(s8, s18);
5631 __ Mrs(x3, NZCV); 5636 __ Mrs(x3, NZCV);
5632 __ Fcmp(s18, s18); 5637 __ Fcmp(s18, s18);
5633 __ Mrs(x4, NZCV); 5638 __ Mrs(x4, NZCV);
5634 __ Fcmp(s8, 0.0); 5639 __ Fcmp(s8, 0.0);
5635 __ Mrs(x5, NZCV); 5640 __ Mrs(x5, NZCV);
5636 __ SetFPScratchRegister(d0); 5641 masm.FPTmpList()->set_list(d0.Bit());
5637 __ Fcmp(s8, 255.0); 5642 __ Fcmp(s8, 255.0);
5638 __ SetFPScratchRegister(NoFPReg); 5643 masm.FPTmpList()->set_list(0);
5639 __ Mrs(x6, NZCV); 5644 __ Mrs(x6, NZCV);
5640 5645
5641 __ Fmov(d19, 0.0); 5646 __ Fmov(d19, 0.0);
5642 __ Fmov(d20, 0.5); 5647 __ Fmov(d20, 0.5);
5643 __ Mov(x21, 0x7ff0000000000001UL); // Double precision NaN. 5648 __ Mov(x21, 0x7ff0000000000001UL); // Double precision NaN.
5644 __ Fmov(d21, x21); 5649 __ Fmov(d21, x21);
5645 5650
5646 __ Fcmp(d19, d19); 5651 __ Fcmp(d19, d19);
5647 __ Mrs(x10, NZCV); 5652 __ Mrs(x10, NZCV);
5648 __ Fcmp(d19, d20); 5653 __ Fcmp(d19, d20);
5649 __ Mrs(x11, NZCV); 5654 __ Mrs(x11, NZCV);
5650 __ Fcmp(d20, d19); 5655 __ Fcmp(d20, d19);
5651 __ Mrs(x12, NZCV); 5656 __ Mrs(x12, NZCV);
5652 __ Fcmp(d19, d21); 5657 __ Fcmp(d19, d21);
5653 __ Mrs(x13, NZCV); 5658 __ Mrs(x13, NZCV);
5654 __ Fcmp(d21, d21); 5659 __ Fcmp(d21, d21);
5655 __ Mrs(x14, NZCV); 5660 __ Mrs(x14, NZCV);
5656 __ Fcmp(d19, 0.0); 5661 __ Fcmp(d19, 0.0);
5657 __ Mrs(x15, NZCV); 5662 __ Mrs(x15, NZCV);
5658 __ SetFPScratchRegister(d0); 5663 masm.FPTmpList()->set_list(d0.Bit());
5659 __ Fcmp(d19, 12.3456); 5664 __ Fcmp(d19, 12.3456);
5660 __ SetFPScratchRegister(NoFPReg); 5665 masm.FPTmpList()->set_list(0);
5661 __ Mrs(x16, NZCV); 5666 __ Mrs(x16, NZCV);
5667 }
5668
5662 END(); 5669 END();
5663 5670
5664 RUN(); 5671 RUN();
5665 5672
5666 ASSERT_EQUAL_32(ZCFlag, w0); 5673 ASSERT_EQUAL_32(ZCFlag, w0);
5667 ASSERT_EQUAL_32(NFlag, w1); 5674 ASSERT_EQUAL_32(NFlag, w1);
5668 ASSERT_EQUAL_32(CFlag, w2); 5675 ASSERT_EQUAL_32(CFlag, w2);
5669 ASSERT_EQUAL_32(CVFlag, w3); 5676 ASSERT_EQUAL_32(CVFlag, w3);
5670 ASSERT_EQUAL_32(CVFlag, w4); 5677 ASSERT_EQUAL_32(CVFlag, w4);
5671 ASSERT_EQUAL_32(ZCFlag, w5); 5678 ASSERT_EQUAL_32(ZCFlag, w5);
(...skipping 4344 matching lines...) Expand 10 before | Expand all | Expand 10 after
10016 AbsHelperX(-42); 10023 AbsHelperX(-42);
10017 AbsHelperX(kXMinInt); 10024 AbsHelperX(kXMinInt);
10018 AbsHelperX(kXMaxInt); 10025 AbsHelperX(kXMaxInt);
10019 10026
10020 AbsHelperW(0); 10027 AbsHelperW(0);
10021 AbsHelperW(42); 10028 AbsHelperW(42);
10022 AbsHelperW(-42); 10029 AbsHelperW(-42);
10023 AbsHelperW(kWMinInt); 10030 AbsHelperW(kWMinInt);
10024 AbsHelperW(kWMaxInt); 10031 AbsHelperW(kWMaxInt);
10025 } 10032 }
OLDNEW
« no previous file with comments | « src/a64/stub-cache-a64.cc ('k') | test/cctest/test-utils-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698