Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp
Show All 19 Lines | |||||
#define DEBUG_TYPE "wasmtti" | #define DEBUG_TYPE "wasmtti" | ||||
TargetTransformInfo::PopcntSupportKind | TargetTransformInfo::PopcntSupportKind | ||||
WebAssemblyTTIImpl::getPopcntSupport(unsigned TyWidth) const { | WebAssemblyTTIImpl::getPopcntSupport(unsigned TyWidth) const { | ||||
assert(isPowerOf2_32(TyWidth) && "Ty width must be power of 2"); | assert(isPowerOf2_32(TyWidth) && "Ty width must be power of 2"); | ||||
return TargetTransformInfo::PSK_FastHardware; | return TargetTransformInfo::PSK_FastHardware; | ||||
} | } | ||||
unsigned WebAssemblyTTIImpl::getNumberOfRegisters(bool Vector) { | unsigned WebAssemblyTTIImpl::getNumberOfRegisters(unsigned ClassID) const { | ||||
unsigned Result = BaseT::getNumberOfRegisters(Vector); | unsigned Result = BaseT::getNumberOfRegisters(ClassID); | ||||
// For SIMD, use at least 16 registers, as a rough guess. | // For SIMD, use at least 16 registers, as a rough guess. | ||||
bool Vector = (ClassID == 1); | |||||
if (Vector) | if (Vector) | ||||
Result = std::max(Result, 16u); | Result = std::max(Result, 16u); | ||||
return Result; | return Result; | ||||
} | } | ||||
unsigned WebAssemblyTTIImpl::getRegisterBitWidth(bool Vector) const { | unsigned WebAssemblyTTIImpl::getRegisterBitWidth(bool Vector) const { | ||||
if (Vector && getST()->hasSIMD128()) | if (Vector && getST()->hasSIMD128()) | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |