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

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

Issue 1438013003: [turbofan] Implemented the RoundUint64ToFloat32 TurboFan operator for x64, arm64, (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Reformated the test Created 5 years, 1 month 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/compiler/test-run-machops.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 1a936afc98c514be89427b82104925b7174dd794..8223aa9635357d8019102850d111651208c75ff4 100644
--- a/src/x64/macro-assembler-x64.cc
+++ b/src/x64/macro-assembler-x64.cc
@@ -899,6 +899,25 @@ void MacroAssembler::Cvtqsi2sd(XMMRegister dst, const Operand& src) {
}
+void MacroAssembler::Cvtqui2ss(XMMRegister dst, Register src, Register tmp) {
+ Label msb_set_src;
+ Label jmp_return;
+ testq(src, src);
+ j(sign, &msb_set_src, Label::kNear);
+ Cvtqsi2ss(dst, src);
+ jmp(&jmp_return, Label::kNear);
+ bind(&msb_set_src);
+ movq(tmp, src);
+ shrq(src, Immediate(1));
+ // Recover the least significant bit to avoid rounding errors.
+ andq(tmp, Immediate(1));
+ orq(src, tmp);
+ Cvtqsi2ss(dst, src);
+ addss(dst, dst);
+ bind(&jmp_return);
+}
+
+
void MacroAssembler::Cvtqui2sd(XMMRegister dst, Register src, Register tmp) {
Label msb_set_src;
Label jmp_return;
@@ -909,7 +928,6 @@ void MacroAssembler::Cvtqui2sd(XMMRegister dst, Register src, Register tmp) {
bind(&msb_set_src);
movq(tmp, src);
shrq(src, Immediate(1));
- // Recover the least significant bit to avoid rounding errors.
andq(tmp, Immediate(1));
orq(src, tmp);
Cvtqsi2sd(dst, src);
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | test/cctest/compiler/test-run-machops.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698