[icc] fix intel c++ compiler errors

This commit is contained in:
lizzie 2025-07-28 19:39:31 +01:00
parent 18942b7ee0
commit 0e58324f71
Signed by untrusted user: Lizzie
GPG key ID: D9E134A23AD395CE
9 changed files with 109 additions and 114 deletions

View file

@ -2,24 +2,22 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include <array>
#include <string_view>
#include "shader_recompiler/exception.h"
#include "shader_recompiler/frontend/maxwell/opcodes.h"
namespace Shader::Maxwell {
namespace {
constexpr std::array NAME_TABLE{
const char* NameOf(Opcode opcode) {
constexpr const char* NAME_TABLE[] = {
#define INST(name, cute, encode) cute,
#include "maxwell.inc"
#undef INST
};
} // Anonymous namespace
const char* NameOf(Opcode opcode) {
if (static_cast<size_t>(opcode) >= NAME_TABLE.size()) {
throw InvalidArgument("Invalid opcode with raw value {}", static_cast<int>(opcode));
}
return NAME_TABLE[static_cast<size_t>(opcode)];
};
if (size_t(opcode) >= sizeof(NAME_TABLE) / sizeof(NAME_TABLE[0]))
throw InvalidArgument("Invalid opcode with raw value {}", int(opcode));
return NAME_TABLE[size_t(opcode)];
}
} // namespace Shader::Maxwell