| OLD | NEW |
| 1 //===- subzero/src/IceInstARM32.cpp - ARM32 instruction implementation ----===// | 1 //===- subzero/src/IceInstARM32.cpp - ARM32 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 /// \file | 10 /// \file |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 void InstARM32Pred::dumpOpcodePred(Ostream &Str, const char *Opcode, | 73 void InstARM32Pred::dumpOpcodePred(Ostream &Str, const char *Opcode, |
| 74 Type Ty) const { | 74 Type Ty) const { |
| 75 Str << Opcode << getPredicate() << "." << Ty; | 75 Str << Opcode << getPredicate() << "." << Ty; |
| 76 } | 76 } |
| 77 | 77 |
| 78 CondARM32::Cond InstARM32::getOppositeCondition(CondARM32::Cond Cond) { | 78 CondARM32::Cond InstARM32::getOppositeCondition(CondARM32::Cond Cond) { |
| 79 return InstARM32CondAttributes[Cond].Opposite; | 79 return InstARM32CondAttributes[Cond].Opposite; |
| 80 } | 80 } |
| 81 | 81 |
| 82 void InstARM32Pred::emitUnaryopGPR(const char *Opcode, | 82 void InstARM32Pred::emitUnaryopGPR(const char *Opcode, |
| 83 const InstARM32Pred *Inst, const Cfg *Func) { | 83 const InstARM32Pred *Inst, const Cfg *Func, |
| 84 bool NeedsWidthSuffix) { |
| 84 Ostream &Str = Func->getContext()->getStrEmit(); | 85 Ostream &Str = Func->getContext()->getStrEmit(); |
| 85 assert(Inst->getSrcSize() == 1); | 86 assert(Inst->getSrcSize() == 1); |
| 86 Type SrcTy = Inst->getSrc(0)->getType(); | 87 Type SrcTy = Inst->getSrc(0)->getType(); |
| 87 Type DestTy = Inst->getDest()->getType(); | |
| 88 Str << "\t" << Opcode; | 88 Str << "\t" << Opcode; |
| 89 // Sxt and Uxt need source type width letter to define the operation. | 89 if (NeedsWidthSuffix) |
| 90 // The other unary operations have the same source and dest type and | |
| 91 // as a result need only one letter. | |
| 92 if (SrcTy != DestTy) | |
| 93 Str << getWidthString(SrcTy); | 90 Str << getWidthString(SrcTy); |
| 94 Str << "\t"; | 91 Str << Inst->getPredicate() << "\t"; |
| 95 Inst->getDest()->emit(Func); | 92 Inst->getDest()->emit(Func); |
| 96 Str << ", "; | 93 Str << ", "; |
| 97 Inst->getSrc(0)->emit(Func); | 94 Inst->getSrc(0)->emit(Func); |
| 98 } | 95 } |
| 99 | 96 |
| 100 void InstARM32Pred::emitTwoAddr(const char *Opcode, const InstARM32Pred *Inst, | 97 void InstARM32Pred::emitTwoAddr(const char *Opcode, const InstARM32Pred *Inst, |
| 101 const Cfg *Func) { | 98 const Cfg *Func) { |
| 102 if (!BuildDefs::dump()) | 99 if (!BuildDefs::dump()) |
| 103 return; | 100 return; |
| 104 Ostream &Str = Func->getContext()->getStrEmit(); | 101 Ostream &Str = Func->getContext()->getStrEmit(); |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 addSource(Src0); | 348 addSource(Src0); |
| 352 addSource(Src1); | 349 addSource(Src1); |
| 353 } | 350 } |
| 354 | 351 |
| 355 // ======================== Dump routines ======================== // | 352 // ======================== Dump routines ======================== // |
| 356 | 353 |
| 357 // Two-addr ops | 354 // Two-addr ops |
| 358 template <> const char *InstARM32Movt::Opcode = "movt"; | 355 template <> const char *InstARM32Movt::Opcode = "movt"; |
| 359 // Unary ops | 356 // Unary ops |
| 360 template <> const char *InstARM32Movw::Opcode = "movw"; | 357 template <> const char *InstARM32Movw::Opcode = "movw"; |
| 358 template <> const char *InstARM32Clz::Opcode = "clz"; |
| 361 template <> const char *InstARM32Mvn::Opcode = "mvn"; | 359 template <> const char *InstARM32Mvn::Opcode = "mvn"; |
| 360 template <> const char *InstARM32Rbit::Opcode = "rbit"; |
| 361 template <> const char *InstARM32Rev::Opcode = "rev"; |
| 362 template <> const char *InstARM32Sxt::Opcode = "sxt"; // still requires b/h | 362 template <> const char *InstARM32Sxt::Opcode = "sxt"; // still requires b/h |
| 363 template <> const char *InstARM32Uxt::Opcode = "uxt"; // still requires b/h | 363 template <> const char *InstARM32Uxt::Opcode = "uxt"; // still requires b/h |
| 364 // Mov-like ops | 364 // Mov-like ops |
| 365 template <> const char *InstARM32Mov::Opcode = "mov"; | 365 template <> const char *InstARM32Mov::Opcode = "mov"; |
| 366 // Three-addr ops | 366 // Three-addr ops |
| 367 template <> const char *InstARM32Adc::Opcode = "adc"; | 367 template <> const char *InstARM32Adc::Opcode = "adc"; |
| 368 template <> const char *InstARM32Add::Opcode = "add"; | 368 template <> const char *InstARM32Add::Opcode = "add"; |
| 369 template <> const char *InstARM32And::Opcode = "and"; | 369 template <> const char *InstARM32And::Opcode = "and"; |
| 370 template <> const char *InstARM32Asr::Opcode = "asr"; | 370 template <> const char *InstARM32Asr::Opcode = "asr"; |
| 371 template <> const char *InstARM32Bic::Opcode = "bic"; | 371 template <> const char *InstARM32Bic::Opcode = "bic"; |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 if (getShiftOp() != kNoShift) { | 931 if (getShiftOp() != kNoShift) { |
| 932 Str << ", " << InstARM32ShiftAttributes[getShiftOp()].EmitString << " "; | 932 Str << ", " << InstARM32ShiftAttributes[getShiftOp()].EmitString << " "; |
| 933 if (Func) | 933 if (Func) |
| 934 getShiftAmt()->dump(Func); | 934 getShiftAmt()->dump(Func); |
| 935 else | 935 else |
| 936 getShiftAmt()->dump(Str); | 936 getShiftAmt()->dump(Str); |
| 937 } | 937 } |
| 938 } | 938 } |
| 939 | 939 |
| 940 } // end of namespace Ice | 940 } // end of namespace Ice |
| OLD | NEW |