예제 #1
0
파일: phys-reg.cpp 프로젝트: JavaAmtho/hhvm
void PhysRegSaverParity::emitPops(X64Assembler& as, RegSet regs) {
  auto xmm = regs & kXMMRegs;
  auto gpr = regs - xmm;
  gpr.forEachR([&] (PhysReg pr) {
    as.    pop    (pr);
  });
  if (!xmm.empty()) {
    int offset = 0;
    xmm.forEach([&](PhysReg pr) {
      as.  movdqu (reg::rsp[offset], pr);
      offset += 16;
    });
    as.    addq   (offset, reg::rsp);
  }
}
예제 #2
0
PhysRegSaver::~PhysRegSaver() {
    auto& v = m_v;
    auto const sp = rsp();

    if (m_adjust) {
        v << lea{sp[m_adjust], sp};
    }

    auto gpr = m_regs & abi().gp();
    auto xmm = m_regs & abi().simd();

    gpr.forEachR([&] (PhysReg r) {
        v << pop{r};
    });

    if (!xmm.empty()) {
        int offset = 0;
        xmm.forEach([&] (PhysReg r) {
            v << loadups{sp[offset], r};
            offset += 16;
        });
        v << lea{sp[offset], sp};
    }
}