remove always_false
Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
b330117a14
commit
0f0103c9fb
7 changed files with 31 additions and 50 deletions
|
|
@ -17,7 +17,6 @@
|
||||||
#include "dynarmic/common/assert.h"
|
#include "dynarmic/common/assert.h"
|
||||||
#include <oaknut/oaknut.hpp>
|
#include <oaknut/oaknut.hpp>
|
||||||
|
|
||||||
#include "dynarmic/common/always_false.h"
|
|
||||||
|
|
||||||
namespace Dynarmic::Backend::Arm64 {
|
namespace Dynarmic::Backend::Arm64 {
|
||||||
|
|
||||||
|
|
@ -30,25 +29,25 @@ constexpr oaknut::XReg Xpagetable{24};
|
||||||
constexpr oaknut::XReg Xscratch0{16}, Xscratch1{17}, Xscratch2{30};
|
constexpr oaknut::XReg Xscratch0{16}, Xscratch1{17}, Xscratch2{30};
|
||||||
constexpr oaknut::WReg Wscratch0{16}, Wscratch1{17}, Wscratch2{30};
|
constexpr oaknut::WReg Wscratch0{16}, Wscratch1{17}, Wscratch2{30};
|
||||||
|
|
||||||
template<size_t bitsize>
|
template<size_t bitsize, typename T>
|
||||||
constexpr auto Rscratch0() {
|
constexpr T Rscratch0() {
|
||||||
if constexpr (bitsize == 32) {
|
if constexpr (bitsize == 32) {
|
||||||
return Wscratch0;
|
return Wscratch0;
|
||||||
} else if constexpr (bitsize == 64) {
|
} else if constexpr (bitsize == 64) {
|
||||||
return Xscratch0;
|
return Xscratch0;
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<bitsize>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<size_t bitsize>
|
template<size_t bitsize, typename T>
|
||||||
constexpr auto Rscratch1() {
|
constexpr T Rscratch1() {
|
||||||
if constexpr (bitsize == 32) {
|
if constexpr (bitsize == 32) {
|
||||||
return Wscratch1;
|
return Wscratch1;
|
||||||
} else if constexpr (bitsize == 64) {
|
} else if constexpr (bitsize == 64) {
|
||||||
return Xscratch1;
|
return Xscratch1;
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<bitsize>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
#include "dynarmic/backend/arm64/emit_context.h"
|
#include "dynarmic/backend/arm64/emit_context.h"
|
||||||
#include "dynarmic/backend/arm64/fpsr_manager.h"
|
#include "dynarmic/backend/arm64/fpsr_manager.h"
|
||||||
#include "dynarmic/backend/arm64/reg_alloc.h"
|
#include "dynarmic/backend/arm64/reg_alloc.h"
|
||||||
#include "dynarmic/common/always_false.h"
|
|
||||||
#include "dynarmic/ir/basic_block.h"
|
#include "dynarmic/ir/basic_block.h"
|
||||||
#include "dynarmic/ir/microinstruction.h"
|
#include "dynarmic/ir/microinstruction.h"
|
||||||
#include "dynarmic/ir/opcodes.h"
|
#include "dynarmic/ir/opcodes.h"
|
||||||
|
|
@ -43,7 +42,7 @@ static void EmitTwoOpArranged(oaknut::CodeGenerator& code, EmitContext& ctx, IR:
|
||||||
} else if constexpr (size == 64) {
|
} else if constexpr (size == 64) {
|
||||||
emit(Qresult->D2(), Qoperand->D2());
|
emit(Qresult->D2(), Qoperand->D2());
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<size>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -66,7 +65,7 @@ static void EmitTwoOpArrangedWiden(oaknut::CodeGenerator& code, EmitContext& ctx
|
||||||
} else if constexpr (size == 32) {
|
} else if constexpr (size == 32) {
|
||||||
emit(Qresult->D2(), Qoperand->toD().S2());
|
emit(Qresult->D2(), Qoperand->toD().S2());
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<size>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -81,7 +80,7 @@ static void EmitTwoOpArrangedNarrow(oaknut::CodeGenerator& code, EmitContext& ct
|
||||||
} else if constexpr (size == 64) {
|
} else if constexpr (size == 64) {
|
||||||
emit(Qresult->toD().S2(), Qoperand->D2());
|
emit(Qresult->toD().S2(), Qoperand->D2());
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<size>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -104,7 +103,7 @@ static void EmitTwoOpArrangedPairWiden(oaknut::CodeGenerator& code, EmitContext&
|
||||||
} else if constexpr (size == 32) {
|
} else if constexpr (size == 32) {
|
||||||
emit(Qresult->D2(), Qoperand->S4());
|
emit(Qresult->D2(), Qoperand->S4());
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<size>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -119,7 +118,7 @@ static void EmitTwoOpArrangedLower(oaknut::CodeGenerator& code, EmitContext& ctx
|
||||||
} else if constexpr (size == 32) {
|
} else if constexpr (size == 32) {
|
||||||
emit(Qresult->toD().S2(), Qoperand->toD().S2());
|
emit(Qresult->toD().S2(), Qoperand->toD().S2());
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<size>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -147,7 +146,7 @@ static void EmitThreeOpArranged(oaknut::CodeGenerator& code, EmitContext& ctx, I
|
||||||
} else if constexpr (size == 64) {
|
} else if constexpr (size == 64) {
|
||||||
emit(Qresult->D2(), Qa->D2(), Qb->D2());
|
emit(Qresult->D2(), Qa->D2(), Qb->D2());
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<size>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -172,7 +171,7 @@ static void EmitThreeOpArrangedWiden(oaknut::CodeGenerator& code, EmitContext& c
|
||||||
} else if constexpr (size == 64) {
|
} else if constexpr (size == 64) {
|
||||||
emit(Qresult->Q1(), Qa->toD().D1(), Qb->toD().D1());
|
emit(Qresult->Q1(), Qa->toD().D1(), Qb->toD().D1());
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<size>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -195,7 +194,7 @@ static void EmitThreeOpArrangedLower(oaknut::CodeGenerator& code, EmitContext& c
|
||||||
} else if constexpr (size == 32) {
|
} else if constexpr (size == 32) {
|
||||||
emit(Qresult->toD().S2(), Qa->toD().S2(), Qb->toD().S2());
|
emit(Qresult->toD().S2(), Qa->toD().S2(), Qb->toD().S2());
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<size>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -217,7 +216,7 @@ static void EmitSaturatedAccumulate(oaknut::CodeGenerator&, EmitContext& ctx, IR
|
||||||
} else if constexpr (size == 64) {
|
} else if constexpr (size == 64) {
|
||||||
emit(Qaccumulator->D2(), Qoperand->D2());
|
emit(Qaccumulator->D2(), Qoperand->D2());
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<size>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -238,7 +237,7 @@ static void EmitImmShift(oaknut::CodeGenerator&, EmitContext& ctx, IR::Inst* ins
|
||||||
} else if constexpr (size == 64) {
|
} else if constexpr (size == 64) {
|
||||||
emit(Qresult->D2(), Qoperand->D2(), shift_amount);
|
emit(Qresult->D2(), Qoperand->D2(), shift_amount);
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<size>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -266,7 +265,7 @@ static void EmitReduce(oaknut::CodeGenerator&, EmitContext& ctx, IR::Inst* inst,
|
||||||
} else if constexpr (size == 64) {
|
} else if constexpr (size == 64) {
|
||||||
emit(Vresult, Qoperand->D2());
|
emit(Vresult, Qoperand->D2());
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<size>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
#include "dynarmic/backend/arm64/emit_context.h"
|
#include "dynarmic/backend/arm64/emit_context.h"
|
||||||
#include "dynarmic/backend/arm64/fpsr_manager.h"
|
#include "dynarmic/backend/arm64/fpsr_manager.h"
|
||||||
#include "dynarmic/backend/arm64/reg_alloc.h"
|
#include "dynarmic/backend/arm64/reg_alloc.h"
|
||||||
#include "dynarmic/common/always_false.h"
|
|
||||||
#include "dynarmic/common/cast_util.h"
|
#include "dynarmic/common/cast_util.h"
|
||||||
#include "dynarmic/common/fp/fpcr.h"
|
#include "dynarmic/common/fp/fpcr.h"
|
||||||
#include "dynarmic/common/fp/fpsr.h"
|
#include "dynarmic/common/fp/fpsr.h"
|
||||||
|
|
@ -81,7 +80,7 @@ static void EmitTwoOpArranged(oaknut::CodeGenerator& code, EmitContext& ctx, IR:
|
||||||
} else if constexpr (size == 64) {
|
} else if constexpr (size == 64) {
|
||||||
emit(Qresult->D2(), Qa->D2());
|
emit(Qresult->D2(), Qa->D2());
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<size>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -109,7 +108,7 @@ static void EmitThreeOpArranged(oaknut::CodeGenerator& code, EmitContext& ctx, I
|
||||||
} else if constexpr (size == 64) {
|
} else if constexpr (size == 64) {
|
||||||
emit(Qresult->D2(), Qa->D2(), Qb->D2());
|
emit(Qresult->D2(), Qa->D2(), Qb->D2());
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<size>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -132,7 +131,7 @@ static void EmitFMA(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* ins
|
||||||
} else if constexpr (size == 64) {
|
} else if constexpr (size == 64) {
|
||||||
emit(Qresult->D2(), Qm->D2(), Qn->D2());
|
emit(Qresult->D2(), Qm->D2(), Qn->D2());
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<size>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -154,7 +153,7 @@ static void EmitFromFixed(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Ins
|
||||||
} else if constexpr (size == 64) {
|
} else if constexpr (size == 64) {
|
||||||
emit(Qto->D2(), Qfrom->D2(), fbits);
|
emit(Qto->D2(), Qfrom->D2(), fbits);
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<size>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -176,7 +175,7 @@ void EmitToFixed(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst)
|
||||||
} else if constexpr (fsize == 64) {
|
} else if constexpr (fsize == 64) {
|
||||||
return Qto->D2();
|
return Qto->D2();
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<fsize>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
}();
|
}();
|
||||||
auto Vfrom = [&] {
|
auto Vfrom = [&] {
|
||||||
|
|
@ -185,7 +184,7 @@ void EmitToFixed(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst)
|
||||||
} else if constexpr (fsize == 64) {
|
} else if constexpr (fsize == 64) {
|
||||||
return Qfrom->D2();
|
return Qfrom->D2();
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<fsize>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
}();
|
}();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
#include "dynarmic/backend/arm64/emit_context.h"
|
#include "dynarmic/backend/arm64/emit_context.h"
|
||||||
#include "dynarmic/backend/arm64/fpsr_manager.h"
|
#include "dynarmic/backend/arm64/fpsr_manager.h"
|
||||||
#include "dynarmic/backend/arm64/reg_alloc.h"
|
#include "dynarmic/backend/arm64/reg_alloc.h"
|
||||||
#include "dynarmic/common/always_false.h"
|
|
||||||
#include "dynarmic/ir/basic_block.h"
|
#include "dynarmic/ir/basic_block.h"
|
||||||
#include "dynarmic/ir/microinstruction.h"
|
#include "dynarmic/ir/microinstruction.h"
|
||||||
#include "dynarmic/ir/opcodes.h"
|
#include "dynarmic/ir/opcodes.h"
|
||||||
|
|
@ -39,7 +38,7 @@ static void Emit(oaknut::CodeGenerator&, EmitContext& ctx, IR::Inst* inst, EmitF
|
||||||
} else if constexpr (size == 64) {
|
} else if constexpr (size == 64) {
|
||||||
emit(Qresult->D2(), Qa->D2(), Qb->D2());
|
emit(Qresult->D2(), Qa->D2(), Qb->D2());
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<size>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@
|
||||||
#include "dynarmic/backend/arm64/emit_context.h"
|
#include "dynarmic/backend/arm64/emit_context.h"
|
||||||
#include "dynarmic/backend/arm64/fpsr_manager.h"
|
#include "dynarmic/backend/arm64/fpsr_manager.h"
|
||||||
#include "dynarmic/backend/arm64/verbose_debugging_output.h"
|
#include "dynarmic/backend/arm64/verbose_debugging_output.h"
|
||||||
#include "dynarmic/common/always_false.h"
|
|
||||||
|
|
||||||
namespace Dynarmic::Backend::Arm64 {
|
namespace Dynarmic::Backend::Arm64 {
|
||||||
|
|
||||||
|
|
@ -301,7 +300,7 @@ int RegAlloc::GenerateImmediate(const IR::Value& value) {
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<kind>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -370,7 +369,7 @@ int RegAlloc::RealizeReadImpl(const IR::Value& value) {
|
||||||
} else if constexpr (required_kind == HostLoc::Kind::Flags) {
|
} else if constexpr (required_kind == HostLoc::Kind::Flags) {
|
||||||
ASSERT_FALSE("A simple read from flags is likely a logic error.");
|
ASSERT_FALSE("A simple read from flags is likely a logic error.");
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<required_kind>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -395,7 +394,7 @@ int RegAlloc::RealizeWriteImpl(const IR::Inst* value) {
|
||||||
flags.SetupLocation(value);
|
flags.SetupLocation(value);
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<kind>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -416,7 +415,7 @@ int RegAlloc::RealizeReadWriteImpl(const IR::Value& read_value, const IR::Inst*
|
||||||
} else if constexpr (kind == HostLoc::Kind::Flags) {
|
} else if constexpr (kind == HostLoc::Kind::Flags) {
|
||||||
ASSERT_FALSE("Incorrect function for ReadWrite of flags");
|
ASSERT_FALSE("Incorrect function for ReadWrite of flags");
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<kind>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@
|
||||||
#include <mcl/mp/metavalue/lift_value.hpp>
|
#include <mcl/mp/metavalue/lift_value.hpp>
|
||||||
#include "dynarmic/common/common_types.h"
|
#include "dynarmic/common/common_types.h"
|
||||||
|
|
||||||
#include "dynarmic/common/always_false.h"
|
|
||||||
|
|
||||||
namespace Dynarmic::Backend::RV64 {
|
namespace Dynarmic::Backend::RV64 {
|
||||||
|
|
||||||
|
|
@ -164,7 +163,7 @@ u32 RegAlloc::GenerateImmediate(const IR::Value& value) {
|
||||||
} else if constexpr (kind == HostLoc::Kind::Fpr) {
|
} else if constexpr (kind == HostLoc::Kind::Fpr) {
|
||||||
UNIMPLEMENTED();
|
UNIMPLEMENTED();
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<kind>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -227,7 +226,7 @@ u32 RegAlloc::RealizeReadImpl(const IR::Value& value) {
|
||||||
fprs[new_location_index].realized = true;
|
fprs[new_location_index].realized = true;
|
||||||
return new_location_index;
|
return new_location_index;
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<required_kind>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -254,7 +253,7 @@ u32 RegAlloc::RealizeWriteImpl(const IR::Inst* value) {
|
||||||
setup_location(fprs[new_location_index]);
|
setup_location(fprs[new_location_index]);
|
||||||
return new_location_index;
|
return new_location_index;
|
||||||
} else {
|
} else {
|
||||||
static_assert(Common::always_false_v<mcl::mp::lift_value<required_kind>>);
|
static_assert(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
/* This file is part of the dynarmic project.
|
|
||||||
* Copyright (c) 2023 MerryMage
|
|
||||||
* SPDX-License-Identifier: 0BSD
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
namespace Dynarmic::Common {
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
inline constexpr bool always_false_v = false;
|
|
||||||
|
|
||||||
} // namespace Dynarmic::Common
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue