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

Unified Diff: runtime/vm/assembler_mips.h

Issue 1765623002: Use TRUNC.W instead of CVT.W on mips to convert from double to int as to not (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address comments Created 4 years, 10 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 | « no previous file | runtime/vm/assembler_mips_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_mips.h
diff --git a/runtime/vm/assembler_mips.h b/runtime/vm/assembler_mips.h
index 1654ac9a0480998f205bcc613eeee58308e7ef48..0ca794527a56dd62aaa10c1b9d6333eba78a3f7b 100644
--- a/runtime/vm/assembler_mips.h
+++ b/runtime/vm/assembler_mips.h
@@ -585,6 +585,12 @@ class Assembler : public ValueObject {
EmitRType(SPECIAL2, rs, rd, rd, 0, CLZ);
}
+ // Convert a double in ds to a 32-bit signed int in fd rounding towards 0.
+ void truncwd(FRegister fd, DRegister ds) {
+ FRegister fs = static_cast<FRegister>(ds * 2);
+ EmitFpuRType(COP1, FMT_D, F0, fs, fd, COP1_TRUNC_W);
+ }
+
// Convert a 32-bit float in fs to a 64-bit double in dd.
void cvtds(DRegister dd, FRegister fs) {
FRegister fd = static_cast<FRegister>(dd * 2);
@@ -597,23 +603,12 @@ class Assembler : public ValueObject {
EmitFpuRType(COP1, FMT_W, F0, fs, fd, COP1_CVT_D);
}
- // Converts a 64-bit signed int in fs to a double in fd.
- void cvtdl(DRegister dd, DRegister ds) {
- FRegister fs = static_cast<FRegister>(ds * 2);
- FRegister fd = static_cast<FRegister>(dd * 2);
- EmitFpuRType(COP1, FMT_L, F0, fs, fd, COP1_CVT_D);
- }
-
+ // Convert a 64-bit double in ds to a 32-bit float in fd.
void cvtsd(FRegister fd, DRegister ds) {
FRegister fs = static_cast<FRegister>(ds * 2);
EmitFpuRType(COP1, FMT_D, F0, fs, fd, COP1_CVT_S);
}
- void cvtwd(FRegister fd, DRegister ds) {
- FRegister fs = static_cast<FRegister>(ds * 2);
- EmitFpuRType(COP1, FMT_D, F0, fs, fd, COP1_CVT_W);
- }
-
void div(Register rs, Register rt) {
EmitRType(SPECIAL, rs, rt, R0, 0, DIV);
}
« no previous file with comments | « no previous file | runtime/vm/assembler_mips_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698