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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 2058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2069 __ mulsd(left, right); | 2069 __ mulsd(left, right); |
2070 } | 2070 } |
2071 break; | 2071 break; |
2072 case Token::DIV: | 2072 case Token::DIV: |
2073 if (CpuFeatures::IsSupported(AVX)) { | 2073 if (CpuFeatures::IsSupported(AVX)) { |
2074 CpuFeatureScope scope(masm(), AVX); | 2074 CpuFeatureScope scope(masm(), AVX); |
2075 __ vdivsd(result, left, right); | 2075 __ vdivsd(result, left, right); |
2076 } else { | 2076 } else { |
2077 DCHECK(result.is(left)); | 2077 DCHECK(result.is(left)); |
2078 __ divsd(left, right); | 2078 __ divsd(left, right); |
2079 // Don't delete this mov. It may improve performance on some CPUs, | |
2080 // when there is a mulsd depending on the result | |
2081 __ movaps(left, left); | |
2082 } | 2079 } |
| 2080 // Don't delete this mov. It may improve performance on some CPUs, |
| 2081 // when there is a (v)mulsd depending on the result |
| 2082 __ movaps(result, result); |
2083 break; | 2083 break; |
2084 case Token::MOD: { | 2084 case Token::MOD: { |
2085 XMMRegister xmm_scratch = double_scratch0(); | 2085 XMMRegister xmm_scratch = double_scratch0(); |
2086 __ PrepareCallCFunction(2); | 2086 __ PrepareCallCFunction(2); |
2087 __ movaps(xmm_scratch, left); | 2087 __ movaps(xmm_scratch, left); |
2088 DCHECK(right.is(xmm1)); | 2088 DCHECK(right.is(xmm1)); |
2089 __ CallCFunction( | 2089 __ CallCFunction( |
2090 ExternalReference::mod_two_doubles_operation(isolate()), 2); | 2090 ExternalReference::mod_two_doubles_operation(isolate()), 2); |
2091 __ movaps(result, xmm_scratch); | 2091 __ movaps(result, xmm_scratch); |
2092 break; | 2092 break; |
(...skipping 3833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5926 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5926 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5927 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5927 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5928 } | 5928 } |
5929 | 5929 |
5930 | 5930 |
5931 #undef __ | 5931 #undef __ |
5932 | 5932 |
5933 } } // namespace v8::internal | 5933 } } // namespace v8::internal |
5934 | 5934 |
5935 #endif // V8_TARGET_ARCH_X64 | 5935 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |