Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
| 6 | 6 |
| 7 #include "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
| 8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
| 9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
| 10 #include "src/compiler/node-properties-inl.h" | 10 #include "src/compiler/node-properties-inl.h" |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 295 __ fstp_d(Operand(esp, 0)); | 295 __ fstp_d(Operand(esp, 0)); |
| 296 __ movsd(i.OutputDoubleRegister(), Operand(esp, 0)); | 296 __ movsd(i.OutputDoubleRegister(), Operand(esp, 0)); |
| 297 __ add(esp, Immediate(kDoubleSize)); | 297 __ add(esp, Immediate(kDoubleSize)); |
| 298 break; | 298 break; |
| 299 } | 299 } |
| 300 case kSSEFloat64ToInt32: | 300 case kSSEFloat64ToInt32: |
| 301 __ cvttsd2si(i.OutputRegister(), i.InputOperand(0)); | 301 __ cvttsd2si(i.OutputRegister(), i.InputOperand(0)); |
| 302 break; | 302 break; |
| 303 case kSSEFloat64ToUint32: { | 303 case kSSEFloat64ToUint32: { |
| 304 XMMRegister scratch = xmm0; | 304 XMMRegister scratch = xmm0; |
| 305 Label done; | |
| 305 __ Move(scratch, -2147483648.0); | 306 __ Move(scratch, -2147483648.0); |
| 306 // TODO(turbofan): IA32 SSE subsd() should take an operand. | 307 __ addsd(scratch, i.InputOperand(0)); |
| 307 __ addsd(scratch, i.InputDoubleRegister(0)); | |
| 308 __ cvttsd2si(i.OutputRegister(), scratch); | 308 __ cvttsd2si(i.OutputRegister(), scratch); |
| 309 __ add(i.OutputRegister(), Immediate(0x80000000)); | 309 __ add(i.OutputRegister(), Immediate(0x80000000)); |
| 310 __ j(not_carry, &done, Label::kNear); | |
|
titzer
2014/09/18 14:03:06
What does this extra condition here check?
Note t
Weiliang
2014/09/18 14:11:01
cvttsd2si truncates the result by rounding toward
| |
| 311 __ cvtsi2sd(scratch, i.OutputRegister()); | |
| 312 __ ucomisd(scratch, i.InputOperand(0)); | |
| 313 __ j(equal, &done, Label::kNear); | |
| 314 __ sub(i.OutputRegister(), Immediate(1)); | |
| 315 __ bind(&done); | |
| 310 break; | 316 break; |
| 311 } | 317 } |
| 312 case kSSEInt32ToFloat64: | 318 case kSSEInt32ToFloat64: |
| 313 __ cvtsi2sd(i.OutputDoubleRegister(), i.InputOperand(0)); | 319 __ cvtsi2sd(i.OutputDoubleRegister(), i.InputOperand(0)); |
| 314 break; | 320 break; |
| 315 case kSSEUint32ToFloat64: | 321 case kSSEUint32ToFloat64: |
| 316 // TODO(turbofan): IA32 SSE LoadUint32() should take an operand. | 322 // TODO(turbofan): IA32 SSE LoadUint32() should take an operand. |
| 317 __ LoadUint32(i.OutputDoubleRegister(), i.InputRegister(0)); | 323 __ LoadUint32(i.OutputDoubleRegister(), i.InputRegister(0)); |
| 318 break; | 324 break; |
| 319 case kIA32Movsxbl: | 325 case kIA32Movsxbl: |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 945 } | 951 } |
| 946 | 952 |
| 947 | 953 |
| 948 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } | 954 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } |
| 949 | 955 |
| 950 #undef __ | 956 #undef __ |
| 951 | 957 |
| 952 } // namespace compiler | 958 } // namespace compiler |
| 953 } // namespace internal | 959 } // namespace internal |
| 954 } // namespace v8 | 960 } // namespace v8 |
| OLD | NEW |