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

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 1411743003: [x64] Emit vcvtss2sd & vcvtsd2ss when AVX is enabled. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « src/x64/disasm-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 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 #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/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/hydrogen-osr.h" 10 #include "src/hydrogen-osr.h"
(...skipping 2981 matching lines...) Expand 10 before | Expand all | Expand 10 after
2992 } 2992 }
2993 Operand operand(BuildFastArrayOperand( 2993 Operand operand(BuildFastArrayOperand(
2994 instr->elements(), 2994 instr->elements(),
2995 key, 2995 key,
2996 instr->hydrogen()->key()->representation(), 2996 instr->hydrogen()->key()->representation(),
2997 elements_kind, 2997 elements_kind,
2998 instr->base_offset())); 2998 instr->base_offset()));
2999 2999
3000 if (elements_kind == FLOAT32_ELEMENTS) { 3000 if (elements_kind == FLOAT32_ELEMENTS) {
3001 XMMRegister result(ToDoubleRegister(instr->result())); 3001 XMMRegister result(ToDoubleRegister(instr->result()));
3002 __ movss(result, operand); 3002 __ Cvtss2sd(result, operand);
3003 __ cvtss2sd(result, result);
3004 } else if (elements_kind == FLOAT64_ELEMENTS) { 3003 } else if (elements_kind == FLOAT64_ELEMENTS) {
3005 __ Movsd(ToDoubleRegister(instr->result()), operand); 3004 __ Movsd(ToDoubleRegister(instr->result()), operand);
3006 } else { 3005 } else {
3007 Register result(ToRegister(instr->result())); 3006 Register result(ToRegister(instr->result()));
3008 switch (elements_kind) { 3007 switch (elements_kind) {
3009 case INT8_ELEMENTS: 3008 case INT8_ELEMENTS:
3010 __ movsxbl(result, operand); 3009 __ movsxbl(result, operand);
3011 break; 3010 break;
3012 case UINT8_ELEMENTS: 3011 case UINT8_ELEMENTS:
3013 case UINT8_CLAMPED_ELEMENTS: 3012 case UINT8_CLAMPED_ELEMENTS:
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
3708 DeoptimizeIf(negative, instr, Deoptimizer::kMinusZero); 3707 DeoptimizeIf(negative, instr, Deoptimizer::kMinusZero);
3709 } 3708 }
3710 __ Set(output_reg, 0); 3709 __ Set(output_reg, 0);
3711 __ bind(&done); 3710 __ bind(&done);
3712 } 3711 }
3713 3712
3714 3713
3715 void LCodeGen::DoMathFround(LMathFround* instr) { 3714 void LCodeGen::DoMathFround(LMathFround* instr) {
3716 XMMRegister input_reg = ToDoubleRegister(instr->value()); 3715 XMMRegister input_reg = ToDoubleRegister(instr->value());
3717 XMMRegister output_reg = ToDoubleRegister(instr->result()); 3716 XMMRegister output_reg = ToDoubleRegister(instr->result());
3718 __ cvtsd2ss(output_reg, input_reg); 3717 __ Cvtsd2ss(output_reg, input_reg);
3719 __ cvtss2sd(output_reg, output_reg); 3718 __ Cvtss2sd(output_reg, output_reg);
3720 } 3719 }
3721 3720
3722 3721
3723 void LCodeGen::DoMathSqrt(LMathSqrt* instr) { 3722 void LCodeGen::DoMathSqrt(LMathSqrt* instr) {
3724 XMMRegister output = ToDoubleRegister(instr->result()); 3723 XMMRegister output = ToDoubleRegister(instr->result());
3725 if (instr->value()->IsDoubleRegister()) { 3724 if (instr->value()->IsDoubleRegister()) {
3726 XMMRegister input = ToDoubleRegister(instr->value()); 3725 XMMRegister input = ToDoubleRegister(instr->value());
3727 __ sqrtsd(output, input); 3726 __ sqrtsd(output, input);
3728 } else { 3727 } else {
3729 Operand input = ToOperand(instr->value()); 3728 Operand input = ToOperand(instr->value());
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
4236 } 4235 }
4237 Operand operand(BuildFastArrayOperand( 4236 Operand operand(BuildFastArrayOperand(
4238 instr->elements(), 4237 instr->elements(),
4239 key, 4238 key,
4240 instr->hydrogen()->key()->representation(), 4239 instr->hydrogen()->key()->representation(),
4241 elements_kind, 4240 elements_kind,
4242 instr->base_offset())); 4241 instr->base_offset()));
4243 4242
4244 if (elements_kind == FLOAT32_ELEMENTS) { 4243 if (elements_kind == FLOAT32_ELEMENTS) {
4245 XMMRegister value(ToDoubleRegister(instr->value())); 4244 XMMRegister value(ToDoubleRegister(instr->value()));
4246 __ cvtsd2ss(value, value); 4245 __ Cvtsd2ss(value, value);
4247 __ movss(operand, value); 4246 __ movss(operand, value);
4248 } else if (elements_kind == FLOAT64_ELEMENTS) { 4247 } else if (elements_kind == FLOAT64_ELEMENTS) {
4249 __ Movsd(operand, ToDoubleRegister(instr->value())); 4248 __ Movsd(operand, ToDoubleRegister(instr->value()));
4250 } else { 4249 } else {
4251 Register value(ToRegister(instr->value())); 4250 Register value(ToRegister(instr->value()));
4252 switch (elements_kind) { 4251 switch (elements_kind) {
4253 case INT8_ELEMENTS: 4252 case INT8_ELEMENTS:
4254 case UINT8_ELEMENTS: 4253 case UINT8_ELEMENTS:
4255 case UINT8_CLAMPED_ELEMENTS: 4254 case UINT8_CLAMPED_ELEMENTS:
4256 __ movb(operand, value); 4255 __ movb(operand, value);
(...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after
5905 RecordSafepoint(Safepoint::kNoLazyDeopt); 5904 RecordSafepoint(Safepoint::kNoLazyDeopt);
5906 } 5905 }
5907 5906
5908 5907
5909 #undef __ 5908 #undef __
5910 5909
5911 } // namespace internal 5910 } // namespace internal
5912 } // namespace v8 5911 } // namespace v8
5913 5912
5914 #endif // V8_TARGET_ARCH_X64 5913 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/disasm-x64.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698