PeepsMD.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #include "Backend.h"
  6. // PeepsMD::Init
  7. void
  8. PeepsMD::Init(Peeps *peeps)
  9. {
  10. this->peeps = peeps;
  11. }
  12. // PeepsMD::ProcessImplicitRegs
  13. void
  14. PeepsMD::ProcessImplicitRegs(IR::Instr *instr)
  15. {
  16. if (LowererMD::IsCall(instr))
  17. {
  18. this->peeps->ClearReg(RegR0);
  19. this->peeps->ClearReg(RegR1);
  20. this->peeps->ClearReg(RegR2);
  21. this->peeps->ClearReg(RegR3);
  22. this->peeps->ClearReg(SCRATCH_REG);
  23. this->peeps->ClearReg(RegLR);
  24. this->peeps->ClearReg(RegD0);
  25. this->peeps->ClearReg(RegD1);
  26. this->peeps->ClearReg(RegD2);
  27. this->peeps->ClearReg(RegD3);
  28. this->peeps->ClearReg(RegD4);
  29. this->peeps->ClearReg(RegD5);
  30. this->peeps->ClearReg(RegD6);
  31. this->peeps->ClearReg(RegD7);
  32. }
  33. else if (instr->m_opcode == Js::OpCode::SMULL ||
  34. instr->m_opcode == Js::OpCode::SMLAL)
  35. {
  36. // As we don't currently have support for 4 operand instrs, we use R12 as 4th operand,
  37. // Notify the peeps that we use r12: SMULL, dst, r12, src1, src2.
  38. this->peeps->ClearReg(SCRATCH_REG);
  39. }
  40. }
  41. void
  42. PeepsMD::PeepAssign(IR::Instr *instr)
  43. {
  44. return;
  45. }