[amdgpu] Implement V_FMA_F32, IMAGE_SAMPLE_LZ, V_CVT_OFF_F32_I4

Loops fix
Decompile spirv on error
Wait for rpcsx-os if memory not exists
This commit is contained in:
DH 2023-07-14 04:33:45 +03:00
parent d6c8353636
commit 665d74740a
10 changed files with 458 additions and 77 deletions

View file

@ -1165,6 +1165,25 @@ public:
return id;
}
// relational
BoolValue createIsNan(BoolType resultType, Value operand1) {
auto region = bodyRegion.pushOp(spv::Op::OpIsNan, 4);
auto id = newId<BoolValue>();
region.pushIdUse(resultType);
region.pushIdDef(id);
region.pushIdUse(operand1);
return id;
}
BoolValue createIsInf(BoolType resultType, Value operand1) {
auto region = bodyRegion.pushOp(spv::Op::OpIsInf, 4);
auto id = newId<BoolValue>();
region.pushIdUse(resultType);
region.pushIdDef(id);
region.pushIdUse(operand1);
return id;
}
// logic
BoolValue createLogicalEqual(BoolType resultType, Value operand1,
Value operand2) {
@ -1489,6 +1508,32 @@ public:
return id;
}
VectorOfValue<FloatType> createImageSampleExplicitLod(
VectorOfType<FloatType> resultType, SampledImageValue sampledImage,
ScalarOrVectorOfValue<FloatType> coords,
spv::ImageOperandsMask operands = spv::ImageOperandsMask::MaskNone,
std::span<const Id> args = {}) {
auto region = bodyRegion.pushOp(
spv::Op::OpImageSampleExplicitLod,
5 + (operands == spv::ImageOperandsMask::MaskNone ? 0
: 1 + args.size()));
auto id = newId<VectorOfValue<FloatType>>();
region.pushIdUse(resultType);
region.pushIdDef(id);
region.pushIdUse(sampledImage);
region.pushIdUse(coords);
if (operands != spv::ImageOperandsMask::MaskNone) {
region.pushWord(static_cast<unsigned>(operands));
for (auto arg : args) {
region.pushIdUse(arg);
}
}
return id;
}
Value createImageQuerySizeLod(Type resultType, ImageValue image, Value lod) {
auto region = bodyRegion.pushOp(spv::Op::OpImageQuerySizeLod, 5);
auto id = newId<Value>();