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

Side by Side Diff: src/IceInstX8632.cpp

Issue 1214693004: ARM lowering integer divide and remainder, with div by 0 checks. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: review fixes Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « src/IceInstARM32.cpp ('k') | src/IceTargetLowering.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceInstX8632.cpp - X86-32 instruction implementation ---===// 1 //===- subzero/src/IceInstX8632.cpp - X86-32 instruction implementation ---===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file implements the InstX8632 and OperandX8632 classes, 10 // This file implements the InstX8632 and OperandX8632 classes,
(...skipping 1921 matching lines...) Expand 10 before | Expand all | Expand 10 after
1932 1932
1933 void InstX8632UD2::emitIAS(const Cfg *Func) const { 1933 void InstX8632UD2::emitIAS(const Cfg *Func) const {
1934 X8632::AssemblerX8632 *Asm = Func->getAssembler<X8632::AssemblerX8632>(); 1934 X8632::AssemblerX8632 *Asm = Func->getAssembler<X8632::AssemblerX8632>();
1935 Asm->ud2(); 1935 Asm->ud2();
1936 } 1936 }
1937 1937
1938 void InstX8632UD2::dump(const Cfg *Func) const { 1938 void InstX8632UD2::dump(const Cfg *Func) const {
1939 if (!BuildDefs::dump()) 1939 if (!BuildDefs::dump())
1940 return; 1940 return;
1941 Ostream &Str = Func->getContext()->getStrDump(); 1941 Ostream &Str = Func->getContext()->getStrDump();
1942 Str << "ud2\n"; 1942 Str << "ud2";
1943 } 1943 }
1944 1944
1945 void InstX8632Test::emit(const Cfg *Func) const { 1945 void InstX8632Test::emit(const Cfg *Func) const {
1946 if (!BuildDefs::dump()) 1946 if (!BuildDefs::dump())
1947 return; 1947 return;
1948 Ostream &Str = Func->getContext()->getStrEmit(); 1948 Ostream &Str = Func->getContext()->getStrEmit();
1949 assert(getSrcSize() == 2); 1949 assert(getSrcSize() == 2);
1950 Str << "\ttest" << getWidthString(getSrc(0)->getType()) << "\t"; 1950 Str << "\ttest" << getWidthString(getSrc(0)->getType()) << "\t";
1951 getSrc(1)->emit(Func); 1951 getSrc(1)->emit(Func);
1952 Str << ", "; 1952 Str << ", ";
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1991 1991
1992 void InstX8632Mfence::emitIAS(const Cfg *Func) const { 1992 void InstX8632Mfence::emitIAS(const Cfg *Func) const {
1993 X8632::AssemblerX8632 *Asm = Func->getAssembler<X8632::AssemblerX8632>(); 1993 X8632::AssemblerX8632 *Asm = Func->getAssembler<X8632::AssemblerX8632>();
1994 Asm->mfence(); 1994 Asm->mfence();
1995 } 1995 }
1996 1996
1997 void InstX8632Mfence::dump(const Cfg *Func) const { 1997 void InstX8632Mfence::dump(const Cfg *Func) const {
1998 if (!BuildDefs::dump()) 1998 if (!BuildDefs::dump())
1999 return; 1999 return;
2000 Ostream &Str = Func->getContext()->getStrDump(); 2000 Ostream &Str = Func->getContext()->getStrDump();
2001 Str << "mfence\n"; 2001 Str << "mfence";
2002 } 2002 }
2003 2003
2004 void InstX8632Store::emit(const Cfg *Func) const { 2004 void InstX8632Store::emit(const Cfg *Func) const {
2005 if (!BuildDefs::dump()) 2005 if (!BuildDefs::dump())
2006 return; 2006 return;
2007 Ostream &Str = Func->getContext()->getStrEmit(); 2007 Ostream &Str = Func->getContext()->getStrEmit();
2008 assert(getSrcSize() == 2); 2008 assert(getSrcSize() == 2);
2009 Type Ty = getSrc(0)->getType(); 2009 Type Ty = getSrc(0)->getType();
2010 Str << "\tmov" << getWidthString(Ty) << TypeX8632Attributes[Ty].SdSsString 2010 Str << "\tmov" << getWidthString(Ty) << TypeX8632Attributes[Ty].SdSsString
2011 << "\t"; 2011 << "\t";
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
2505 Asm->add(IceType_i32, RegX8632::Encoded_Reg_esp, Width); 2505 Asm->add(IceType_i32, RegX8632::Encoded_Reg_esp, Width);
2506 } 2506 }
2507 } 2507 }
2508 2508
2509 void InstX8632Fstp::dump(const Cfg *Func) const { 2509 void InstX8632Fstp::dump(const Cfg *Func) const {
2510 if (!BuildDefs::dump()) 2510 if (!BuildDefs::dump())
2511 return; 2511 return;
2512 Ostream &Str = Func->getContext()->getStrDump(); 2512 Ostream &Str = Func->getContext()->getStrDump();
2513 dumpDest(Func); 2513 dumpDest(Func);
2514 Str << " = fstp." << getDest()->getType() << ", st(0)"; 2514 Str << " = fstp." << getDest()->getType() << ", st(0)";
2515 Str << "\n";
2516 } 2515 }
2517 2516
2518 template <> void InstX8632Pcmpeq::emit(const Cfg *Func) const { 2517 template <> void InstX8632Pcmpeq::emit(const Cfg *Func) const {
2519 if (!BuildDefs::dump()) 2518 if (!BuildDefs::dump())
2520 return; 2519 return;
2521 char buf[30]; 2520 char buf[30];
2522 snprintf(buf, llvm::array_lengthof(buf), "pcmpeq%s", 2521 snprintf(buf, llvm::array_lengthof(buf), "pcmpeq%s",
2523 TypeX8632Attributes[getDest()->getType()].PackString); 2522 TypeX8632Attributes[getDest()->getType()].PackString);
2524 emitTwoAddress(buf, this, Func); 2523 emitTwoAddress(buf, this, Func);
2525 } 2524 }
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
3054 } 3053 }
3055 Str << "("; 3054 Str << "(";
3056 if (Func) 3055 if (Func)
3057 Var->dump(Func); 3056 Var->dump(Func);
3058 else 3057 else
3059 Var->dump(Str); 3058 Var->dump(Str);
3060 Str << ")"; 3059 Str << ")";
3061 } 3060 }
3062 3061
3063 } // end of namespace Ice 3062 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceInstARM32.cpp ('k') | src/IceTargetLowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698