示例#1
0
unsigned SIRegisterInfo::getNumReservedSGPRs(const SISubtarget &ST,
                                             const SIMachineFunctionInfo &MFI) const {
  if (MFI.hasFlatScratchInit()) {
    if (ST.getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS)
      return 6; // FLAT_SCRATCH, XNACK, VCC (in that order)

    if (ST.getGeneration() == AMDGPUSubtarget::SEA_ISLANDS)
      return 4; // FLAT_SCRATCH, VCC (in that order)
  }

  if (ST.isXNACKEnabled())
    return 4; // XNACK, VCC (in that order)

  return 2; // VCC.
}
示例#2
0
static unsigned getNumExtraSGPRs(const SISubtarget &ST,
                                 bool VCCUsed,
                                 bool FlatScrUsed) {
  unsigned ExtraSGPRs = 0;
  if (VCCUsed)
    ExtraSGPRs = 2;

  if (ST.getGeneration() < SISubtarget::VOLCANIC_ISLANDS) {
    if (FlatScrUsed)
      ExtraSGPRs = 4;
  } else {
    if (ST.isXNACKEnabled())
      ExtraSGPRs = 4;

    if (FlatScrUsed)
      ExtraSGPRs = 6;
  }

  return ExtraSGPRs;
}
示例#3
0
unsigned SIRegisterInfo::getNumSGPRsAllowed(const SISubtarget &ST,
                                            unsigned WaveCount) const {
  if (ST.getGeneration() >= SISubtarget::VOLCANIC_ISLANDS) {
    switch (WaveCount) {
      case 10: return 80;
      case 9:  return 80;
      case 8:  return 96;
      default: return 102;
    }
  } else {
    switch(WaveCount) {
      case 10: return 48;
      case 9:  return 56;
      case 8:  return 64;
      case 7:  return 72;
      case 6:  return 80;
      case 5:  return 96;
      default: return 103;
    }
  }
}
示例#4
0
unsigned SIRegisterInfo::getMinNumSGPRs(const SISubtarget &ST,
                                        unsigned WavesPerEU) const {
  if (ST.getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS) {
    switch (WavesPerEU) {
      case 0:  return 0;
      case 10: return 0;
      case 9:  return 0;
      case 8:  return 81;
      default: return 97;
    }
  } else {
    switch (WavesPerEU) {
      case 0:  return 0;
      case 10: return 0;
      case 9:  return 49;
      case 8:  return 57;
      case 7:  return 65;
      case 6:  return 73;
      case 5:  return 81;
      default: return 97;
    }
  }
}
示例#5
0
unsigned SIRegisterInfo::getMaxNumSGPRs(const SISubtarget &ST,
                                        unsigned WavesPerEU) const {
  if (ST.getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS) {
    switch (WavesPerEU) {
      case 0:  return 80;
      case 10: return 80;
      case 9:  return 80;
      case 8:  return 96;
      default: return getNumAddressableSGPRs(ST);
    }
  } else {
    switch (WavesPerEU) {
      case 0:  return 48;
      case 10: return 48;
      case 9:  return 56;
      case 8:  return 64;
      case 7:  return 72;
      case 6:  return 80;
      case 5:  return 96;
      default: return getNumAddressableSGPRs(ST);
    }
  }
}
示例#6
0
unsigned SIRegisterInfo::getNumReservedSGPRs(const SISubtarget &ST) const {
  if (ST.getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS)
    return 6; // VCC, FLAT_SCRATCH, XNACK.
  return 2; // VCC.
}
示例#7
0
unsigned SIRegisterInfo::getNumAddressableSGPRs(const SISubtarget &ST) const {
  if (ST.getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS)
    return 102;
  return 104;
}
示例#8
0
unsigned SIRegisterInfo::getTotalNumSGPRs(const SISubtarget &ST) const {
  if (ST.getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS)
    return 800;
  return 512;
}