| 359 | } |
| 360 | |
| 361 | Id Builder::makeFloatE5M2Type() |
| 362 | { |
| 363 | // try to find it |
| 364 | Instruction* type; |
| 365 | for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeFloat)].size(); ++t) { |
| 366 | type = groupedTypes[enumCast(Op::OpTypeFloat)][t]; |
| 367 | if (type->getNumOperands() != 2) { |
| 368 | continue; |
| 369 | } |
| 370 | if (type->getImmediateOperand(0) == (unsigned)8 && |
| 371 | type->getImmediateOperand(1) == FPEncoding::Float8E5M2EXT) |
| 372 | return type->getResultId(); |
| 373 | } |
| 374 | |
| 375 | // not found, make it |
| 376 | type = new Instruction(getUniqueId(), NoType, Op::OpTypeFloat); |
| 377 | type->addImmediateOperand(8); |
| 378 | type->addImmediateOperand(FPEncoding::Float8E5M2EXT); |
| 379 | groupedTypes[enumCast(Op::OpTypeFloat)].push_back(type); |
| 380 | constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type)); |
| 381 | module.mapInstruction(type); |
| 382 | |
| 383 | addExtension(spv::E_SPV_EXT_float8); |
| 384 | addCapability(Capability::Float8EXT); |
| 385 | |
| 386 | if (emitNonSemanticShaderDebugInfo) { |
| 387 | auto const debugResultId = makeFloatDebugType(8, makeUintConstant((unsigned)FPEncoding::Float8E5M2EXT)); |
| 388 | debugTypeIdLookup[type->getResultId()] = debugResultId; |
| 389 | } |
| 390 | |
| 391 | return type->getResultId(); |
| 392 | } |
| 393 | |
| 394 | Id Builder::makeFloatE4M3Type() |
| 395 | { |
no test coverage detected