2021-05-08 21:28:52 +02:00
|
|
|
// Copyright 2021 yuzu Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include <string_view>
|
|
|
|
|
|
|
|
#include "shader_recompiler/backend/glasm/emit_context.h"
|
|
|
|
#include "shader_recompiler/backend/glasm/emit_glasm_instructions.h"
|
|
|
|
#include "shader_recompiler/frontend/ir/value.h"
|
|
|
|
|
|
|
|
namespace Shader::Backend::GLASM {
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
template <typename InputType>
|
|
|
|
static void Compare(EmitContext& ctx, IR::Inst& inst, InputType lhs, InputType rhs,
|
|
|
|
std::string_view op, std::string_view type, bool ordered,
|
|
|
|
bool inequality = false) {
|
|
|
|
const Register ret{ctx.reg_alloc.Define(inst)};
|
|
|
|
ctx.Add("{}.{} RC.x,{},{};", op, type, lhs, rhs);
|
|
|
|
if (ordered && inequality) {
|
|
|
|
ctx.Add("SEQ.{} RC.y,{},{};"
|
|
|
|
"SEQ.{} RC.z,{},{};"
|
|
|
|
"AND.U RC.x,RC.x,RC.y;"
|
|
|
|
"AND.U RC.x,RC.x,RC.z;"
|
|
|
|
"SNE.S {}.x,RC.x,0;",
|
|
|
|
type, lhs, lhs, type, rhs, rhs, ret);
|
|
|
|
} else if (ordered) {
|
|
|
|
ctx.Add("SNE.S {}.x,RC.x,0;", ret);
|
|
|
|
} else {
|
|
|
|
ctx.Add("SNE.{} RC.y,{},{};"
|
|
|
|
"SNE.{} RC.z,{},{};"
|
|
|
|
"OR.U RC.x,RC.x,RC.y;"
|
|
|
|
"OR.U RC.x,RC.x,RC.z;"
|
|
|
|
"SNE.S {}.x,RC.x,0;",
|
|
|
|
type, lhs, lhs, type, rhs, rhs, ret);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-09 23:03:01 +02:00
|
|
|
void EmitFPAbs16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
|
|
|
|
[[maybe_unused]] Register value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPAbs32(EmitContext& ctx, IR::Inst& inst, ScalarF32 value) {
|
|
|
|
ctx.Add("MOV.F {}.x,|{}|;", inst, value);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-09 23:03:01 +02:00
|
|
|
void EmitFPAbs64(EmitContext& ctx, IR::Inst& inst, ScalarF64 value) {
|
|
|
|
ctx.LongAdd("MOV.F64 {}.x,|{}|;", inst, value);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void EmitFPAdd16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
|
2021-05-09 08:11:34 +02:00
|
|
|
[[maybe_unused]] Register a, [[maybe_unused]] Register b) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPAdd32(EmitContext& ctx, IR::Inst& inst, ScalarF32 a, ScalarF32 b) {
|
|
|
|
ctx.Add("ADD.F {}.x,{},{};", inst, a, b);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-09 23:03:01 +02:00
|
|
|
void EmitFPAdd64(EmitContext& ctx, IR::Inst& inst, ScalarF64 a, ScalarF64 b) {
|
|
|
|
ctx.LongAdd("ADD.F64 {}.x,{},{};", inst, a, b);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void EmitFPFma16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
|
2021-05-09 08:11:34 +02:00
|
|
|
[[maybe_unused]] Register a, [[maybe_unused]] Register b,
|
|
|
|
[[maybe_unused]] Register c) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPFma32(EmitContext& ctx, IR::Inst& inst, ScalarF32 a, ScalarF32 b, ScalarF32 c) {
|
|
|
|
ctx.Add("MAD.F {}.x,{},{},{};", inst, a, b, c);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPFma64(EmitContext& ctx, IR::Inst& inst, ScalarF64 a, ScalarF64 b, ScalarF64 c) {
|
|
|
|
ctx.LongAdd("MAD.F64 {}.x,{},{},{};", inst, a, b, c);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-10 02:22:55 +02:00
|
|
|
void EmitFPMax32(EmitContext& ctx, IR::Inst& inst, ScalarF32 a, ScalarF32 b) {
|
|
|
|
ctx.Add("MAX.F {}.x,{},{};", inst, a, b);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPMax64(EmitContext& ctx, IR::Inst& inst, ScalarF64 a, ScalarF64 b) {
|
2021-05-10 02:22:55 +02:00
|
|
|
ctx.LongAdd("MAX.F64 {}.x,{},{};", inst, a, b);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-10 02:22:55 +02:00
|
|
|
void EmitFPMin32(EmitContext& ctx, IR::Inst& inst, ScalarF32 a, ScalarF32 b) {
|
|
|
|
ctx.Add("MIN.F {}.x,{},{};", inst, a, b);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPMin64(EmitContext& ctx, IR::Inst& inst, ScalarF64 a, ScalarF64 b) {
|
2021-05-10 02:22:55 +02:00
|
|
|
ctx.LongAdd("MIN.F64 {}.x,{},{};", inst, a, b);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void EmitFPMul16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
|
2021-05-09 08:11:34 +02:00
|
|
|
[[maybe_unused]] Register a, [[maybe_unused]] Register b) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPMul32(EmitContext& ctx, IR::Inst& inst, ScalarF32 a, ScalarF32 b) {
|
|
|
|
ctx.Add("MUL.F {}.x,{},{};", inst, a, b);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPMul64(EmitContext& ctx, IR::Inst& inst, ScalarF64 a, ScalarF64 b) {
|
|
|
|
ctx.LongAdd("MUL.F64 {}.x,{},{};", inst, a, b);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPNeg16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPNeg32(EmitContext& ctx, IR::Inst& inst, ScalarRegister value) {
|
|
|
|
ctx.Add("MOV.F {}.x,-{};", inst, value);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-09 23:03:01 +02:00
|
|
|
void EmitFPNeg64(EmitContext& ctx, IR::Inst& inst, Register value) {
|
|
|
|
ctx.LongAdd("MOV.F64 {}.x,-{};", inst, value);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPSin([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPCos([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPExp2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPLog2([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPRecip32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPRecip64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPRecipSqrt32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPRecipSqrt64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPSqrt([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPSaturate16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPSaturate32(EmitContext& ctx, IR::Inst& inst, ScalarF32 value) {
|
|
|
|
ctx.Add("MOV.F.SAT {}.x,{};", inst, value);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPSaturate64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPClamp16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value,
|
|
|
|
[[maybe_unused]] Register min_value, [[maybe_unused]] Register max_value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value,
|
|
|
|
[[maybe_unused]] ScalarF32 min_value, [[maybe_unused]] ScalarF32 max_value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPClamp64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value,
|
|
|
|
[[maybe_unused]] Register min_value, [[maybe_unused]] Register max_value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPRoundEven16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPRoundEven32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPRoundEven64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPFloor16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPFloor32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPFloor64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPCeil16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPCeil32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPCeil64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPTrunc16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPTrunc32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarF32 value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPTrunc64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPOrdEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs,
|
|
|
|
[[maybe_unused]] Register rhs) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPOrdEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) {
|
2021-05-10 02:13:09 +02:00
|
|
|
Compare(ctx, inst, lhs, rhs, "SEQ", "F", true);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPOrdEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SEQ", "F64", true);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPUnordEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs,
|
|
|
|
[[maybe_unused]] Register rhs) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPUnordEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SEQ", "F", false);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPUnordEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SEQ", "F64", false);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPOrdNotEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs,
|
|
|
|
[[maybe_unused]] Register rhs) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPOrdNotEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SNE", "F", true, true);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPOrdNotEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SNE", "F64", true, true);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPUnordNotEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs,
|
|
|
|
[[maybe_unused]] Register rhs) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPUnordNotEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SNE", "F", false, true);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPUnordNotEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SNE", "F64", false, true);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPOrdLessThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs,
|
|
|
|
[[maybe_unused]] Register rhs) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPOrdLessThan32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) {
|
2021-05-10 02:13:09 +02:00
|
|
|
Compare(ctx, inst, lhs, rhs, "SLT", "F", true);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPOrdLessThan64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SLT", "F64", true);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPUnordLessThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs,
|
|
|
|
[[maybe_unused]] Register rhs) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPUnordLessThan32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SLT", "F", false);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPUnordLessThan64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SLT", "F64", false);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPOrdGreaterThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs,
|
|
|
|
[[maybe_unused]] Register rhs) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPOrdGreaterThan32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SGT", "F", true);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPOrdGreaterThan64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SGT", "F64", true);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPUnordGreaterThan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs,
|
|
|
|
[[maybe_unused]] Register rhs) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPUnordGreaterThan32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SGT", "F", false);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPUnordGreaterThan64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SGT", "F64", false);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPOrdLessThanEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs,
|
|
|
|
[[maybe_unused]] Register rhs) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPOrdLessThanEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) {
|
2021-05-10 02:13:09 +02:00
|
|
|
Compare(ctx, inst, lhs, rhs, "SLE", "F", true);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPOrdLessThanEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SLE", "F64", true);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPUnordLessThanEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs,
|
|
|
|
[[maybe_unused]] Register rhs) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPUnordLessThanEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SLE", "F", false);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPUnordLessThanEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SLE", "F64", false);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPOrdGreaterThanEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs,
|
|
|
|
[[maybe_unused]] Register rhs) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPOrdGreaterThanEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SGE", "F", true);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPOrdGreaterThanEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SGE", "F64", true);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-09 08:11:34 +02:00
|
|
|
void EmitFPUnordGreaterThanEqual16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register lhs,
|
|
|
|
[[maybe_unused]] Register rhs) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPUnordGreaterThanEqual32(EmitContext& ctx, IR::Inst& inst, ScalarF32 lhs, ScalarF32 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SGE", "F", false);
|
2021-05-08 21:28:52 +02:00
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPUnordGreaterThanEqual64(EmitContext& ctx, IR::Inst& inst, ScalarF64 lhs, ScalarF64 rhs) {
|
|
|
|
Compare(ctx, inst, lhs, rhs, "SGE", "F64", false);
|
|
|
|
}
|
|
|
|
|
|
|
|
void EmitFPIsNan16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) {
|
2021-05-08 21:28:52 +02:00
|
|
|
throw NotImplementedException("GLASM instruction");
|
|
|
|
}
|
|
|
|
|
2021-05-10 02:13:09 +02:00
|
|
|
void EmitFPIsNan32(EmitContext& ctx, IR::Inst& inst, ScalarF32 value) {
|
|
|
|
Compare(ctx, inst, value, value, "SNE", "F", true, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
void EmitFPIsNan64(EmitContext& ctx, IR::Inst& inst, ScalarF64 value) {
|
|
|
|
Compare(ctx, inst, value, value, "SNE", "F64", true, false);
|
|
|
|
}
|
|
|
|
|
2021-05-08 21:28:52 +02:00
|
|
|
} // namespace Shader::Backend::GLASM
|