Meow gidolio 2.0

This commit is contained in:
CamilleLaVey
2026-07-31 23:14:58 -04:00
parent 70ff43f2f8
commit dcbfa3c2d3
2 changed files with 4 additions and 4 deletions
@@ -10,7 +10,7 @@ namespace Shader::IR {
namespace Detail { namespace Detail {
OpcodeMeta META_TABLE[532] = { OpcodeMeta META_TABLE[] = {
#define OPCODE(name_token, type_token, ...) \ #define OPCODE(name_token, type_token, ...) \
{ \ { \
.name{#name_token}, \ .name{#name_token}, \
@@ -21,7 +21,7 @@ OpcodeMeta META_TABLE[532] = {
#undef OPCODE #undef OPCODE
}; };
u8 NUM_ARGS[532] = { u8 NUM_ARGS[] = {
#define OPCODE(name_token, type_token, ...) u8(CalculateNumArgsOf(Opcode::name_token)), #define OPCODE(name_token, type_token, ...) u8(CalculateNumArgsOf(Opcode::name_token)),
#include "opcodes.inc" #include "opcodes.inc"
#undef OPCODE #undef OPCODE
+2 -2
View File
@@ -57,12 +57,12 @@ static constexpr Type F64x2{Type::F64x2};
static constexpr Type F64x3{Type::F64x3}; static constexpr Type F64x3{Type::F64x3};
static constexpr Type F64x4{Type::F64x4}; static constexpr Type F64x4{Type::F64x4};
extern OpcodeMeta META_TABLE[532]; extern OpcodeMeta META_TABLE[];
constexpr size_t CalculateNumArgsOf(Opcode op) noexcept { constexpr size_t CalculateNumArgsOf(Opcode op) noexcept {
const auto& arg_types = META_TABLE[size_t(op)].arg_types; const auto& arg_types = META_TABLE[size_t(op)].arg_types;
return size_t(std::distance(arg_types.begin(), std::ranges::find(arg_types, Type::Void))); return size_t(std::distance(arg_types.begin(), std::ranges::find(arg_types, Type::Void)));
} }
extern u8 NUM_ARGS[532]; extern u8 NUM_ARGS[];
} // namespace Detail } // namespace Detail
/// Get return type of an opcode /// Get return type of an opcode