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

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

Issue 1877133004: [x64] Avoid sign extension in TruncateFloat64ToInt32(TruncationMode::kJavaScript) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Avoid to use the additional movl instruction. 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 2c4f02c9023adefcf6d26730015f0b58daf670a9..39a4e0505628427469939a3914b37627316b3812 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));
- Cvttsd2siq(result_reg, xmm0);
- cmpq(result_reg, Immediate(1));
+ Cvttsd2si(result_reg, xmm0);
+ cmpl(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;
- Cvttsd2siq(result_reg, input_reg);
- cmpq(result_reg, Immediate(1));
+ Cvttsd2si(result_reg, input_reg);
+ cmpl(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