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

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

Issue 1890813002: [x64] Use Cvttsd2siq in TruncateDoubleToI for better performance. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/compiler/x64/code-generator-x64.cc ('k') | no next file » | 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 718a0f6efb20e2aadb71d73801f4421dacad0c5a..1fdf22d3f2030c10c10e91d743b534e9b8b31232 100644
--- a/src/x64/macro-assembler-x64.cc
+++ b/src/x64/macro-assembler-x64.cc
@@ -3744,8 +3744,8 @@ void MacroAssembler::TruncateHeapNumberToI(Register result_reg,
Register input_reg) {
Label done;
Movsd(xmm0, FieldOperand(input_reg, HeapNumber::kValueOffset));
- Cvttsd2si(result_reg, xmm0);
- cmpl(result_reg, Immediate(1));
+ Cvttsd2siq(result_reg, xmm0);
+ cmpq(result_reg, Immediate(1));
j(no_overflow, &done, Label::kNear);
// Slow case.
@@ -3767,8 +3767,8 @@ void MacroAssembler::TruncateHeapNumberToI(Register result_reg,
void MacroAssembler::TruncateDoubleToI(Register result_reg,
XMMRegister input_reg) {
Label done;
- Cvttsd2si(result_reg, input_reg);
- cmpl(result_reg, Immediate(1));
+ Cvttsd2siq(result_reg, input_reg);
+ cmpq(result_reg, Immediate(1));
j(no_overflow, &done, Label::kNear);
subp(rsp, Immediate(kDoubleSize));
« no previous file with comments | « src/compiler/x64/code-generator-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698