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/IceInstX86Base.h

Issue 1537703002: Subzero. x8664. Resurrects the Target. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments Created 5 years 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
Index: src/IceInstX86Base.h
diff --git a/src/IceInstX86Base.h b/src/IceInstX86Base.h
index b53620847ad595498c485f85f480c7d553676acd..64bd859cbe3472e72488f55ec041c0133dd0bf63 100644
--- a/src/IceInstX86Base.h
+++ b/src/IceInstX86Base.h
@@ -962,10 +962,10 @@ public:
// mov cl, ecx ==> redundant
// mov ch, ecx ==> not redundant due to different encodings
// mov ch, ebp ==> not redundant due to different base registers
- // TODO(stichnot): Don't consider "mov eax, eax" to be redundant when
- // used in 64-bit mode to clear the upper half of rax.
- int32_t SrcReg = SrcVar->getRegNum();
- int32_t DestReg = this->Dest->getRegNum();
+ // mov ecx, ecx ==> redundant, and dangerous in x86-64. i64 zexting
+ // is handled by Inst86Zext.
+ const int32_t SrcReg = SrcVar->getRegNum();
+ const int32_t DestReg = this->Dest->getRegNum();
return (InstX86Base<Machine>::Traits::getEncoding(SrcReg) ==
InstX86Base<Machine>::Traits::getEncoding(DestReg)) &&
(InstX86Base<Machine>::Traits::getBaseReg(SrcReg) ==
@@ -1169,6 +1169,9 @@ class InstX86Mov
: public InstX86BaseMovlike<Machine, InstX86Base<Machine>::Mov> {
public:
static InstX86Mov *create(Cfg *Func, Variable *Dest, Operand *Source) {
+ assert(!isScalarIntegerType(Dest->getType()) ||
+ (typeWidthInBytes(Dest->getType()) <=
+ typeWidthInBytes(Source->getType())));
return new (Func->allocate<InstX86Mov>()) InstX86Mov(Func, Dest, Source);
}
« src/IceAssemblerX86Base.h ('K') | « src/IceInstX8664.def ('k') | src/IceInstX86BaseImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698