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

Unified Diff: src/x64/macro-assembler-x64.cc

Issue 1406353003: [x64] Emit vcvttsd2si[q] 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | test/cctest/test-assembler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/macro-assembler-x64.cc
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc
index e17a16132244e92453f25aab2d808333544d9e68..7bcf2912b3dab697e2db9060564dd6f06da8a006 100644
--- a/src/x64/macro-assembler-x64.cc
+++ b/src/x64/macro-assembler-x64.cc
@@ -811,6 +811,46 @@ void MacroAssembler::Cvtlsi2sd(XMMRegister dst, const Operand& src) {
}
+void MacroAssembler::Cvttsd2si(Register dst, XMMRegister src) {
+ if (CpuFeatures::IsSupported(AVX)) {
+ CpuFeatureScope scope(this, AVX);
+ vcvttsd2si(dst, src);
+ } else {
+ cvttsd2si(dst, src);
+ }
+}
+
+
+void MacroAssembler::Cvttsd2si(Register dst, const Operand& src) {
+ if (CpuFeatures::IsSupported(AVX)) {
+ CpuFeatureScope scope(this, AVX);
+ vcvttsd2si(dst, src);
+ } else {
+ cvttsd2si(dst, src);
+ }
+}
+
+
+void MacroAssembler::Cvttsd2siq(Register dst, XMMRegister src) {
+ if (CpuFeatures::IsSupported(AVX)) {
+ CpuFeatureScope scope(this, AVX);
+ vcvttsd2siq(dst, src);
+ } else {
+ cvttsd2siq(dst, src);
+ }
+}
+
+
+void MacroAssembler::Cvttsd2siq(Register dst, const Operand& src) {
+ if (CpuFeatures::IsSupported(AVX)) {
+ CpuFeatureScope scope(this, AVX);
+ vcvttsd2siq(dst, src);
+ } else {
+ cvttsd2siq(dst, src);
+ }
+}
+
+
void MacroAssembler::Load(Register dst, const Operand& src, Representation r) {
DCHECK(!r.IsDouble());
if (r.IsInteger8()) {
@@ -3286,7 +3326,7 @@ void MacroAssembler::TruncateHeapNumberToI(Register result_reg,
Register input_reg) {
Label done;
Movsd(xmm0, FieldOperand(input_reg, HeapNumber::kValueOffset));
- cvttsd2siq(result_reg, xmm0);
+ Cvttsd2siq(result_reg, xmm0);
cmpq(result_reg, Immediate(1));
j(no_overflow, &done, Label::kNear);
@@ -3309,7 +3349,7 @@ void MacroAssembler::TruncateHeapNumberToI(Register result_reg,
void MacroAssembler::TruncateDoubleToI(Register result_reg,
XMMRegister input_reg) {
Label done;
- cvttsd2siq(result_reg, input_reg);
+ Cvttsd2siq(result_reg, input_reg);
cmpq(result_reg, Immediate(1));
j(no_overflow, &done, Label::kNear);
@@ -3329,7 +3369,7 @@ void MacroAssembler::DoubleToI(Register result_reg, XMMRegister input_reg,
MinusZeroMode minus_zero_mode,
Label* lost_precision, Label* is_nan,
Label* minus_zero, Label::Distance dst) {
- cvttsd2si(result_reg, input_reg);
+ Cvttsd2si(result_reg, input_reg);
Cvtlsi2sd(xmm0, result_reg);
ucomisd(xmm0, input_reg);
j(not_equal, lost_precision, dst);
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | test/cctest/test-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698