OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/x64/lithium-codegen-x64.h" | 7 #include "src/x64/lithium-codegen-x64.h" |
8 #include "src/x64/lithium-gap-resolver-x64.h" | 8 #include "src/x64/lithium-gap-resolver-x64.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 __ movp(dst, kScratchRegister); | 207 __ movp(dst, kScratchRegister); |
208 } | 208 } |
209 } | 209 } |
210 | 210 |
211 } else if (source->IsDoubleRegister()) { | 211 } else if (source->IsDoubleRegister()) { |
212 XMMRegister src = cgen_->ToDoubleRegister(source); | 212 XMMRegister src = cgen_->ToDoubleRegister(source); |
213 if (destination->IsDoubleRegister()) { | 213 if (destination->IsDoubleRegister()) { |
214 __ movaps(cgen_->ToDoubleRegister(destination), src); | 214 __ movaps(cgen_->ToDoubleRegister(destination), src); |
215 } else { | 215 } else { |
216 DCHECK(destination->IsDoubleStackSlot()); | 216 DCHECK(destination->IsDoubleStackSlot()); |
217 __ movsd(cgen_->ToOperand(destination), src); | 217 __ Movsd(cgen_->ToOperand(destination), src); |
218 } | 218 } |
219 } else if (source->IsDoubleStackSlot()) { | 219 } else if (source->IsDoubleStackSlot()) { |
220 Operand src = cgen_->ToOperand(source); | 220 Operand src = cgen_->ToOperand(source); |
221 if (destination->IsDoubleRegister()) { | 221 if (destination->IsDoubleRegister()) { |
222 __ movsd(cgen_->ToDoubleRegister(destination), src); | 222 __ Movsd(cgen_->ToDoubleRegister(destination), src); |
223 } else { | 223 } else { |
224 DCHECK(destination->IsDoubleStackSlot()); | 224 DCHECK(destination->IsDoubleStackSlot()); |
225 __ movsd(xmm0, src); | 225 __ Movsd(xmm0, src); |
226 __ movsd(cgen_->ToOperand(destination), xmm0); | 226 __ Movsd(cgen_->ToOperand(destination), xmm0); |
227 } | 227 } |
228 } else { | 228 } else { |
229 UNREACHABLE(); | 229 UNREACHABLE(); |
230 } | 230 } |
231 | 231 |
232 moves_[index].Eliminate(); | 232 moves_[index].Eliminate(); |
233 } | 233 } |
234 | 234 |
235 | 235 |
236 void LGapResolver::EmitSwap(int index) { | 236 void LGapResolver::EmitSwap(int index) { |
(...skipping 17 matching lines...) Expand all Loading... |
254 cgen_->ToOperand(source->IsRegister() ? destination : source); | 254 cgen_->ToOperand(source->IsRegister() ? destination : source); |
255 __ movp(kScratchRegister, mem); | 255 __ movp(kScratchRegister, mem); |
256 __ movp(mem, reg); | 256 __ movp(mem, reg); |
257 __ movp(reg, kScratchRegister); | 257 __ movp(reg, kScratchRegister); |
258 | 258 |
259 } else if ((source->IsStackSlot() && destination->IsStackSlot()) || | 259 } else if ((source->IsStackSlot() && destination->IsStackSlot()) || |
260 (source->IsDoubleStackSlot() && destination->IsDoubleStackSlot())) { | 260 (source->IsDoubleStackSlot() && destination->IsDoubleStackSlot())) { |
261 // Swap two stack slots or two double stack slots. | 261 // Swap two stack slots or two double stack slots. |
262 Operand src = cgen_->ToOperand(source); | 262 Operand src = cgen_->ToOperand(source); |
263 Operand dst = cgen_->ToOperand(destination); | 263 Operand dst = cgen_->ToOperand(destination); |
264 __ movsd(xmm0, src); | 264 __ Movsd(xmm0, src); |
265 __ movp(kScratchRegister, dst); | 265 __ movp(kScratchRegister, dst); |
266 __ movsd(dst, xmm0); | 266 __ Movsd(dst, xmm0); |
267 __ movp(src, kScratchRegister); | 267 __ movp(src, kScratchRegister); |
268 | 268 |
269 } else if (source->IsDoubleRegister() && destination->IsDoubleRegister()) { | 269 } else if (source->IsDoubleRegister() && destination->IsDoubleRegister()) { |
270 // Swap two double registers. | 270 // Swap two double registers. |
271 XMMRegister source_reg = cgen_->ToDoubleRegister(source); | 271 XMMRegister source_reg = cgen_->ToDoubleRegister(source); |
272 XMMRegister destination_reg = cgen_->ToDoubleRegister(destination); | 272 XMMRegister destination_reg = cgen_->ToDoubleRegister(destination); |
273 __ movaps(xmm0, source_reg); | 273 __ movaps(xmm0, source_reg); |
274 __ movaps(source_reg, destination_reg); | 274 __ movaps(source_reg, destination_reg); |
275 __ movaps(destination_reg, xmm0); | 275 __ movaps(destination_reg, xmm0); |
276 | 276 |
277 } else if (source->IsDoubleRegister() || destination->IsDoubleRegister()) { | 277 } else if (source->IsDoubleRegister() || destination->IsDoubleRegister()) { |
278 // Swap a double register and a double stack slot. | 278 // Swap a double register and a double stack slot. |
279 DCHECK((source->IsDoubleRegister() && destination->IsDoubleStackSlot()) || | 279 DCHECK((source->IsDoubleRegister() && destination->IsDoubleStackSlot()) || |
280 (source->IsDoubleStackSlot() && destination->IsDoubleRegister())); | 280 (source->IsDoubleStackSlot() && destination->IsDoubleRegister())); |
281 XMMRegister reg = cgen_->ToDoubleRegister(source->IsDoubleRegister() | 281 XMMRegister reg = cgen_->ToDoubleRegister(source->IsDoubleRegister() |
282 ? source | 282 ? source |
283 : destination); | 283 : destination); |
284 LOperand* other = source->IsDoubleRegister() ? destination : source; | 284 LOperand* other = source->IsDoubleRegister() ? destination : source; |
285 DCHECK(other->IsDoubleStackSlot()); | 285 DCHECK(other->IsDoubleStackSlot()); |
286 Operand other_operand = cgen_->ToOperand(other); | 286 Operand other_operand = cgen_->ToOperand(other); |
287 __ movsd(xmm0, other_operand); | 287 __ Movsd(xmm0, other_operand); |
288 __ movsd(other_operand, reg); | 288 __ Movsd(other_operand, reg); |
289 __ movaps(reg, xmm0); | 289 __ movaps(reg, xmm0); |
290 | 290 |
291 } else { | 291 } else { |
292 // No other combinations are possible. | 292 // No other combinations are possible. |
293 UNREACHABLE(); | 293 UNREACHABLE(); |
294 } | 294 } |
295 | 295 |
296 // The swap of source and destination has executed a move from source to | 296 // The swap of source and destination has executed a move from source to |
297 // destination. | 297 // destination. |
298 moves_[index].Eliminate(); | 298 moves_[index].Eliminate(); |
(...skipping 10 matching lines...) Expand all Loading... |
309 } | 309 } |
310 } | 310 } |
311 } | 311 } |
312 | 312 |
313 #undef __ | 313 #undef __ |
314 | 314 |
315 } // namespace internal | 315 } // namespace internal |
316 } // namespace v8 | 316 } // namespace v8 |
317 | 317 |
318 #endif // V8_TARGET_ARCH_X64 | 318 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |