| 271 | }()}; |
| 272 | |
| 273 | CPUBackend::CPUBackend(CodeBufferManager& CodeBuffers, FEXCore::Core::InternalThreadState* ThreadState) |
| 274 | : ThreadState(ThreadState) |
| 275 | , CodeBuffers(CodeBuffers) { |
| 276 | |
| 277 | auto& Common = ThreadState->CurrentFrame->Pointers.Common; |
| 278 | |
| 279 | // Initialize named vector constants. |
| 280 | for (size_t i = 0; i < FEXCore::IR::NamedVectorConstant::NAMED_VECTOR_CONST_POOL_MAX; ++i) { |
| 281 | Common.NamedVectorConstantPointers[i] = reinterpret_cast<uint64_t>(NamedVectorConstants[i]); |
| 282 | } |
| 283 | |
| 284 | // Copy named vector constants. |
| 285 | memcpy(Common.NamedVectorConstants, NamedVectorConstants, sizeof(NamedVectorConstants)); |
| 286 | |
| 287 | // Initialize Indexed named vector constants. |
| 288 | Common.IndexedNamedVectorConstantPointers[FEXCore::IR::IndexNamedVectorConstant::INDEXED_NAMED_VECTOR_PSHUFLW] = |
| 289 | reinterpret_cast<uint64_t>(PSHUFLW_LUT.data()); |
| 290 | Common.IndexedNamedVectorConstantPointers[FEXCore::IR::IndexNamedVectorConstant::INDEXED_NAMED_VECTOR_PSHUFHW] = |
| 291 | reinterpret_cast<uint64_t>(PSHUFHW_LUT.data()); |
| 292 | Common.IndexedNamedVectorConstantPointers[FEXCore::IR::IndexNamedVectorConstant::INDEXED_NAMED_VECTOR_PSHUFD] = |
| 293 | reinterpret_cast<uint64_t>(PSHUFD_LUT.data()); |
| 294 | Common.IndexedNamedVectorConstantPointers[FEXCore::IR::IndexNamedVectorConstant::INDEXED_NAMED_VECTOR_SHUFPS] = |
| 295 | reinterpret_cast<uint64_t>(SHUFPS_LUT.data()); |
| 296 | Common.IndexedNamedVectorConstantPointers[FEXCore::IR::IndexNamedVectorConstant::INDEXED_NAMED_VECTOR_DPPS_MASK] = |
| 297 | reinterpret_cast<uint64_t>(DPPS_MASK.data()); |
| 298 | Common.IndexedNamedVectorConstantPointers[FEXCore::IR::IndexNamedVectorConstant::INDEXED_NAMED_VECTOR_DPPD_MASK] = |
| 299 | reinterpret_cast<uint64_t>(DPPD_MASK.data()); |
| 300 | Common.IndexedNamedVectorConstantPointers[FEXCore::IR::IndexNamedVectorConstant::INDEXED_NAMED_VECTOR_PBLENDW] = |
| 301 | reinterpret_cast<uint64_t>(PBLENDW_LUT.data()); |
| 302 | |
| 303 | #ifndef FEX_DISABLE_TELEMETRY |
| 304 | // Fill in telemetry values |
| 305 | for (size_t i = 0; i < FEXCore::Telemetry::TYPE_LAST; ++i) { |
| 306 | auto& Telem = FEXCore::Telemetry::GetTelemetryValue(static_cast<FEXCore::Telemetry::TelemetryType>(i)); |
| 307 | Common.TelemetryValueAddresses[i] = reinterpret_cast<uint64_t>(&Telem); |
| 308 | } |
| 309 | #endif |
| 310 | } |
| 311 | |
| 312 | CPUBackend::~CPUBackend() = default; |
| 313 |
nothing calls this directly
no outgoing calls
no test coverage detected