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

Side by Side Diff: src/x64/lithium-gap-resolver-x64.cc

Issue 6883159: X64: Adding macro to load double from memory, and use SSE3 instruction if present. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | src/x64/macro-assembler-x64.h » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 XMMRegister src = cgen_->ToDoubleRegister(source); 215 XMMRegister src = cgen_->ToDoubleRegister(source);
216 if (destination->IsDoubleRegister()) { 216 if (destination->IsDoubleRegister()) {
217 __ movaps(cgen_->ToDoubleRegister(destination), src); 217 __ movaps(cgen_->ToDoubleRegister(destination), src);
218 } else { 218 } else {
219 ASSERT(destination->IsDoubleStackSlot()); 219 ASSERT(destination->IsDoubleStackSlot());
220 __ movsd(cgen_->ToOperand(destination), src); 220 __ movsd(cgen_->ToOperand(destination), src);
221 } 221 }
222 } else if (source->IsDoubleStackSlot()) { 222 } else if (source->IsDoubleStackSlot()) {
223 Operand src = cgen_->ToOperand(source); 223 Operand src = cgen_->ToOperand(source);
224 if (destination->IsDoubleRegister()) { 224 if (destination->IsDoubleRegister()) {
225 __ movsd(cgen_->ToDoubleRegister(destination), src); 225 __ LoadDbl(cgen_->ToDoubleRegister(destination), src);
226 } else { 226 } else {
227 ASSERT(destination->IsDoubleStackSlot()); 227 ASSERT(destination->IsDoubleStackSlot());
228 __ movsd(xmm0, src); 228 __ LoadDbl(xmm0, src);
229 __ movsd(cgen_->ToOperand(destination), xmm0); 229 __ movsd(cgen_->ToOperand(destination), xmm0);
230 } 230 }
231 } else { 231 } else {
232 UNREACHABLE(); 232 UNREACHABLE();
233 } 233 }
234 234
235 moves_[index].Eliminate(); 235 moves_[index].Eliminate();
236 } 236 }
237 237
238 238
(...skipping 18 matching lines...) Expand all
257 cgen_->ToOperand(source->IsRegister() ? destination : source); 257 cgen_->ToOperand(source->IsRegister() ? destination : source);
258 __ movq(kScratchRegister, mem); 258 __ movq(kScratchRegister, mem);
259 __ movq(mem, reg); 259 __ movq(mem, reg);
260 __ movq(reg, kScratchRegister); 260 __ movq(reg, kScratchRegister);
261 261
262 } else if ((source->IsStackSlot() && destination->IsStackSlot()) || 262 } else if ((source->IsStackSlot() && destination->IsStackSlot()) ||
263 (source->IsDoubleStackSlot() && destination->IsDoubleStackSlot())) { 263 (source->IsDoubleStackSlot() && destination->IsDoubleStackSlot())) {
264 // Swap two stack slots or two double stack slots. 264 // Swap two stack slots or two double stack slots.
265 Operand src = cgen_->ToOperand(source); 265 Operand src = cgen_->ToOperand(source);
266 Operand dst = cgen_->ToOperand(destination); 266 Operand dst = cgen_->ToOperand(destination);
267 __ movsd(xmm0, src); 267 __ LoadDbl(xmm0, src);
268 __ movq(kScratchRegister, dst); 268 __ movq(kScratchRegister, dst);
269 __ movsd(dst, xmm0); 269 __ movsd(dst, xmm0);
270 __ movq(src, kScratchRegister); 270 __ movq(src, kScratchRegister);
271 271
272 } else if (source->IsDoubleRegister() && destination->IsDoubleRegister()) { 272 } else if (source->IsDoubleRegister() && destination->IsDoubleRegister()) {
273 // Swap two double registers. 273 // Swap two double registers.
274 XMMRegister source_reg = cgen_->ToDoubleRegister(source); 274 XMMRegister source_reg = cgen_->ToDoubleRegister(source);
275 XMMRegister destination_reg = cgen_->ToDoubleRegister(destination); 275 XMMRegister destination_reg = cgen_->ToDoubleRegister(destination);
276 __ movaps(xmm0, source_reg); 276 __ movaps(xmm0, source_reg);
277 __ movaps(source_reg, destination_reg); 277 __ movaps(source_reg, destination_reg);
278 __ movaps(destination_reg, xmm0); 278 __ movaps(destination_reg, xmm0);
279 279
280 } else if (source->IsDoubleRegister() || destination->IsDoubleRegister()) { 280 } else if (source->IsDoubleRegister() || destination->IsDoubleRegister()) {
281 // Swap a double register and a double stack slot. 281 // Swap a double register and a double stack slot.
282 ASSERT((source->IsDoubleRegister() && destination->IsDoubleStackSlot()) || 282 ASSERT((source->IsDoubleRegister() && destination->IsDoubleStackSlot()) ||
283 (source->IsDoubleStackSlot() && destination->IsDoubleRegister())); 283 (source->IsDoubleStackSlot() && destination->IsDoubleRegister()));
284 XMMRegister reg = cgen_->ToDoubleRegister(source->IsDoubleRegister() 284 XMMRegister reg = cgen_->ToDoubleRegister(source->IsDoubleRegister()
285 ? source 285 ? source
286 : destination); 286 : destination);
287 LOperand* other = source->IsDoubleRegister() ? destination : source; 287 LOperand* other = source->IsDoubleRegister() ? destination : source;
288 ASSERT(other->IsDoubleStackSlot()); 288 ASSERT(other->IsDoubleStackSlot());
289 Operand other_operand = cgen_->ToOperand(other); 289 Operand other_operand = cgen_->ToOperand(other);
290 __ movsd(xmm0, other_operand); 290 __ LoadDbl(xmm0, other_operand);
291 __ movsd(other_operand, reg); 291 __ movsd(other_operand, reg);
292 __ movsd(reg, xmm0); 292 __ movsd(reg, xmm0);
293 293
294 } else { 294 } else {
295 // No other combinations are possible. 295 // No other combinations are possible.
296 UNREACHABLE(); 296 UNREACHABLE();
297 } 297 }
298 298
299 // The swap of source and destination has executed a move from source to 299 // The swap of source and destination has executed a move from source to
300 // destination. 300 // destination.
(...skipping 10 matching lines...) Expand all
311 moves_[i].set_source(source); 311 moves_[i].set_source(source);
312 } 312 }
313 } 313 }
314 } 314 }
315 315
316 #undef __ 316 #undef __
317 317
318 } } // namespace v8::internal 318 } } // namespace v8::internal
319 319
320 #endif // V8_TARGET_ARCH_X64 320 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698