[icc] fix intel c++ compiler errors (#146)

Reviewed-on: #146
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
lizzie 2025-07-30 20:59:28 +02:00 committed by crueter
parent ff44444bda
commit 9e0e31132a
Signed by: crueter
GPG key ID: 425ACD2D4830EBC6
9 changed files with 125 additions and 114 deletions

View file

@ -1,3 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@ -165,8 +167,8 @@ Id EmitFPSaturate16(EmitContext& ctx, Id value) {
}
Id EmitFPSaturate32(EmitContext& ctx, Id value) {
const Id zero{ctx.Const(f32{0.0})};
const Id one{ctx.Const(f32{1.0})};
const Id zero{ctx.Const(f32{0.0f})};
const Id one{ctx.Const(f32{1.0f})};
return Clamp(ctx, ctx.F32[1], value, zero, one);
}

View file

@ -1,3 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@ -51,7 +53,8 @@ struct InstEncoding {
MaskValue mask_value;
Opcode opcode;
};
constexpr std::array UNORDERED_ENCODINGS{
constexpr auto SortedEncodings() {
std::array<InstEncoding, 279> encodings{
#define INST(name, cute, encode) \
InstEncoding{ \
.mask_value{MaskValueFromEncoding(encode)}, \
@ -59,10 +62,7 @@ constexpr std::array UNORDERED_ENCODINGS{
},
#include "maxwell.inc"
#undef INST
};
constexpr auto SortedEncodings() {
std::array encodings{UNORDERED_ENCODINGS};
};
std::ranges::sort(encodings, [](const InstEncoding& lhs, const InstEncoding& rhs) {
return std::popcount(lhs.mask_value.mask) > std::popcount(rhs.mask_value.mask);
});

View file

@ -1,25 +1,25 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// 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