2021-02-08 05:54:35 +00:00
|
|
|
// Copyright 2021 yuzu Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include "shader_recompiler/backend/spirv/emit_spirv.h"
|
|
|
|
|
|
|
|
namespace Shader::Backend::SPIRV {
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
Id EmitIAdd32(EmitContext& ctx, IR::Inst* inst, Id a, Id b) {
|
2021-02-08 05:54:35 +00:00
|
|
|
if (inst->HasAssociatedPseudoOperation()) {
|
|
|
|
throw NotImplementedException("Pseudo-operations on IAdd32");
|
|
|
|
}
|
2021-02-16 07:10:22 +00:00
|
|
|
return ctx.OpIAdd(ctx.U32[1], a, b);
|
2021-02-08 05:54:35 +00:00
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
void EmitIAdd64(EmitContext&) {
|
2021-02-08 05:54:35 +00:00
|
|
|
throw NotImplementedException("SPIR-V Instruction");
|
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
Id EmitISub32(EmitContext& ctx, Id a, Id b) {
|
2021-02-16 07:10:22 +00:00
|
|
|
return ctx.OpISub(ctx.U32[1], a, b);
|
2021-02-08 05:54:35 +00:00
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
void EmitISub64(EmitContext&) {
|
2021-02-08 05:54:35 +00:00
|
|
|
throw NotImplementedException("SPIR-V Instruction");
|
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
Id EmitIMul32(EmitContext& ctx, Id a, Id b) {
|
2021-02-16 07:10:22 +00:00
|
|
|
return ctx.OpIMul(ctx.U32[1], a, b);
|
2021-02-08 05:54:35 +00:00
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
void EmitINeg32(EmitContext&) {
|
2021-02-08 05:54:35 +00:00
|
|
|
throw NotImplementedException("SPIR-V Instruction");
|
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
void EmitIAbs32(EmitContext&) {
|
2021-02-08 05:54:35 +00:00
|
|
|
throw NotImplementedException("SPIR-V Instruction");
|
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
Id EmitShiftLeftLogical32(EmitContext& ctx, Id base, Id shift) {
|
2021-02-16 07:10:22 +00:00
|
|
|
return ctx.OpShiftLeftLogical(ctx.U32[1], base, shift);
|
2021-02-08 05:54:35 +00:00
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
void EmitShiftRightLogical32(EmitContext&) {
|
2021-02-08 05:54:35 +00:00
|
|
|
throw NotImplementedException("SPIR-V Instruction");
|
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
void EmitShiftRightArithmetic32(EmitContext&) {
|
2021-02-08 05:54:35 +00:00
|
|
|
throw NotImplementedException("SPIR-V Instruction");
|
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
void EmitBitwiseAnd32(EmitContext&) {
|
2021-02-08 05:54:35 +00:00
|
|
|
throw NotImplementedException("SPIR-V Instruction");
|
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
void EmitBitwiseOr32(EmitContext&) {
|
2021-02-08 05:54:35 +00:00
|
|
|
throw NotImplementedException("SPIR-V Instruction");
|
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
void EmitBitwiseXor32(EmitContext&) {
|
2021-02-08 05:54:35 +00:00
|
|
|
throw NotImplementedException("SPIR-V Instruction");
|
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
void EmitBitFieldInsert(EmitContext&) {
|
2021-02-08 05:54:35 +00:00
|
|
|
throw NotImplementedException("SPIR-V Instruction");
|
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
void EmitBitFieldSExtract(EmitContext&) {
|
2021-02-08 05:54:35 +00:00
|
|
|
throw NotImplementedException("SPIR-V Instruction");
|
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
Id EmitBitFieldUExtract(EmitContext& ctx, Id base, Id offset, Id count) {
|
2021-02-16 07:10:22 +00:00
|
|
|
return ctx.OpBitFieldUExtract(ctx.U32[1], base, offset, count);
|
2021-02-08 05:54:35 +00:00
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
Id EmitSLessThan(EmitContext& ctx, Id lhs, Id rhs) {
|
2021-02-16 07:10:22 +00:00
|
|
|
return ctx.OpSLessThan(ctx.U1, lhs, rhs);
|
2021-02-08 05:54:35 +00:00
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
void EmitULessThan(EmitContext&) {
|
2021-02-08 05:54:35 +00:00
|
|
|
throw NotImplementedException("SPIR-V Instruction");
|
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
void EmitIEqual(EmitContext&) {
|
2021-02-08 05:54:35 +00:00
|
|
|
throw NotImplementedException("SPIR-V Instruction");
|
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
void EmitSLessThanEqual(EmitContext&) {
|
2021-02-08 05:54:35 +00:00
|
|
|
throw NotImplementedException("SPIR-V Instruction");
|
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
void EmitULessThanEqual(EmitContext&) {
|
2021-02-08 05:54:35 +00:00
|
|
|
throw NotImplementedException("SPIR-V Instruction");
|
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
Id EmitSGreaterThan(EmitContext& ctx, Id lhs, Id rhs) {
|
2021-02-16 07:10:22 +00:00
|
|
|
return ctx.OpSGreaterThan(ctx.U1, lhs, rhs);
|
2021-02-08 05:54:35 +00:00
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
void EmitUGreaterThan(EmitContext&) {
|
2021-02-08 05:54:35 +00:00
|
|
|
throw NotImplementedException("SPIR-V Instruction");
|
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
void EmitINotEqual(EmitContext&) {
|
2021-02-08 05:54:35 +00:00
|
|
|
throw NotImplementedException("SPIR-V Instruction");
|
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
void EmitSGreaterThanEqual(EmitContext&) {
|
2021-02-08 05:54:35 +00:00
|
|
|
throw NotImplementedException("SPIR-V Instruction");
|
|
|
|
}
|
|
|
|
|
2021-02-17 03:59:28 +00:00
|
|
|
Id EmitUGreaterThanEqual(EmitContext& ctx, Id lhs, Id rhs) {
|
2021-02-16 07:10:22 +00:00
|
|
|
return ctx.OpUGreaterThanEqual(ctx.U1, lhs, rhs);
|
2021-02-08 05:54:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Shader::Backend::SPIRV
|