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

Side by Side Diff: src/IceInstMIPS32.h

Issue 1898743002: [Subzero][MIPS] Implement conditional branches and integer comparisons (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addressed review comments Created 4 years, 8 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 | « no previous file | src/IceInstMIPS32.cpp » ('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/IceInstMIPS32.h - MIPS32 machine instrs --*- C++ -*-=== // 1 //===- subzero/src/IceInstMIPS32.h - MIPS32 machine instrs --*- C++ -*-=== //
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 /// Base class for Mips instructions. 111 /// Base class for Mips instructions.
112 class InstMIPS32 : public InstTarget { 112 class InstMIPS32 : public InstTarget {
113 InstMIPS32() = delete; 113 InstMIPS32() = delete;
114 InstMIPS32(const InstMIPS32 &) = delete; 114 InstMIPS32(const InstMIPS32 &) = delete;
115 InstMIPS32 &operator=(const InstMIPS32 &) = delete; 115 InstMIPS32 &operator=(const InstMIPS32 &) = delete;
116 116
117 public: 117 public:
118 enum InstKindMIPS32 { 118 enum InstKindMIPS32 {
119 k__Start = Inst::Target, 119 k__Start = Inst::Target,
120 Add, 120 Add,
121 Addiu,
121 Addu, 122 Addu,
122 And, 123 And,
123 Addiu,
124 Br, 124 Br,
125 Call, 125 Call,
126 La, 126 La,
127 Label, 127 Label,
128 Lui, 128 Lui,
129 Mfhi, 129 Mfhi,
130 Mflo, 130 Mflo,
131 Mov, // actually a pseudo op for addi rd, rs, 0 131 Mov, // actually a pseudo op for addi rd, rs, 0
132 Mthi, 132 Mthi,
133 Mtlo, 133 Mtlo,
134 Mul, 134 Mul,
135 Mult, 135 Mult,
136 Multu, 136 Multu,
137 Or, 137 Or,
138 Ori, 138 Ori,
139 Ret, 139 Ret,
140 Slt,
141 Slti,
142 Sltiu,
143 Sltu,
140 Sub, 144 Sub,
141 Subu, 145 Subu,
142 Sltu, 146 Xor,
143 Xor 147 Xori
144 }; 148 };
145 149
146 static const char *getWidthString(Type Ty); 150 static const char *getWidthString(Type Ty);
147 151
148 void dump(const Cfg *Func) const override; 152 void dump(const Cfg *Func) const override;
149 153
150 void dumpOpcode(Ostream &Str, const char *Opcode, Type Ty) const { 154 void dumpOpcode(Ostream &Str, const char *Opcode, Type Ty) const {
151 Str << Opcode << "." << Ty; 155 Str << Opcode << "." << Ty;
152 } 156 }
153 157
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 using InstMIPS32La = InstMIPS32UnaryopGPR<InstMIPS32::La>; 466 using InstMIPS32La = InstMIPS32UnaryopGPR<InstMIPS32::La>;
463 using InstMIPS32Mfhi = InstMIPS32UnaryopGPR<InstMIPS32::Mfhi>; 467 using InstMIPS32Mfhi = InstMIPS32UnaryopGPR<InstMIPS32::Mfhi>;
464 using InstMIPS32Mflo = InstMIPS32UnaryopGPR<InstMIPS32::Mflo>; 468 using InstMIPS32Mflo = InstMIPS32UnaryopGPR<InstMIPS32::Mflo>;
465 using InstMIPS32Mthi = InstMIPS32UnaryopGPR<InstMIPS32::Mthi>; 469 using InstMIPS32Mthi = InstMIPS32UnaryopGPR<InstMIPS32::Mthi>;
466 using InstMIPS32Mtlo = InstMIPS32UnaryopGPR<InstMIPS32::Mtlo>; 470 using InstMIPS32Mtlo = InstMIPS32UnaryopGPR<InstMIPS32::Mtlo>;
467 using InstMIPS32Mul = InstMIPS32ThreeAddrGPR<InstMIPS32::Mul>; 471 using InstMIPS32Mul = InstMIPS32ThreeAddrGPR<InstMIPS32::Mul>;
468 using InstMIPS32Mult = InstMIPS32ThreeAddrGPR<InstMIPS32::Mult>; 472 using InstMIPS32Mult = InstMIPS32ThreeAddrGPR<InstMIPS32::Mult>;
469 using InstMIPS32Multu = InstMIPS32ThreeAddrGPR<InstMIPS32::Multu>; 473 using InstMIPS32Multu = InstMIPS32ThreeAddrGPR<InstMIPS32::Multu>;
470 using InstMIPS32Or = InstMIPS32ThreeAddrGPR<InstMIPS32::Or>; 474 using InstMIPS32Or = InstMIPS32ThreeAddrGPR<InstMIPS32::Or>;
471 using InstMIPS32Ori = InstMIPS32Imm16<InstMIPS32::Ori>; 475 using InstMIPS32Ori = InstMIPS32Imm16<InstMIPS32::Ori>;
476 using InstMIPS32Slt = InstMIPS32ThreeAddrGPR<InstMIPS32::Slt>;
477 using InstMIPS32Slti = InstMIPS32Imm16<InstMIPS32::Slti>;
478 using InstMIPS32Sltiu = InstMIPS32Imm16<InstMIPS32::Sltiu>;
472 using InstMIPS32Sltu = InstMIPS32ThreeAddrGPR<InstMIPS32::Sltu>; 479 using InstMIPS32Sltu = InstMIPS32ThreeAddrGPR<InstMIPS32::Sltu>;
473 using InstMIPS32Sub = InstMIPS32ThreeAddrGPR<InstMIPS32::Sub>; 480 using InstMIPS32Sub = InstMIPS32ThreeAddrGPR<InstMIPS32::Sub>;
474 using InstMIPS32Subu = InstMIPS32ThreeAddrGPR<InstMIPS32::Subu>; 481 using InstMIPS32Subu = InstMIPS32ThreeAddrGPR<InstMIPS32::Subu>;
475 using InstMIPS32Ori = InstMIPS32Imm16<InstMIPS32::Ori>; 482 using InstMIPS32Ori = InstMIPS32Imm16<InstMIPS32::Ori>;
476 using InstMIPS32Xor = InstMIPS32ThreeAddrGPR<InstMIPS32::Xor>; 483 using InstMIPS32Xor = InstMIPS32ThreeAddrGPR<InstMIPS32::Xor>;
484 using InstMIPS32Xori = InstMIPS32Imm16<InstMIPS32::Xori>;
477 485
478 /// Handles (some of) vmov's various formats. 486 /// Handles (some of) vmov's various formats.
479 class InstMIPS32Mov final : public InstMIPS32 { 487 class InstMIPS32Mov final : public InstMIPS32 {
480 InstMIPS32Mov() = delete; 488 InstMIPS32Mov() = delete;
481 InstMIPS32Mov(const InstMIPS32Mov &) = delete; 489 InstMIPS32Mov(const InstMIPS32Mov &) = delete;
482 InstMIPS32Mov &operator=(const InstMIPS32Mov &) = delete; 490 InstMIPS32Mov &operator=(const InstMIPS32Mov &) = delete;
483 491
484 public: 492 public:
485 static InstMIPS32Mov *create(Cfg *Func, Variable *Dest, Operand *Src) { 493 static InstMIPS32Mov *create(Cfg *Func, Variable *Dest, Operand *Src) {
486 return new (Func->allocate<InstMIPS32Mov>()) InstMIPS32Mov(Func, Dest, Src); 494 return new (Func->allocate<InstMIPS32Mov>()) InstMIPS32Mov(Func, Dest, Src);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 template <> void InstMIPS32Mfhi::emit(const Cfg *Func) const; 530 template <> void InstMIPS32Mfhi::emit(const Cfg *Func) const;
523 template <> void InstMIPS32Mtlo::emit(const Cfg *Func) const; 531 template <> void InstMIPS32Mtlo::emit(const Cfg *Func) const;
524 template <> void InstMIPS32Mthi::emit(const Cfg *Func) const; 532 template <> void InstMIPS32Mthi::emit(const Cfg *Func) const;
525 template <> void InstMIPS32Mult::emit(const Cfg *Func) const; 533 template <> void InstMIPS32Mult::emit(const Cfg *Func) const;
526 template <> void InstMIPS32Multu::emit(const Cfg *Func) const; 534 template <> void InstMIPS32Multu::emit(const Cfg *Func) const;
527 535
528 } // end of namespace MIPS32 536 } // end of namespace MIPS32
529 } // end of namespace Ice 537 } // end of namespace Ice
530 538
531 #endif // SUBZERO_SRC_ICEINSTMIPS32_H 539 #endif // SUBZERO_SRC_ICEINSTMIPS32_H
OLDNEW
« no previous file with comments | « no previous file | src/IceInstMIPS32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698