OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 CpuFeatureScope scope(this, AVX); | 892 CpuFeatureScope scope(this, AVX); |
893 vxorpd(dst, dst, dst); | 893 vxorpd(dst, dst, dst); |
894 vcvtqsi2sd(dst, dst, src); | 894 vcvtqsi2sd(dst, dst, src); |
895 } else { | 895 } else { |
896 xorpd(dst, dst); | 896 xorpd(dst, dst); |
897 cvtqsi2sd(dst, src); | 897 cvtqsi2sd(dst, src); |
898 } | 898 } |
899 } | 899 } |
900 | 900 |
901 | 901 |
| 902 void MacroAssembler::Cvtqui2sd(XMMRegister dst, Register src) { |
| 903 Label msb_set_src; |
| 904 Label jmp_return; |
| 905 testq(src, src); |
| 906 j(sign, &msb_set_src, Label::kNear); |
| 907 Cvtqsi2sd(dst, src); |
| 908 jmp(&jmp_return, Label::kNear); |
| 909 bind(&msb_set_src); |
| 910 shrq(src, Immediate(1)); |
| 911 Cvtqsi2sd(dst, src); |
| 912 addsd(dst, dst); |
| 913 bind(&jmp_return); |
| 914 } |
| 915 |
| 916 |
902 void MacroAssembler::Cvtsd2si(Register dst, XMMRegister src) { | 917 void MacroAssembler::Cvtsd2si(Register dst, XMMRegister src) { |
903 if (CpuFeatures::IsSupported(AVX)) { | 918 if (CpuFeatures::IsSupported(AVX)) { |
904 CpuFeatureScope scope(this, AVX); | 919 CpuFeatureScope scope(this, AVX); |
905 vcvtsd2si(dst, src); | 920 vcvtsd2si(dst, src); |
906 } else { | 921 } else { |
907 cvtsd2si(dst, src); | 922 cvtsd2si(dst, src); |
908 } | 923 } |
909 } | 924 } |
910 | 925 |
911 | 926 |
(...skipping 4564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5476 movl(rax, dividend); | 5491 movl(rax, dividend); |
5477 shrl(rax, Immediate(31)); | 5492 shrl(rax, Immediate(31)); |
5478 addl(rdx, rax); | 5493 addl(rdx, rax); |
5479 } | 5494 } |
5480 | 5495 |
5481 | 5496 |
5482 } // namespace internal | 5497 } // namespace internal |
5483 } // namespace v8 | 5498 } // namespace v8 |
5484 | 5499 |
5485 #endif // V8_TARGET_ARCH_X64 | 5500 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |