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

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

Issue 1628133002: [turbofan] Add RoundUint32ToFloat32 operator to Turbofan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add arm/arm64 implementation Created 4 years, 11 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/ia32/macro-assembler-ia32.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/ia32/macro-assembler-ia32.cc
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc
index a68cc130092fc68362301f75c87cc72fb9ff04eb..030e2c9b2f9f06910eb37cc7573d97c436cba08f 100644
--- a/src/ia32/macro-assembler-ia32.cc
+++ b/src/ia32/macro-assembler-ia32.cc
@@ -587,6 +587,25 @@ void MacroAssembler::Cvtsi2sd(XMMRegister dst, const Operand& src) {
}
+void MacroAssembler::Cvtui2ss(XMMRegister dst, Register src, Register tmp) {
+ Label msb_set_src;
+ Label jmp_return;
+ test(src, src);
+ j(sign, &msb_set_src, Label::kNear);
+ cvtsi2ss(dst, src);
+ jmp(&jmp_return, Label::kNear);
+ bind(&msb_set_src);
+ mov(tmp, src);
+ shr(src, 1);
+ // Recover the least significant bit to avoid rounding errors.
+ and_(tmp, Immediate(1));
+ or_(src, tmp);
+ cvtsi2ss(dst, src);
+ addss(dst, dst);
+ bind(&jmp_return);
+}
+
+
bool MacroAssembler::IsUnsafeImmediate(const Immediate& x) {
static const int kMaxImmediateBits = 17;
if (!RelocInfo::IsNone(x.rmode_)) return false;
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | test/cctest/compiler/test-run-machops.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698