Remove some checks that have already been done in the only caller.
SDLoc DL(N);
uint64_t RemainderOffset = COffsetVal;
uint64_t ImmField = 0;
- const unsigned NumBits = TII->getNumFlatOffsetBits(AS, IsSigned);
+ const unsigned NumBits = TII->getNumFlatOffsetBits(IsSigned);
if (IsSigned) {
// Use signed division by a power of two to truncate towards 0.
int64_t D = 1LL << (NumBits - 1);
return RI.getRegClass(RCID)->hasSubClassEq(&AMDGPU::SGPR_128RegClass);
}
-unsigned SIInstrInfo::getNumFlatOffsetBits(unsigned AddrSpace,
- bool Signed) const {
- if (!ST.hasFlatInstOffsets())
- return 0;
-
- if (ST.hasFlatSegmentOffsetBug() && AddrSpace == AMDGPUAS::FLAT_ADDRESS)
- return 0;
-
+unsigned SIInstrInfo::getNumFlatOffsetBits(bool Signed) const {
if (ST.getGeneration() >= AMDGPUSubtarget::GFX10)
return Signed ? 12 : 11;
return isUInt<12>(Imm);
}
- unsigned getNumFlatOffsetBits(unsigned AddrSpace, bool Signed) const;
+ unsigned getNumFlatOffsetBits(bool Signed) const;
/// Returns if \p Offset is legal for the subtarget as the offset to a FLAT
/// encoded instruction. If \p Signed, this is for an instruction that