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

Unified Diff: src/IceInstX8632.cpp

Issue 550723002: Subzero: Use cvttss2si and similar instead of cvtss2si for fp->int casts. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Use truncating conversion instruction for fp to int conversions Created 6 years, 3 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/IceInstX8632.h ('k') | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInstX8632.cpp
diff --git a/src/IceInstX8632.cpp b/src/IceInstX8632.cpp
index 1454778f39907fa6f3a4de86ccb53c1b24d6db46..373ab59e47503c4b3535edaaf87bc17a4aa015f5 100644
--- a/src/IceInstX8632.cpp
+++ b/src/IceInstX8632.cpp
@@ -182,8 +182,9 @@ InstX8632Cmpxchg8b::InstX8632Cmpxchg8b(Cfg *Func, OperandX8632 *Addr,
addSource(Ebx);
}
-InstX8632Cvt::InstX8632Cvt(Cfg *Func, Variable *Dest, Operand *Source)
- : InstX8632(Func, InstX8632::Cvt, 1, Dest) {
+InstX8632Cvt::InstX8632Cvt(Cfg *Func, Variable *Dest, Operand *Source,
+ bool Trunc)
+ : InstX8632(Func, InstX8632::Cvt, 1, Dest), Trunc(Trunc) {
addSource(Source);
}
@@ -798,7 +799,10 @@ void InstX8632Cmpxchg8b::dump(const Cfg *Func) const {
void InstX8632Cvt::emit(const Cfg *Func) const {
Ostream &Str = Func->getContext()->getStrEmit();
assert(getSrcSize() == 1);
- Str << "\tcvt" << TypeX8632Attributes[getSrc(0)->getType()].CvtString << "2"
+ Str << "\tcvt";
+ if (Trunc)
+ Str << "t";
+ Str << TypeX8632Attributes[getSrc(0)->getType()].CvtString << "2"
<< TypeX8632Attributes[getDest()->getType()].CvtString << "\t";
getDest()->emit(Func);
Str << ", ";
@@ -809,8 +813,11 @@ void InstX8632Cvt::emit(const Cfg *Func) const {
void InstX8632Cvt::dump(const Cfg *Func) const {
Ostream &Str = Func->getContext()->getStrDump();
dumpDest(Func);
- Str << " = cvt" << TypeX8632Attributes[getSrc(0)->getType()].CvtString
- << "2" << TypeX8632Attributes[getDest()->getType()].CvtString << " ";
+ Str << " = cvt";
+ if (Trunc)
+ Str << "t";
+ Str << TypeX8632Attributes[getSrc(0)->getType()].CvtString << "2"
+ << TypeX8632Attributes[getDest()->getType()].CvtString << " ";
dumpSources(Func);
}
« no previous file with comments | « src/IceInstX8632.h ('k') | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698