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

Unified Diff: src/IceInstARM32.cpp

Issue 1407063002: Subzero. Misc ARM32 bugfixes. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments. Created 5 years, 2 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/IceCfg.cpp ('k') | src/IceTargetLoweringARM32.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInstARM32.cpp
diff --git a/src/IceInstARM32.cpp b/src/IceInstARM32.cpp
index c4d9ebc10a72bb751f177c6bde3775d9d943f48b..db9ed2c0ea85323688c8efd8b0542b635c4b9c60 100644
--- a/src/IceInstARM32.cpp
+++ b/src/IceInstARM32.cpp
@@ -874,6 +874,7 @@ template <> void InstARM32Movt::emit(const Cfg *Func) const {
}
void InstARM32Pop::emit(const Cfg *Func) const {
+ // TODO(jpp): Improve FP register save/restore.
if (!BuildDefs::dump())
return;
SizeT IntegerCount = 0;
@@ -883,23 +884,31 @@ void InstARM32Pop::emit(const Cfg *Func) const {
}
}
Ostream &Str = Func->getContext()->getStrEmit();
- if (IntegerCount == 0) {
- Str << "\t@ empty pop";
- return;
+ if (IntegerCount != 0) {
+ Str << "\t"
+ << "pop"
+ << "\t{";
+ bool PrintComma = false;
+ for (const Operand *Op : Dests) {
+ if (isScalarIntegerType(Op->getType())) {
+ if (PrintComma)
+ Str << ", ";
+ Op->emit(Func);
+ PrintComma = true;
+ }
+ }
+ Str << "}\n";
}
- Str << "\t"
- << "pop"
- << "\t{";
- bool PrintComma = false;
+
for (const Operand *Op : Dests) {
- if (isScalarIntegerType(Op->getType())) {
- if (PrintComma)
- Str << ", ";
- Op->emit(Func);
- PrintComma = true;
- }
+ if (isScalarIntegerType(Op->getType()))
+ continue;
+ Str << "\t"
+ << "vpop"
+ << "\t{";
+ Op->emit(Func);
+ Str << "}\n";
}
- Str << "}";
}
void InstARM32Pop::emitIAS(const Cfg *Func) const {
@@ -954,6 +963,7 @@ void InstARM32AdjustStack::dump(const Cfg *Func) const {
}
void InstARM32Push::emit(const Cfg *Func) const {
+ // TODO(jpp): Improve FP register save/restore.
if (!BuildDefs::dump())
return;
SizeT IntegerCount = 0;
@@ -963,25 +973,32 @@ void InstARM32Push::emit(const Cfg *Func) const {
}
}
Ostream &Str = Func->getContext()->getStrEmit();
- if (IntegerCount == 0) {
+ for (SizeT i = getSrcSize(); i > 0; --i) {
+ Operand *Op = getSrc(i - 1);
+ if (isScalarIntegerType(Op->getType()))
+ continue;
Str << "\t"
- << "@empty push";
- return;
+ << "vpush"
+ << "\t{";
+ Op->emit(Func);
+ Str << "}\n";
}
- Str << "\t"
- << "push"
- << "\t{";
- bool PrintComma = false;
- for (SizeT i = 0; i < getSrcSize(); ++i) {
- Operand *Op = getSrc(i);
- if (isScalarIntegerType(Op->getType())) {
- if (PrintComma)
- Str << ", ";
- Op->emit(Func);
- PrintComma = true;
+ if (IntegerCount != 0) {
+ Str << "\t"
+ << "push"
+ << "\t{";
+ bool PrintComma = false;
+ for (SizeT i = 0; i < getSrcSize(); ++i) {
+ Operand *Op = getSrc(i);
+ if (isScalarIntegerType(Op->getType())) {
+ if (PrintComma)
+ Str << ", ";
+ Op->emit(Func);
+ PrintComma = true;
+ }
}
+ Str << "}\n";
}
- Str << "}";
}
void InstARM32Push::emitIAS(const Cfg *Func) const {
« no previous file with comments | « src/IceCfg.cpp ('k') | src/IceTargetLoweringARM32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698