예제 #1
0
파일: vasm-xls.cpp 프로젝트: CodeKong/hhvm
std::string Interval::toString() {
  std::ostringstream out;
  auto delim = "";
  if (reg.isGP()) {
    out << reg::regname(Reg64(reg));
    delim = " ";
  } else if (reg.isSIMD()) {
    out << reg::regname(RegXMM(reg));
    delim = " ";
  }
  if (cns) {
    out << delim << folly::format("#{:08x}", val);
  }
  if (slot >= 0) {
    out << delim << "[%rsp+" << PhysLoc::disp(slot) << "]";
  }
  delim = "";
  out << " [";
  for (auto r : ranges) {
    out << delim << folly::format("{}-{}", r.start, r.end);
    delim = ",";
  }
  out << ") {";
  delim = "";
  for (auto u : uses) {
    out << delim << u.pos;
    delim = ",";
  }
  out << "}";
  return out.str();
}
예제 #2
0
파일: phys-reg.cpp 프로젝트: swtaarrs/hhvm
std::string show(PhysReg r) {
  switch (arch()) {
    case Arch::X64:
      return r.type() == PhysReg::GP   ? reg::regname(Reg64(r)) :
             r.type() == PhysReg::SIMD ? reg::regname(RegXMM(r)) :
          /* r.type() == PhysReg::SF)  ? */ reg::regname(RegSF(r));

    case Arch::ARM:
      if (r.isSF()) return "SF";

      return folly::to<std::string>(
        r.isGP() ? (vixl::Register(r).size() == vixl::kXRegSize ? 'x' : 'w')
                 : (vixl::FPRegister(r).size() == vixl::kSRegSize ? 's' : 'd'),
        ((vixl::CPURegister)r).code()
      );

    case Arch::PPC64:
      return r.type() == PhysReg::GP   ? ppc64_asm::reg::regname(Reg64(r)) :
             r.type() == PhysReg::SIMD ? ppc64_asm::reg::regname(RegXMM(r)) :
          /* r.type() == PhysReg::SF)  ? */ ppc64_asm::reg::regname(RegSF(r));
  }
  not_reached();
}