Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Sema/SemaRISCVVectorLookup.cpp
Show First 20 Lines • Show All 165 Lines • ▼ Show 20 Lines | bool CreateIntrinsicIfFound(LookupResult &LR, IdentifierInfo *II, | ||||
Preprocessor &PP) override; | Preprocessor &PP) override; | ||||
}; | }; | ||||
} // namespace | } // namespace | ||||
void RISCVIntrinsicManagerImpl::InitIntrinsicList() { | void RISCVIntrinsicManagerImpl::InitIntrinsicList() { | ||||
const TargetInfo &TI = Context.getTargetInfo(); | const TargetInfo &TI = Context.getTargetInfo(); | ||||
bool HasVectorFloat32 = TI.hasFeature("zve32f"); | bool HasVectorFloat32 = TI.hasFeature("zve32f"); | ||||
bool HasVectorFloat64 = TI.hasFeature("zve64d"); | bool HasVectorFloat64 = TI.hasFeature("zve64d"); | ||||
bool HasZvfh = TI.hasFeature("experimental-zvfh"); | |||||
bool HasRV64 = TI.hasFeature("64bit"); | bool HasRV64 = TI.hasFeature("64bit"); | ||||
bool HasFullMultiply = TI.hasFeature("v"); | bool HasFullMultiply = TI.hasFeature("v"); | ||||
// Construction of RVVIntrinsicRecords need to sync with createRVVIntrinsics | // Construction of RVVIntrinsicRecords need to sync with createRVVIntrinsics | ||||
// in RISCVVEmitter.cpp. | // in RISCVVEmitter.cpp. | ||||
for (auto &Record : RVVIntrinsicRecords) { | for (auto &Record : RVVIntrinsicRecords) { | ||||
// Create Intrinsics for each type and LMUL. | // Create Intrinsics for each type and LMUL. | ||||
BasicType BaseType = BasicType::Unknown; | BasicType BaseType = BasicType::Unknown; | ||||
Show All 35 Lines | for (unsigned int TypeRangeMaskShift = 0; | ||||
++TypeRangeMaskShift) { | ++TypeRangeMaskShift) { | ||||
unsigned int BaseTypeI = 1 << TypeRangeMaskShift; | unsigned int BaseTypeI = 1 << TypeRangeMaskShift; | ||||
BaseType = static_cast<BasicType>(BaseTypeI); | BaseType = static_cast<BasicType>(BaseTypeI); | ||||
if ((BaseTypeI & Record.TypeRangeMask) != BaseTypeI) | if ((BaseTypeI & Record.TypeRangeMask) != BaseTypeI) | ||||
continue; | continue; | ||||
// Check requirement. | // Check requirement. | ||||
if (BaseType == BasicType::Float16 && !HasZvfh) | |||||
continue; | |||||
if (BaseType == BasicType::Float32 && !HasVectorFloat32) | if (BaseType == BasicType::Float32 && !HasVectorFloat32) | ||||
continue; | continue; | ||||
if (BaseType == BasicType::Float64 && !HasVectorFloat64) | if (BaseType == BasicType::Float64 && !HasVectorFloat64) | ||||
continue; | continue; | ||||
if (((Record.RequiredExtensions & RVV_REQ_RV64) == RVV_REQ_RV64) && | if (((Record.RequiredExtensions & RVV_REQ_RV64) == RVV_REQ_RV64) && | ||||
!HasRV64) | !HasRV64) | ||||
▲ Show 20 Lines • Show All 204 Lines • Show Last 20 Lines |