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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/a64/stub-cache-a64.cc ('k') | test/cctest/test-utils-a64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-assembler-a64.cc
diff --git a/test/cctest/test-assembler-a64.cc b/test/cctest/test-assembler-a64.cc
index 7e0ad3792d900aa8402f73aa92c6c64163a27b23..ac200bca15332e2a6bd1704cfa0cc1c9a9ae61a5 100644
--- a/test/cctest/test-assembler-a64.cc
+++ b/test/cctest/test-assembler-a64.cc
@@ -5614,51 +5614,58 @@ TEST(fcmp) {
// Some of these tests require a floating-point scratch register assigned to
// the macro assembler, but most do not.
- __ SetFPScratchRegister(NoFPReg);
-
- __ Fmov(s8, 0.0);
- __ Fmov(s9, 0.5);
- __ Mov(w18, 0x7f800001); // Single precision NaN.
- __ Fmov(s18, w18);
-
- __ Fcmp(s8, s8);
- __ Mrs(x0, NZCV);
- __ Fcmp(s8, s9);
- __ Mrs(x1, NZCV);
- __ Fcmp(s9, s8);
- __ Mrs(x2, NZCV);
- __ Fcmp(s8, s18);
- __ Mrs(x3, NZCV);
- __ Fcmp(s18, s18);
- __ Mrs(x4, NZCV);
- __ Fcmp(s8, 0.0);
- __ Mrs(x5, NZCV);
- __ SetFPScratchRegister(d0);
- __ Fcmp(s8, 255.0);
- __ SetFPScratchRegister(NoFPReg);
- __ Mrs(x6, NZCV);
+ {
+ // We're going to mess around with the available scratch registers in this
+ // test. A UseScratchRegisterScope will make sure that they are restored to
+ // the default values once we're finished.
+ UseScratchRegisterScope temps(&masm);
+ masm.FPTmpList()->set_list(0);
+
+ __ Fmov(s8, 0.0);
+ __ Fmov(s9, 0.5);
+ __ Mov(w18, 0x7f800001); // Single precision NaN.
+ __ Fmov(s18, w18);
+
+ __ Fcmp(s8, s8);
+ __ Mrs(x0, NZCV);
+ __ Fcmp(s8, s9);
+ __ Mrs(x1, NZCV);
+ __ Fcmp(s9, s8);
+ __ Mrs(x2, NZCV);
+ __ Fcmp(s8, s18);
+ __ Mrs(x3, NZCV);
+ __ Fcmp(s18, s18);
+ __ Mrs(x4, NZCV);
+ __ Fcmp(s8, 0.0);
+ __ Mrs(x5, NZCV);
+ masm.FPTmpList()->set_list(d0.Bit());
+ __ Fcmp(s8, 255.0);
+ masm.FPTmpList()->set_list(0);
+ __ Mrs(x6, NZCV);
+
+ __ Fmov(d19, 0.0);
+ __ Fmov(d20, 0.5);
+ __ Mov(x21, 0x7ff0000000000001UL); // Double precision NaN.
+ __ Fmov(d21, x21);
+
+ __ Fcmp(d19, d19);
+ __ Mrs(x10, NZCV);
+ __ Fcmp(d19, d20);
+ __ Mrs(x11, NZCV);
+ __ Fcmp(d20, d19);
+ __ Mrs(x12, NZCV);
+ __ Fcmp(d19, d21);
+ __ Mrs(x13, NZCV);
+ __ Fcmp(d21, d21);
+ __ Mrs(x14, NZCV);
+ __ Fcmp(d19, 0.0);
+ __ Mrs(x15, NZCV);
+ masm.FPTmpList()->set_list(d0.Bit());
+ __ Fcmp(d19, 12.3456);
+ masm.FPTmpList()->set_list(0);
+ __ Mrs(x16, NZCV);
+ }
- __ Fmov(d19, 0.0);
- __ Fmov(d20, 0.5);
- __ Mov(x21, 0x7ff0000000000001UL); // Double precision NaN.
- __ Fmov(d21, x21);
-
- __ Fcmp(d19, d19);
- __ Mrs(x10, NZCV);
- __ Fcmp(d19, d20);
- __ Mrs(x11, NZCV);
- __ Fcmp(d20, d19);
- __ Mrs(x12, NZCV);
- __ Fcmp(d19, d21);
- __ Mrs(x13, NZCV);
- __ Fcmp(d21, d21);
- __ Mrs(x14, NZCV);
- __ Fcmp(d19, 0.0);
- __ Mrs(x15, NZCV);
- __ SetFPScratchRegister(d0);
- __ Fcmp(d19, 12.3456);
- __ SetFPScratchRegister(NoFPReg);
- __ Mrs(x16, NZCV);
END();
RUN();
« 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