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

Side by Side Diff: test/cctest/test-macro-assembler-x87.cc

Issue 293743005: Introduce x87 port (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: rebase Created 6 years, 7 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
« no previous file with comments | « test/cctest/test-hashing.cc ('k') | test/cctest/test-regexp.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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 __ Store(ebx, Operand(esp, 0 * kPointerSize), Representation::UInteger16()); 116 __ Store(ebx, Operand(esp, 0 * kPointerSize), Representation::UInteger16());
117 __ mov(ebx, Operand(esp, 0 * kPointerSize)); 117 __ mov(ebx, Operand(esp, 0 * kPointerSize));
118 __ mov(edx, Immediate(65535)); 118 __ mov(edx, Immediate(65535));
119 __ cmp(ebx, edx); 119 __ cmp(ebx, edx);
120 __ j(not_equal, &exit); 120 __ j(not_equal, &exit);
121 __ Load(edx, Operand(esp, 0 * kPointerSize), Representation::UInteger16()); 121 __ Load(edx, Operand(esp, 0 * kPointerSize), Representation::UInteger16());
122 __ cmp(ebx, edx); 122 __ cmp(ebx, edx);
123 __ j(not_equal, &exit); 123 __ j(not_equal, &exit);
124 124
125 // Test 5. 125 // Test 5.
126 __ mov(eax, Immediate(5)); // Test XMM move immediate. 126 __ mov(eax, Immediate(5));
127 __ Move(xmm0, 0.0);
128 __ Move(xmm1, 0.0);
129 __ ucomisd(xmm0, xmm1);
130 __ j(not_equal, &exit);
131 __ Move(xmm2, 991.01);
132 __ ucomisd(xmm0, xmm2);
133 __ j(equal, &exit);
134 __ Move(xmm0, 991.01);
135 __ ucomisd(xmm0, xmm2);
136 __ j(not_equal, &exit);
137
138 // Test 6.
139 __ mov(eax, Immediate(6));
140 __ Move(edx, Immediate(0)); // Test Move() 127 __ Move(edx, Immediate(0)); // Test Move()
141 __ cmp(edx, Immediate(0)); 128 __ cmp(edx, Immediate(0));
142 __ j(not_equal, &exit); 129 __ j(not_equal, &exit);
143 __ Move(ecx, Immediate(-1)); 130 __ Move(ecx, Immediate(-1));
144 __ cmp(ecx, Immediate(-1)); 131 __ cmp(ecx, Immediate(-1));
145 __ j(not_equal, &exit); 132 __ j(not_equal, &exit);
146 __ Move(ebx, Immediate(0x77)); 133 __ Move(ebx, Immediate(0x77));
147 __ cmp(ebx, Immediate(0x77)); 134 __ cmp(ebx, Immediate(0x77));
148 __ j(not_equal, &exit); 135 __ j(not_equal, &exit);
149 136
150 __ xor_(eax, eax); // Success. 137 __ xor_(eax, eax); // Success.
151 __ bind(&exit); 138 __ bind(&exit);
152 __ add(esp, Immediate(1 * kPointerSize)); 139 __ add(esp, Immediate(1 * kPointerSize));
153 __ pop(edx); 140 __ pop(edx);
154 __ pop(ebx); 141 __ pop(ebx);
155 __ ret(0); 142 __ ret(0);
156 143
157 CodeDesc desc; 144 CodeDesc desc;
158 masm->GetCode(&desc); 145 masm->GetCode(&desc);
159 // Call the function from C++. 146 // Call the function from C++.
160 int result = FUNCTION_CAST<F0>(buffer)(); 147 int result = FUNCTION_CAST<F0>(buffer)();
161 CHECK_EQ(0, result); 148 CHECK_EQ(0, result);
162 } 149 }
163 150
164 #undef __ 151 #undef __
OLDNEW
« no previous file with comments | « test/cctest/test-hashing.cc ('k') | test/cctest/test-regexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698