OLD | NEW |
1 //===- subzero/src/IceInstMips32.cpp - Mips32 instruction implementation --===// | 1 //===- subzero/src/IceInstMips32.cpp - Mips32 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 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 } | 983 } |
984 | 984 |
985 template <> void InstMIPS32Sw::emitIAS(const Cfg *Func) const { | 985 template <> void InstMIPS32Sw::emitIAS(const Cfg *Func) const { |
986 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); | 986 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
987 auto *Mem = llvm::dyn_cast<OperandMIPS32Mem>(getSrc(1)); | 987 auto *Mem = llvm::dyn_cast<OperandMIPS32Mem>(getSrc(1)); |
988 ConstantInteger32 *Offset = llvm::cast<ConstantInteger32>(Mem->getOffset()); | 988 ConstantInteger32 *Offset = llvm::cast<ConstantInteger32>(Mem->getOffset()); |
989 uint32_t Imm = static_cast<uint32_t>(Offset->getValue()); | 989 uint32_t Imm = static_cast<uint32_t>(Offset->getValue()); |
990 Asm->sw(getSrc(0), Mem->getBase(), Imm); | 990 Asm->sw(getSrc(0), Mem->getBase(), Imm); |
991 } | 991 } |
992 | 992 |
| 993 template <> void InstMIPS32Teq::emitIAS(const Cfg *Func) const { |
| 994 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
| 995 Asm->teq(getSrc(0), getSrc(1), getTrapCode()); |
| 996 } |
| 997 |
993 template <> void InstMIPS32Trunc_l_d::emitIAS(const Cfg *Func) const { | 998 template <> void InstMIPS32Trunc_l_d::emitIAS(const Cfg *Func) const { |
994 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); | 999 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
995 Asm->trunc_l_d(getDest(), getSrc(0)); | 1000 Asm->trunc_l_d(getDest(), getSrc(0)); |
996 } | 1001 } |
997 | 1002 |
998 template <> void InstMIPS32Trunc_l_s::emitIAS(const Cfg *Func) const { | 1003 template <> void InstMIPS32Trunc_l_s::emitIAS(const Cfg *Func) const { |
999 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); | 1004 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
1000 Asm->trunc_l_s(getDest(), getSrc(0)); | 1005 Asm->trunc_l_s(getDest(), getSrc(0)); |
1001 } | 1006 } |
1002 | 1007 |
(...skipping 12 matching lines...) Expand all Loading... |
1015 Asm->xor_(getDest(), getSrc(0), getSrc(1)); | 1020 Asm->xor_(getDest(), getSrc(0), getSrc(1)); |
1016 } | 1021 } |
1017 | 1022 |
1018 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const { | 1023 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const { |
1019 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); | 1024 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); |
1020 Asm->xori(getDest(), getSrc(0), Imm); | 1025 Asm->xori(getDest(), getSrc(0), Imm); |
1021 } | 1026 } |
1022 | 1027 |
1023 } // end of namespace MIPS32 | 1028 } // end of namespace MIPS32 |
1024 } // end of namespace Ice | 1029 } // end of namespace Ice |
OLD | NEW |