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

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: Beautifies the assembler. 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..1f80ca4276fe4b639b49c32b47ac7318ec991ec2 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 ==> reduntant, and dangerous in x86-64. i64 zexting
Jim Stichnoth 2015/12/20 19:27:37 redundant
John 2015/12/21 13:41:31 Done.
+ // 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);
}

Powered by Google App Engine
This is Rietveld 408576698