diff --git a/src/dynarmic/src/dynarmic/backend/arm64/a32_interface.cpp b/src/dynarmic/src/dynarmic/backend/arm64/a32_interface.cpp index 904806c719..7e3b4aa9fd 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/a32_interface.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/a32_interface.cpp @@ -31,7 +31,7 @@ struct Jit::Impl final { , core(conf) {} HaltReason Run() { - ASSERT(!jit_interface->is_executing); + DEBUG_ASSERT(!jit_interface->is_executing); PerformRequestedCacheInvalidation(static_cast(Atomic::Load(&halt_reason))); jit_interface->is_executing = true; @@ -42,7 +42,7 @@ struct Jit::Impl final { } HaltReason Step() { - ASSERT(!jit_interface->is_executing); + DEBUG_ASSERT(!jit_interface->is_executing); PerformRequestedCacheInvalidation(static_cast(Atomic::Load(&halt_reason))); jit_interface->is_executing = true; diff --git a/src/dynarmic/src/dynarmic/backend/arm64/a64_interface.cpp b/src/dynarmic/src/dynarmic/backend/arm64/a64_interface.cpp index c1c589162c..76ff96ade9 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/a64_interface.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/a64_interface.cpp @@ -31,7 +31,7 @@ struct Jit::Impl final { , core(conf) {} HaltReason Run() { - ASSERT(!is_executing); + DEBUG_ASSERT(!is_executing); PerformRequestedCacheInvalidation(static_cast(Atomic::Load(&halt_reason))); is_executing = true; HaltReason hr = core.Run(current_address_space, current_state, &halt_reason); @@ -41,7 +41,7 @@ struct Jit::Impl final { } HaltReason Step() { - ASSERT(!is_executing); + DEBUG_ASSERT(!is_executing); PerformRequestedCacheInvalidation(static_cast(Atomic::Load(&halt_reason))); is_executing = true; HaltReason hr = core.Step(current_address_space, current_state, &halt_reason); diff --git a/src/dynarmic/src/dynarmic/backend/arm64/abi.h b/src/dynarmic/src/dynarmic/backend/arm64/abi.h index e22d7be346..be5d4e396b 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/abi.h +++ b/src/dynarmic/src/dynarmic/backend/arm64/abi.h @@ -57,7 +57,7 @@ constexpr RegisterList ToRegList(oaknut::Reg reg) { if (reg.is_vector()) { return RegisterList{1} << (reg.index() + 32); } - ASSERT(reg.index() != 31 && "ZR not allowed in reg list"); + DEBUG_ASSERT(reg.index() != 31 && "ZR not allowed in reg list"); if (reg.index() == -1) { return RegisterList{1} << 31; } diff --git a/src/dynarmic/src/dynarmic/backend/arm64/address_space.cpp b/src/dynarmic/src/dynarmic/backend/arm64/address_space.cpp index 947c50f4c3..15e4e4359b 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/address_space.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/address_space.cpp @@ -31,7 +31,7 @@ AddressSpace::AddressSpace(std::size_t code_cache_size) , code(mem.ptr(), mem.ptr()) , fastmem_manager(exception_handler) { - ASSERT(code_cache_size <= 128 * 1024 * 1024 && "code_cache_size > 128 MiB not currently supported"); + DEBUG_ASSERT(code_cache_size <= 128 * 1024 * 1024 && "code_cache_size > 128 MiB not currently supported"); exception_handler.Register(mem, code_cache_size); exception_handler.SetFastmemCallback([this](u64 host_pc) { @@ -115,9 +115,9 @@ EmittedBlockInfo AddressSpace::Emit(IR::Block block) { EmittedBlockInfo block_info = EmitArm64(code, std::move(block), GetEmitConfig(), fastmem_manager); - ASSERT(block_entries.insert({block.Location(), block_info.entry_point}).second); - ASSERT(reverse_block_entries.insert({block_info.entry_point, block.Location()}).second); - ASSERT(block_infos.insert({block_info.entry_point, block_info}).second); + DEBUG_ASSERT(block_entries.insert({block.Location(), block_info.entry_point}).second); + DEBUG_ASSERT(reverse_block_entries.insert({block_info.entry_point, block.Location()}).second); + DEBUG_ASSERT(block_infos.insert({block_info.entry_point, block_info}).second); Link(block_info); RelinkForDescriptor(block.Location(), block_info.entry_point); diff --git a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64.cpp b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64.cpp index 0330a9890c..377b329d5c 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64.cpp @@ -54,7 +54,7 @@ void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, } auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(args[0].IsImmediate()); + DEBUG_ASSERT(args[0].IsImmediate()); const IR::LocationDescriptor target{args[0].GetImmediateU64()}; code.LDR(Wscratch2, SP, offsetof(StackLayout, rsb_ptr)); @@ -71,19 +71,19 @@ void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, template<> void EmitIR(oaknut::CodeGenerator&, EmitContext& ctx, IR::Inst* inst) { [[maybe_unused]] auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(ctx.reg_alloc.WasValueDefined(inst)); + DEBUG_ASSERT(ctx.reg_alloc.WasValueDefined(inst)); } template<> void EmitIR(oaknut::CodeGenerator&, EmitContext& ctx, IR::Inst* inst) { [[maybe_unused]] auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(ctx.reg_alloc.WasValueDefined(inst)); + DEBUG_ASSERT(ctx.reg_alloc.WasValueDefined(inst)); } template<> void EmitIR(oaknut::CodeGenerator&, EmitContext& ctx, IR::Inst* inst) { [[maybe_unused]] auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(ctx.reg_alloc.WasValueDefined(inst)); + DEBUG_ASSERT(ctx.reg_alloc.WasValueDefined(inst)); } template<> @@ -149,13 +149,13 @@ void EmitIR(oaknut::CodeGenerator& code, EmitContext& c template<> void EmitIR(oaknut::CodeGenerator&, EmitContext& ctx, IR::Inst* inst) { [[maybe_unused]] auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(ctx.reg_alloc.WasValueDefined(inst)); + DEBUG_ASSERT(ctx.reg_alloc.WasValueDefined(inst)); } template<> void EmitIR(oaknut::CodeGenerator&, EmitContext& ctx, IR::Inst* inst) { [[maybe_unused]] auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(ctx.reg_alloc.WasValueDefined(inst)); + DEBUG_ASSERT(ctx.reg_alloc.WasValueDefined(inst)); } template<> @@ -206,9 +206,9 @@ EmittedBlockInfo EmitArm64(oaknut::CodeGenerator& code, IR::Block block, const E ebi.entry_point = code.xptr(); if (ctx.block.GetCondition() == IR::Cond::AL) { - ASSERT(!ctx.block.HasConditionFailedLocation()); + DEBUG_ASSERT(!ctx.block.HasConditionFailedLocation()); } else { - ASSERT(ctx.block.HasConditionFailedLocation()); + DEBUG_ASSERT(ctx.block.HasConditionFailedLocation()); oaknut::Label pass; pass = conf.emit_cond(code, ctx, ctx.block.GetCondition()); diff --git a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_a32.cpp b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_a32.cpp index b48ff057a7..c3c5e6b286 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_a32.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_a32.cpp @@ -234,7 +234,7 @@ void EmitIR(oaknut::CodeGenerator& code, EmitContext template<> void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { const A32::ExtReg reg = inst->GetArg(0).GetA32ExtRegRef(); - ASSERT(A32::IsSingleExtReg(reg)); + DEBUG_ASSERT(A32::IsSingleExtReg(reg)); const size_t index = static_cast(reg) - static_cast(A32::ExtReg::S0); auto Sresult = ctx.reg_alloc.WriteS(inst); @@ -248,7 +248,7 @@ void EmitIR(oaknut::CodeGenerator& code, E template<> void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { const A32::ExtReg reg = inst->GetArg(0).GetA32ExtRegRef(); - ASSERT(A32::IsDoubleExtReg(reg) || A32::IsQuadExtReg(reg)); + DEBUG_ASSERT(A32::IsDoubleExtReg(reg) || A32::IsQuadExtReg(reg)); if (A32::IsDoubleExtReg(reg)) { const size_t index = static_cast(reg) - static_cast(A32::ExtReg::D0); @@ -266,7 +266,7 @@ void EmitIR(oaknut::CodeGenerator& code, EmitContext& template<> void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { const A32::ExtReg reg = inst->GetArg(0).GetA32ExtRegRef(); - ASSERT(A32::IsDoubleExtReg(reg)); + DEBUG_ASSERT(A32::IsDoubleExtReg(reg)); const size_t index = static_cast(reg) - static_cast(A32::ExtReg::D0); auto Dresult = ctx.reg_alloc.WriteD(inst); @@ -294,7 +294,7 @@ void EmitIR(oaknut::CodeGenerator& code, EmitContext template<> void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { const A32::ExtReg reg = inst->GetArg(0).GetA32ExtRegRef(); - ASSERT(A32::IsSingleExtReg(reg)); + DEBUG_ASSERT(A32::IsSingleExtReg(reg)); const size_t index = static_cast(reg) - static_cast(A32::ExtReg::S0); auto args = ctx.reg_alloc.GetArgumentInfo(inst); @@ -309,7 +309,7 @@ void EmitIR(oaknut::CodeGenerator& code, E template<> void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { const A32::ExtReg reg = inst->GetArg(0).GetA32ExtRegRef(); - ASSERT(A32::IsDoubleExtReg(reg)); + DEBUG_ASSERT(A32::IsDoubleExtReg(reg)); const size_t index = static_cast(reg) - static_cast(A32::ExtReg::D0); auto args = ctx.reg_alloc.GetArgumentInfo(inst); @@ -324,7 +324,7 @@ void EmitIR(oaknut::CodeGenerator& code, E template<> void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { const A32::ExtReg reg = inst->GetArg(0).GetA32ExtRegRef(); - ASSERT(A32::IsDoubleExtReg(reg) || A32::IsQuadExtReg(reg)); + DEBUG_ASSERT(A32::IsDoubleExtReg(reg) || A32::IsQuadExtReg(reg)); auto args = ctx.reg_alloc.GetArgumentInfo(inst); if (A32::IsDoubleExtReg(reg)) { diff --git a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_data_processing.cpp b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_data_processing.cpp index 98faf60716..89ffc1f6c5 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_data_processing.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_data_processing.cpp @@ -194,8 +194,8 @@ void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, auto Xresult = ctx.reg_alloc.WriteX(inst); auto Xoperand = ctx.reg_alloc.ReadX(args[0]); RegAlloc::Realize(Xresult, Xoperand); - ASSERT(args[1].IsImmediate()); - ASSERT(args[1].GetImmediateU8() < 64); + DEBUG_ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].GetImmediateU8() < 64); code.UBFX(Xresult, Xoperand, args[1].GetImmediateU8(), 1); } @@ -893,9 +893,9 @@ static void EmitAddSub(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* if (overflow_inst) { // There is a limited set of circumstances where this is required, so assert for this. - ASSERT(!sub); - ASSERT(!nzcv_inst); - ASSERT(args[2].IsImmediate() && args[2].GetImmediateU1() == false); + DEBUG_ASSERT(!sub); + DEBUG_ASSERT(!nzcv_inst); + DEBUG_ASSERT(args[2].IsImmediate() && args[2].GetImmediateU1() == false); auto Rb = ctx.reg_alloc.ReadReg(args[1]); auto Woverflow = ctx.reg_alloc.WriteW(overflow_inst); @@ -1134,7 +1134,7 @@ static void EmitBitOp(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* i if constexpr (!std::is_same_v) { const auto nz_inst = inst->GetAssociatedPseudoOperation(IR::Opcode::GetNZFromOp); const auto nzcv_inst = inst->GetAssociatedPseudoOperation(IR::Opcode::GetNZCVFromOp); - ASSERT(!(nz_inst && nzcv_inst)); + DEBUG_ASSERT(!(nz_inst && nzcv_inst)); const auto flag_inst = nz_inst ? nz_inst : nzcv_inst; if (flag_inst) { @@ -1171,7 +1171,7 @@ template static void EmitAndNot(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { const auto nz_inst = inst->GetAssociatedPseudoOperation(IR::Opcode::GetNZFromOp); const auto nzcv_inst = inst->GetAssociatedPseudoOperation(IR::Opcode::GetNZCVFromOp); - ASSERT(!(nz_inst && nzcv_inst)); + DEBUG_ASSERT(!(nz_inst && nzcv_inst)); const auto flag_inst = nz_inst ? nz_inst : nzcv_inst; auto args = ctx.reg_alloc.GetArgumentInfo(inst); @@ -1402,7 +1402,7 @@ void EmitIR(oaknut::CodeGenerator& code, EmitCo template<> void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(args[2].IsImmediate()); + DEBUG_ASSERT(args[2].IsImmediate()); auto Wresult = ctx.reg_alloc.WriteW(inst); auto Wop1 = ctx.reg_alloc.ReadW(args[0]); @@ -1416,7 +1416,7 @@ void EmitIR(oaknut::CodeGenerator& code, EmitCont template<> void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(args[2].IsImmediate()); + DEBUG_ASSERT(args[2].IsImmediate()); auto Xresult = ctx.reg_alloc.WriteX(inst); auto Xop1 = ctx.reg_alloc.ReadX(args[0]); @@ -1430,7 +1430,7 @@ void EmitIR(oaknut::CodeGenerator& code, EmitCont template<> void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].IsImmediate()); auto Wresult = ctx.reg_alloc.WriteW(inst); auto Wvalue = ctx.reg_alloc.ReadW(args[0]); @@ -1444,7 +1444,7 @@ void EmitIR(oaknut::CodeGenerator& code, EmitContext template<> void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].IsImmediate()); auto Xresult = ctx.reg_alloc.WriteX(inst); auto Xvalue = ctx.reg_alloc.ReadX(args[0]); diff --git a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_floating_point.cpp b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_floating_point.cpp index 76a83ede93..8c0d4fe511 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_floating_point.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_floating_point.cpp @@ -68,7 +68,7 @@ static void EmitConvert(oaknut::CodeGenerator&, EmitContext& ctx, IR::Inst* inst RegAlloc::Realize(Vto, Vfrom); ctx.fpsr.Load(); - ASSERT(rounding_mode == ctx.FPCR().RMode()); + DEBUG_ASSERT(rounding_mode == ctx.FPCR().RMode()); emit(Vto, Vfrom); } @@ -106,8 +106,8 @@ static void EmitToFixed(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* } } } else { - ASSERT(fbits == 0); - ASSERT(bitsize_to != 16); + DEBUG_ASSERT(fbits == 0); + DEBUG_ASSERT(bitsize_to != 16); if constexpr (is_signed) { switch (rounding_mode) { case FP::RoundingMode::ToNearest_TieEven: @@ -449,7 +449,7 @@ void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx.fpsr.Load(); if (exact) { - ASSERT(ctx.FPCR().RMode() == rounding_mode); + DEBUG_ASSERT(ctx.FPCR().RMode() == rounding_mode); code.FRINTX(Sresult, Soperand); } else { switch (rounding_mode) { @@ -486,7 +486,7 @@ void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx.fpsr.Load(); if (exact) { - ASSERT(ctx.FPCR().RMode() == rounding_mode); + DEBUG_ASSERT(ctx.FPCR().RMode() == rounding_mode); code.FRINTX(Dresult, Doperand); } else { switch (rounding_mode) { diff --git a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_packed.cpp b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_packed.cpp index b9f13ac6f2..d41b0123d1 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_packed.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_packed.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + /* This file is part of the dynarmic project. * Copyright (c) 2022 MerryMage * SPDX-License-Identifier: 0BSD @@ -244,7 +247,7 @@ static void EmitPackedAddSub(oaknut::CodeGenerator& code, EmitContext& ctx, IR:: } if (ge_inst) { - ASSERT(!is_halving); + DEBUG_ASSERT(!is_halving); auto Vge = ctx.reg_alloc.WriteD(ge_inst); RegAlloc::Realize(Vge); diff --git a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_saturation.cpp b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_saturation.cpp index 93bafbf884..d9b16e3522 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_saturation.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_saturation.cpp @@ -24,7 +24,7 @@ using namespace oaknut::util; template<> void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { const auto overflow_inst = inst->GetAssociatedPseudoOperation(IR::Opcode::GetOverflowFromOp); - ASSERT(overflow_inst); + DEBUG_ASSERT(overflow_inst); auto args = ctx.reg_alloc.GetArgumentInfo(inst); auto Wresult = ctx.reg_alloc.WriteW(inst); @@ -44,7 +44,7 @@ void EmitIR(oaknut::CodeGenerator& cod template<> void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { const auto overflow_inst = inst->GetAssociatedPseudoOperation(IR::Opcode::GetOverflowFromOp); - ASSERT(overflow_inst); + DEBUG_ASSERT(overflow_inst); auto args = ctx.reg_alloc.GetArgumentInfo(inst); auto Wresult = ctx.reg_alloc.WriteW(inst); @@ -67,7 +67,7 @@ void EmitIR(oaknut::CodeGenerator& code, EmitConte auto args = ctx.reg_alloc.GetArgumentInfo(inst); const std::size_t N = args[1].GetImmediateU8(); - ASSERT(N >= 1 && N <= 32); + DEBUG_ASSERT(N >= 1 && N <= 32); if (N == 32) { ctx.reg_alloc.DefineAsExisting(inst, args[0]); @@ -113,7 +113,7 @@ void EmitIR(oaknut::CodeGenerator& code, EmitCon ctx.reg_alloc.SpillFlags(); const std::size_t N = args[1].GetImmediateU8(); - ASSERT(N <= 31); + DEBUG_ASSERT(N <= 31); const u32 saturated_value = (1u << N) - 1; code.MOV(Wscratch0, saturated_value); diff --git a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_vector.cpp b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_vector.cpp index d575cd66ee..cbd64858ca 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_vector.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_vector.cpp @@ -275,7 +275,7 @@ static void EmitReduce(oaknut::CodeGenerator&, EmitContext& ctx, IR::Inst* inst, template static void EmitGetElement(oaknut::CodeGenerator&, EmitContext& ctx, IR::Inst* inst, EmitFn emit) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].IsImmediate()); const u8 index = args[1].GetImmediateU8(); auto Rresult = ctx.reg_alloc.WriteReg(32, size)>(inst); @@ -310,7 +310,7 @@ void EmitIR(oaknut::CodeGenerator& code, EmitCon template static void EmitSetElement(oaknut::CodeGenerator&, EmitContext& ctx, IR::Inst* inst, EmitFn emit) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].IsImmediate()); const u8 index = args[1].GetImmediateU8(); auto Qvector = ctx.reg_alloc.ReadWriteQ(args[0], inst); @@ -650,7 +650,7 @@ void EmitIR(oaknut::CodeGenerator& code, EmitContext& auto Qa = ctx.reg_alloc.ReadQ(args[0]); auto Qb = ctx.reg_alloc.ReadQ(args[1]); const u8 position = args[2].GetImmediateU8(); - ASSERT(position % 8 == 0); + DEBUG_ASSERT(position % 8 == 0); RegAlloc::Realize(Qresult, Qa, Qb); code.EXT(Qresult->B16(), Qa->B16(), Qb->B16(), position / 8); @@ -663,7 +663,7 @@ void EmitIR(oaknut::CodeGenerator& code, EmitCon auto Da = ctx.reg_alloc.ReadD(args[0]); auto Db = ctx.reg_alloc.ReadD(args[1]); const u8 position = args[2].GetImmediateU8(); - ASSERT(position % 8 == 0); + DEBUG_ASSERT(position % 8 == 0); RegAlloc::Realize(Dresult, Da, Db); code.EXT(Dresult->B8(), Da->B8(), Db->B8(), position / 8); @@ -958,7 +958,7 @@ void EmitIR(oaknut::CodeGenerator& code, EmitConte template<> void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { - ASSERT(ctx.conf.very_verbose_debugging_output && "VectorMultiply64 is for debugging only"); + DEBUG_ASSERT(ctx.conf.very_verbose_debugging_output && "VectorMultiply64 is for debugging only"); EmitThreeOp(code, ctx, inst, [&](auto& Qresult, auto& Qa, auto& Qb) { code.FMOV(Xscratch0, Qa->toD()); code.FMOV(Xscratch1, Qb->toD()); @@ -1289,7 +1289,7 @@ void EmitIR(oaknut::CodeGenerator& code, EmitCont template<> void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { EmitImmShift<8>(code, ctx, inst, [&](auto Vresult, auto Voperand, u8 shift_amount) { - ASSERT(shift_amount % 8 == 0); + DEBUG_ASSERT(shift_amount % 8 == 0); const u8 ext_imm = (shift_amount % 128) / 8; code.EXT(Vresult, Voperand, Voperand, ext_imm); }); @@ -1602,12 +1602,12 @@ void EmitIR(oaknut::CodeGenerator& code, EmitContext& c template<> void EmitIR(oaknut::CodeGenerator&, EmitContext&, IR::Inst* inst) { // Do nothing. We *want* to hold on to the refcount for our arguments, so VectorTableLookup can use our arguments. - ASSERT(inst->UseCount() == 1 && "Table cannot be used multiple times"); + DEBUG_ASSERT(inst->UseCount() == 1 && "Table cannot be used multiple times"); } template<> void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { - ASSERT(inst->GetArg(1).GetInst()->GetOpcode() == IR::Opcode::VectorTable); + DEBUG_ASSERT(inst->GetArg(1).GetInst()->GetOpcode() == IR::Opcode::VectorTable); auto args = ctx.reg_alloc.GetArgumentInfo(inst); auto table = ctx.reg_alloc.GetArgumentInfo(inst->GetArg(1).GetInst()); @@ -1674,7 +1674,7 @@ void EmitIR(oaknut::CodeGenerator& code, EmitCo template<> void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { - ASSERT(inst->GetArg(1).GetInst()->GetOpcode() == IR::Opcode::VectorTable); + DEBUG_ASSERT(inst->GetArg(1).GetInst()->GetOpcode() == IR::Opcode::VectorTable); auto args = ctx.reg_alloc.GetArgumentInfo(inst); auto table = ctx.reg_alloc.GetArgumentInfo(inst->GetArg(1).GetInst()); diff --git a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_vector_floating_point.cpp b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_vector_floating_point.cpp index cdc64d996e..6268216777 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_vector_floating_point.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_vector_floating_point.cpp @@ -139,7 +139,7 @@ static void EmitFromFixed(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Ins const u8 fbits = args[1].GetImmediateU8(); const FP::RoundingMode rounding_mode = static_cast(args[2].GetImmediateU8()); const bool fpcr_controlled = args[3].GetImmediateU1(); - ASSERT(rounding_mode == ctx.FPCR(fpcr_controlled).RMode()); + DEBUG_ASSERT(rounding_mode == ctx.FPCR(fpcr_controlled).RMode()); RegAlloc::Realize(Qto, Qfrom); MaybeStandardFPSCRValue(code, ctx, fpcr_controlled, [&] { @@ -199,7 +199,7 @@ void EmitToFixed(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) } } } else { - ASSERT(fbits == 0); + DEBUG_ASSERT(fbits == 0); if constexpr (is_signed) { switch (rounding_mode) { case FP::RoundingMode::ToNearest_TieEven: @@ -346,7 +346,7 @@ template<> void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); const auto rounding_mode = static_cast(args[1].GetImmediateU8()); - ASSERT(rounding_mode == FP::RoundingMode::ToNearest_TieEven); + DEBUG_ASSERT(rounding_mode == FP::RoundingMode::ToNearest_TieEven); const bool fpcr_controlled = args[2].GetImmediateU1(); auto Qresult = ctx.reg_alloc.WriteQ(inst); @@ -617,7 +617,7 @@ void EmitIR(oaknut::CodeGenerator& code, EmitCon MaybeStandardFPSCRValue(code, ctx, fpcr_controlled, [&] { if (exact) { - ASSERT(ctx.FPCR(fpcr_controlled).RMode() == rounding_mode); + DEBUG_ASSERT(ctx.FPCR(fpcr_controlled).RMode() == rounding_mode); code.FRINTX(Qresult->S4(), Qoperand->S4()); } else { switch (rounding_mode) { @@ -657,7 +657,7 @@ void EmitIR(oaknut::CodeGenerator& code, EmitCon MaybeStandardFPSCRValue(code, ctx, fpcr_controlled, [&] { if (exact) { - ASSERT(ctx.FPCR(fpcr_controlled).RMode() == rounding_mode); + DEBUG_ASSERT(ctx.FPCR(fpcr_controlled).RMode() == rounding_mode); code.FRINTX(Qresult->D2(), Qoperand->D2()); } else { switch (rounding_mode) { @@ -743,7 +743,7 @@ template<> void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); const auto rounding_mode = static_cast(args[1].GetImmediateU8()); - ASSERT(rounding_mode == FP::RoundingMode::ToNearest_TieEven); + DEBUG_ASSERT(rounding_mode == FP::RoundingMode::ToNearest_TieEven); const bool fpcr_controlled = args[2].GetImmediateU1(); auto Dresult = ctx.reg_alloc.WriteD(inst); diff --git a/src/dynarmic/src/dynarmic/backend/arm64/reg_alloc.cpp b/src/dynarmic/src/dynarmic/backend/arm64/reg_alloc.cpp index b7ab55139b..b410bd2431 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/reg_alloc.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/reg_alloc.cpp @@ -53,19 +53,19 @@ bool Argument::GetImmediateU1() const { u8 Argument::GetImmediateU8() const { const u64 imm = value.GetImmediateAsU64(); - ASSERT(imm < 0x100); + DEBUG_ASSERT(imm < 0x100); return u8(imm); } u16 Argument::GetImmediateU16() const { const u64 imm = value.GetImmediateAsU64(); - ASSERT(imm < 0x10000); + DEBUG_ASSERT(imm < 0x10000); return u16(imm); } u32 Argument::GetImmediateU32() const { const u64 imm = value.GetImmediateAsU64(); - ASSERT(imm < 0x100000000); + DEBUG_ASSERT(imm < 0x100000000); return u32(imm); } @@ -74,12 +74,12 @@ u64 Argument::GetImmediateU64() const { } IR::Cond Argument::GetImmediateCond() const { - ASSERT(IsImmediate() && GetType() == IR::Type::Cond); + DEBUG_ASSERT(IsImmediate() && GetType() == IR::Type::Cond); return value.GetCond(); } IR::AccType Argument::GetImmediateAccType() const { - ASSERT(IsImmediate() && GetType() == IR::Type::AccType); + DEBUG_ASSERT(IsImmediate() && GetType() == IR::Type::AccType); return value.GetAccType(); } @@ -92,12 +92,12 @@ bool HostLocInfo::Contains(const IR::Inst* value) const { } void HostLocInfo::SetupScratchLocation() { - ASSERT(IsCompletelyEmpty()); + DEBUG_ASSERT(IsCompletelyEmpty()); realized = true; } void HostLocInfo::SetupLocation(const IR::Inst* value) { - ASSERT(IsCompletelyEmpty()); + DEBUG_ASSERT(IsCompletelyEmpty()); values.clear(); values.push_back(value); realized = true; @@ -135,7 +135,7 @@ RegAlloc::ArgumentInfo RegAlloc::GetArgumentInfo(IR::Inst* inst) { const IR::Value arg = inst->GetArg(i); ret[i].value = arg; if (!arg.IsImmediate() && !IsValuelessType(arg.GetType())) { - ASSERT(ValueLocation(arg.GetInst()) && "argument must already been defined"); + DEBUG_ASSERT(ValueLocation(arg.GetInst()) && "argument must already been defined"); ValueInfo(arg.GetInst()).uses_this_inst++; } } @@ -174,11 +174,11 @@ void RegAlloc::PrepareForCall(std::optional arg0, for (int i = 0; i < 4; i++) { if (args[i]) { if (args[i]->get().GetType() == IR::Type::U128) { - ASSERT(fprs[nsrn].IsCompletelyEmpty()); + DEBUG_ASSERT(fprs[nsrn].IsCompletelyEmpty()); LoadCopyInto(args[i]->get().value, oaknut::QReg{nsrn}); nsrn++; } else { - ASSERT(gprs[ngrn].IsCompletelyEmpty()); + DEBUG_ASSERT(gprs[ngrn].IsCompletelyEmpty()); LoadCopyInto(args[i]->get().value, oaknut::XReg{ngrn}); ngrn++; } @@ -192,7 +192,7 @@ void RegAlloc::PrepareForCall(std::optional arg0, void RegAlloc::DefineAsExisting(IR::Inst* inst, Argument& arg) { defined_insts.insert(inst); - ASSERT(!ValueLocation(inst)); + DEBUG_ASSERT(!ValueLocation(inst)); if (arg.value.IsImmediate()) { inst->ReplaceUsesWith(arg.value); @@ -206,9 +206,9 @@ void RegAlloc::DefineAsExisting(IR::Inst* inst, Argument& arg) { void RegAlloc::DefineAsRegister(IR::Inst* inst, oaknut::Reg reg) { defined_insts.insert(inst); - ASSERT(!ValueLocation(inst)); + DEBUG_ASSERT(!ValueLocation(inst)); auto& info = reg.is_vector() ? fprs[reg.index()] : gprs[reg.index()]; - ASSERT(info.IsCompletelyEmpty()); + DEBUG_ASSERT(info.IsCompletelyEmpty()); info.values.push_back(inst); info.expected_uses += inst->UseCount(); } @@ -228,18 +228,18 @@ void RegAlloc::UpdateAllUses() { void RegAlloc::AssertAllUnlocked() const { const auto is_unlocked = [](const auto& i) { return !i.locked && !i.realized; }; - ASSERT(std::all_of(gprs.begin(), gprs.end(), is_unlocked)); - ASSERT(std::all_of(fprs.begin(), fprs.end(), is_unlocked)); - ASSERT(is_unlocked(flags)); - ASSERT(std::all_of(spills.begin(), spills.end(), is_unlocked)); + DEBUG_ASSERT(std::all_of(gprs.begin(), gprs.end(), is_unlocked)); + DEBUG_ASSERT(std::all_of(fprs.begin(), fprs.end(), is_unlocked)); + DEBUG_ASSERT(is_unlocked(flags)); + DEBUG_ASSERT(std::all_of(spills.begin(), spills.end(), is_unlocked)); } void RegAlloc::AssertNoMoreUses() const { const auto is_empty = [](const auto& i) { return i.IsCompletelyEmpty(); }; - ASSERT(std::all_of(gprs.begin(), gprs.end(), is_empty)); - ASSERT(std::all_of(fprs.begin(), fprs.end(), is_empty)); - ASSERT(is_empty(flags)); - ASSERT(std::all_of(spills.begin(), spills.end(), is_empty)); + DEBUG_ASSERT(std::all_of(gprs.begin(), gprs.end(), is_empty)); + DEBUG_ASSERT(std::all_of(fprs.begin(), fprs.end(), is_empty)); + DEBUG_ASSERT(is_empty(flags)); + DEBUG_ASSERT(std::all_of(spills.begin(), spills.end(), is_empty)); } void RegAlloc::EmitVerboseDebuggingOutput() { @@ -271,7 +271,7 @@ void RegAlloc::EmitVerboseDebuggingOutput() { template int RegAlloc::GenerateImmediate(const IR::Value& value) { - ASSERT(value.GetType() != IR::Type::U1); + DEBUG_ASSERT(value.GetType() != IR::Type::U1); if constexpr (kind == HostLoc::Kind::Gpr) { const int new_location_index = AllocateRegister(gprs, gpr_order); SpillGpr(new_location_index); @@ -309,15 +309,15 @@ int RegAlloc::RealizeReadImpl(const IR::Value& value) { } const auto current_location = ValueLocation(value.GetInst()); - ASSERT(current_location); + DEBUG_ASSERT(current_location); if (current_location->kind == required_kind) { ValueInfo(*current_location).realized = true; return current_location->index; } - ASSERT(!bool(ValueInfo(*current_location).realized)); - ASSERT(bool(ValueInfo(*current_location).locked)); + DEBUG_ASSERT(!bool(ValueInfo(*current_location).realized)); + DEBUG_ASSERT(bool(ValueInfo(*current_location).locked)); if constexpr (required_kind == HostLoc::Kind::Gpr) { const int new_location_index = AllocateRegister(gprs, gpr_order); @@ -328,7 +328,7 @@ int RegAlloc::RealizeReadImpl(const IR::Value& value) { UNREACHABLE(); //logic error case HostLoc::Kind::Fpr: code.FMOV(oaknut::XReg{new_location_index}, oaknut::DReg{current_location->index}); - // ASSERT size fits + // DEBUG_ASSERT size fits break; case HostLoc::Kind::Spill: code.LDR(oaknut::XReg{new_location_index}, SP, spill_offset + current_location->index * spill_slot_size); @@ -355,7 +355,7 @@ int RegAlloc::RealizeReadImpl(const IR::Value& value) { code.LDR(oaknut::QReg{new_location_index}, SP, spill_offset + current_location->index * spill_slot_size); break; case HostLoc::Kind::Flags: - ASSERT(false && "Moving from flags into fprs is not currently supported"); + DEBUG_ASSERT(false && "Moving from flags into fprs is not currently supported"); break; } @@ -372,7 +372,7 @@ int RegAlloc::RealizeReadImpl(const IR::Value& value) { template int RegAlloc::RealizeWriteImpl(const IR::Inst* value) { defined_insts.insert(value); - ASSERT(!ValueLocation(value)); + DEBUG_ASSERT(!ValueLocation(value)); if constexpr (kind == HostLoc::Kind::Gpr) { const int new_location_index = AllocateRegister(gprs, gpr_order); @@ -407,7 +407,7 @@ int RegAlloc::RealizeReadWriteImpl(const IR::Value& read_value, const IR::Inst* LoadCopyInto(read_value, oaknut::QReg{write_loc}); return write_loc; } else if constexpr (kind == HostLoc::Kind::Flags) { - ASSERT(false && "Incorrect function for ReadWrite of flags"); + DEBUG_ASSERT(false && "Incorrect function for ReadWrite of flags"); } else { UNREACHABLE(); } @@ -439,7 +439,7 @@ int RegAlloc::AllocateRegister(const std::array& regs, const st } void RegAlloc::SpillGpr(int index) { - ASSERT(!gprs[index].locked && !gprs[index].realized); + DEBUG_ASSERT(!gprs[index].locked && !gprs[index].realized); if (gprs[index].values.empty()) { return; } @@ -449,7 +449,7 @@ void RegAlloc::SpillGpr(int index) { } void RegAlloc::SpillFpr(int index) { - ASSERT(!fprs[index].locked && !fprs[index].realized); + DEBUG_ASSERT(!fprs[index].locked && !fprs[index].realized); if (fprs[index].values.empty()) { return; } @@ -461,7 +461,7 @@ void RegAlloc::SpillFpr(int index) { void RegAlloc::ReadWriteFlags(Argument& read, IR::Inst* write) { defined_insts.insert(write); const auto current_location = ValueLocation(read.value.GetInst()); - ASSERT(current_location); + DEBUG_ASSERT(current_location); if (current_location->kind == HostLoc::Kind::Flags) { if (!flags.IsOneRemainingUse()) { @@ -489,7 +489,7 @@ void RegAlloc::ReadWriteFlags(Argument& read, IR::Inst* write) { } void RegAlloc::SpillFlags() { - ASSERT(!flags.locked && !flags.realized); + DEBUG_ASSERT(!flags.locked && !flags.realized); if (flags.values.empty()) { return; } @@ -501,7 +501,7 @@ void RegAlloc::SpillFlags() { int RegAlloc::FindFreeSpill() const { const auto iter = std::find_if(spills.begin(), spills.end(), [](const HostLocInfo& info) { return info.values.empty(); }); - ASSERT(iter != spills.end() && "All spill locations are full"); + DEBUG_ASSERT(iter != spills.end() && "All spill locations are full"); return static_cast(iter - spills.begin()); } @@ -512,14 +512,14 @@ void RegAlloc::LoadCopyInto(const IR::Value& value, oaknut::XReg reg) { } const auto current_location = ValueLocation(value.GetInst()); - ASSERT(current_location); + DEBUG_ASSERT(current_location); switch (current_location->kind) { case HostLoc::Kind::Gpr: code.MOV(reg, oaknut::XReg{current_location->index}); break; case HostLoc::Kind::Fpr: code.FMOV(reg, oaknut::DReg{current_location->index}); - // ASSERT size fits + // DEBUG_ASSERT size fits break; case HostLoc::Kind::Spill: code.LDR(reg, SP, spill_offset + current_location->index * spill_slot_size); @@ -538,7 +538,7 @@ void RegAlloc::LoadCopyInto(const IR::Value& value, oaknut::QReg reg) { } const auto current_location = ValueLocation(value.GetInst()); - ASSERT(current_location); + DEBUG_ASSERT(current_location); switch (current_location->kind) { case HostLoc::Kind::Gpr: code.FMOV(reg.toD(), oaknut::XReg{current_location->index}); diff --git a/src/dynarmic/src/dynarmic/backend/exception_handler_macos.cpp b/src/dynarmic/src/dynarmic/backend/exception_handler_macos.cpp index fc627f60b2..473edb0c24 100644 --- a/src/dynarmic/src/dynarmic/backend/exception_handler_macos.cpp +++ b/src/dynarmic/src/dynarmic/backend/exception_handler_macos.cpp @@ -87,7 +87,10 @@ private: }; MachHandler::MachHandler() { -#define KCHECK(x) ASSERT((x) == KERN_SUCCESS && "init failure at " #x) +#define KCHECK(x) do { \ + auto r = (x); \ + DEBUG_ASSERT(r == KERN_SUCCESS && "init failure at " #x); \ + } while (0); \ KCHECK(mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &server_port)); KCHECK(mach_port_insert_right(mach_task_self(), server_port, server_port, MACH_MSG_TYPE_MAKE_SEND)); KCHECK(task_set_exception_ports(mach_task_self(), EXC_MASK_BAD_ACCESS, server_port, EXCEPTION_STATE | MACH_EXCEPTION_CODES, THREAD_STATE)); diff --git a/src/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp b/src/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp index 24a059aee2..6353b8a23a 100644 --- a/src/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp +++ b/src/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp @@ -138,7 +138,7 @@ void SigHandler::SigAction(int sig, siginfo_t* info, void* raw_context) { #elif defined(ARCHITECTURE_loongarch64) CTX_PC = fc.call_pc; #else - ASSERT(false); + DEBUG_ASSERT(false); #endif return; } diff --git a/src/dynarmic/src/dynarmic/backend/loongarch64/a32_address_space.cpp b/src/dynarmic/src/dynarmic/backend/loongarch64/a32_address_space.cpp index f1a7d55d2c..a7635bff02 100644 --- a/src/dynarmic/src/dynarmic/backend/loongarch64/a32_address_space.cpp +++ b/src/dynarmic/src/dynarmic/backend/loongarch64/a32_address_space.cpp @@ -115,7 +115,7 @@ void A32AddressSpace::Link(EmittedBlockInfo& block_info) { break; } default: - ASSERT(false && "Invalid relocation target"); + DEBUG_ASSERT(false && "Invalid relocation target"); } } } diff --git a/src/dynarmic/src/dynarmic/backend/loongarch64/a32_interface.cpp b/src/dynarmic/src/dynarmic/backend/loongarch64/a32_interface.cpp index 93ad34017a..d073fa959a 100644 --- a/src/dynarmic/src/dynarmic/backend/loongarch64/a32_interface.cpp +++ b/src/dynarmic/src/dynarmic/backend/loongarch64/a32_interface.cpp @@ -25,7 +25,7 @@ struct Jit::Impl final { , current_address_space(conf) {} HaltReason Run() { - ASSERT(!jit_interface->is_executing); + DEBUG_ASSERT(!jit_interface->is_executing); jit_interface->is_executing = true; const auto location_descriptor = current_state.GetLocationDescriptor(); @@ -38,7 +38,7 @@ struct Jit::Impl final { } HaltReason Step() { - ASSERT(!jit_interface->is_executing); + DEBUG_ASSERT(!jit_interface->is_executing); jit_interface->is_executing = true; const auto location_descriptor = A32::LocationDescriptor{current_state.GetLocationDescriptor()}.SetSingleStepping(true); diff --git a/src/dynarmic/src/dynarmic/backend/loongarch64/code_block.h b/src/dynarmic/src/dynarmic/backend/loongarch64/code_block.h index 133d748c41..5eb6c8550a 100644 --- a/src/dynarmic/src/dynarmic/backend/loongarch64/code_block.h +++ b/src/dynarmic/src/dynarmic/backend/loongarch64/code_block.h @@ -20,7 +20,7 @@ public: explicit CodeBlock(std::size_t size) noexcept : memsize(size) { mem = static_cast(mmap(nullptr, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANON | MAP_PRIVATE, -1, 0)); - ASSERT(mem != MAP_FAILED); + DEBUG_ASSERT(mem != MAP_FAILED); la_init_assembler(&as, mem, size); } diff --git a/src/dynarmic/src/dynarmic/backend/loongarch64/emit_loongarch64.cpp b/src/dynarmic/src/dynarmic/backend/loongarch64/emit_loongarch64.cpp index 35b3640a1d..a158ba6b43 100644 --- a/src/dynarmic/src/dynarmic/backend/loongarch64/emit_loongarch64.cpp +++ b/src/dynarmic/src/dynarmic/backend/loongarch64/emit_loongarch64.cpp @@ -16,7 +16,7 @@ namespace Dynarmic::Backend::LoongArch64 { template void EmitIR(lagoon_assembler_t&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented opcode"); + DEBUG_ASSERT(false && "Unimplemented opcode"); } template<> @@ -36,7 +36,7 @@ void EmitIR(lagoon_assembler_t&, EmitContext& ct template<> void EmitIR(lagoon_assembler_t&, EmitContext& ctx, IR::Inst* inst) { - ASSERT(ctx.reg_alloc.IsValueLive(inst)); + DEBUG_ASSERT(ctx.reg_alloc.IsValueLive(inst)); } template<> @@ -98,7 +98,7 @@ EmittedBlockInfo EmitLoongArch64(lagoon_assembler_t& as, IR::Block block, const const auto term = block.GetTerminal(); const IR::Term::LeafTerminal* leaft_term = std::get_if(&term); const IR::Term::LinkBlock* link_block_term = std::get_if(leaft_term); - ASSERT(link_block_term); + DEBUG_ASSERT(link_block_term); la_load_immediate64(&as, Xscratch0, link_block_term->next.Value()); la_st_w(&as, Xscratch0, Xstate, static_cast(offsetof(A32JitState, regs) + sizeof(u32) * 15)); diff --git a/src/dynarmic/src/dynarmic/backend/loongarch64/emit_loongarch64_a32.cpp b/src/dynarmic/src/dynarmic/backend/loongarch64/emit_loongarch64_a32.cpp index 7ecadbec90..9e7ab06c73 100644 --- a/src/dynarmic/src/dynarmic/backend/loongarch64/emit_loongarch64_a32.cpp +++ b/src/dynarmic/src/dynarmic/backend/loongarch64/emit_loongarch64_a32.cpp @@ -41,7 +41,7 @@ template<> void EmitIR(lagoon_assembler_t& as, EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(!args[0].IsImmediate() && !args[1].IsImmediate()); + DEBUG_ASSERT(!args[0].IsImmediate() && !args[1].IsImmediate()); auto Xnz = ctx.reg_alloc.ReadX(args[0]); auto Xc = ctx.reg_alloc.ReadX(args[1]); diff --git a/src/dynarmic/src/dynarmic/backend/loongarch64/emit_loongarch64_data_processing.cpp b/src/dynarmic/src/dynarmic/backend/loongarch64/emit_loongarch64_data_processing.cpp index 4f1683edcf..241a20f15a 100644 --- a/src/dynarmic/src/dynarmic/backend/loongarch64/emit_loongarch64_data_processing.cpp +++ b/src/dynarmic/src/dynarmic/backend/loongarch64/emit_loongarch64_data_processing.cpp @@ -22,8 +22,8 @@ void EmitIR(lagoon_assembler_t& as, EmitContext& auto& shift_arg = args[1]; auto& carry_arg = args[2]; - ASSERT(carry_inst != nullptr); - ASSERT(shift_arg.IsImmediate()); + DEBUG_ASSERT(carry_inst != nullptr); + DEBUG_ASSERT(shift_arg.IsImmediate()); auto Xresult = ctx.reg_alloc.WriteX(inst); auto Xcarry_out = ctx.reg_alloc.WriteX(carry_inst); diff --git a/src/dynarmic/src/dynarmic/backend/loongarch64/reg_alloc.cpp b/src/dynarmic/src/dynarmic/backend/loongarch64/reg_alloc.cpp index 5ff7edb6a8..c01567f7ee 100644 --- a/src/dynarmic/src/dynarmic/backend/loongarch64/reg_alloc.cpp +++ b/src/dynarmic/src/dynarmic/backend/loongarch64/reg_alloc.cpp @@ -42,19 +42,19 @@ bool Argument::GetImmediateU1() const { u8 Argument::GetImmediateU8() const { const u64 imm = value.GetImmediateAsU64(); - ASSERT(imm < 0x100); + DEBUG_ASSERT(imm < 0x100); return u8(imm); } u16 Argument::GetImmediateU16() const { const u64 imm = value.GetImmediateAsU64(); - ASSERT(imm < 0x10000); + DEBUG_ASSERT(imm < 0x10000); return u16(imm); } u32 Argument::GetImmediateU32() const { const u64 imm = value.GetImmediateAsU64(); - ASSERT(imm < 0x100000000); + DEBUG_ASSERT(imm < 0x100000000); return u32(imm); } @@ -63,12 +63,12 @@ u64 Argument::GetImmediateU64() const { } IR::Cond Argument::GetImmediateCond() const { - ASSERT(IsImmediate() && GetType() == IR::Type::Cond); + DEBUG_ASSERT(IsImmediate() && GetType() == IR::Type::Cond); return value.GetCond(); } IR::AccType Argument::GetImmediateAccType() const { - ASSERT(IsImmediate() && GetType() == IR::Type::AccType); + DEBUG_ASSERT(IsImmediate() && GetType() == IR::Type::AccType); return value.GetAccType(); } @@ -77,7 +77,7 @@ bool HostLocInfo::Contains(const IR::Inst* value) const { } void HostLocInfo::SetupScratchLocation() { - ASSERT(IsCompletelyEmpty()); + DEBUG_ASSERT(IsCompletelyEmpty()); locked = 1; realized = true; } @@ -103,7 +103,7 @@ RegAlloc::ArgumentInfo RegAlloc::GetArgumentInfo(IR::Inst* inst) { const IR::Value arg = inst->GetArg(i); ret[i].value = arg; if (!arg.IsImmediate() && !IsValuelessType(arg.GetType())) { - ASSERT(ValueLocation(arg.GetInst()) && "argument must already been defined"); + DEBUG_ASSERT(ValueLocation(arg.GetInst()) && "argument must already been defined"); ValueInfo(arg.GetInst()).uses_this_inst++; } } @@ -121,7 +121,7 @@ void RegAlloc::UpdateAllUses() { } void RegAlloc::DefineAsExisting(IR::Inst* inst, Argument& arg) { - ASSERT(!ValueLocation(inst)); + DEBUG_ASSERT(!ValueLocation(inst)); if (arg.value.IsImmediate()) { inst->ReplaceUsesWith(arg.value); @@ -136,7 +136,7 @@ void RegAlloc::DefineAsExisting(IR::Inst* inst, Argument& arg) { void RegAlloc::AssertNoMoreUses() const { // TODO: Re-enable this assert once all register allocation issues are fixed // const auto is_empty = [](const auto& i) { return i.IsCompletelyEmpty(); }; - // ASSERT(std::all_of(hostloc_info.begin(), hostloc_info.end(), is_empty)); + // DEBUG_ASSERT(std::all_of(hostloc_info.begin(), hostloc_info.end(), is_empty)); } template @@ -151,7 +151,7 @@ u32 RegAlloc::GenerateImmediate(const IR::Value& value) { return new_location_index; } else if constexpr (kind == HostLoc::Kind::Fpr) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } else { UNREACHABLE(); } @@ -165,15 +165,15 @@ u32 RegAlloc::RealizeReadImpl(const IR::Value& value) { } const auto current_location = ValueLocation(value.GetInst()); - ASSERT(current_location); + DEBUG_ASSERT(current_location); if (current_location->kind == required_kind) { ValueInfo(*current_location).realized = true; return current_location->index; } - ASSERT(!ValueInfo(*current_location).realized); - ASSERT(!ValueInfo(*current_location).locked); + DEBUG_ASSERT(!ValueInfo(*current_location).realized); + DEBUG_ASSERT(!ValueInfo(*current_location).locked); if constexpr (required_kind == HostLoc::Kind::Gpr) { const u32 new_location_index = AllocateRegister(gpr_order, GprOffset); @@ -236,7 +236,7 @@ u32 RegAlloc::RealizeWriteImpl(const IR::Inst* value, HostLoc::Kind required_kin } } - ASSERT(!ValueLocation(value)); + DEBUG_ASSERT(!ValueLocation(value)); const auto setup_location = [&](HostLocInfo& info) { info = {}; @@ -277,7 +277,7 @@ u32 RegAlloc::AllocateRegister(const std::vector& order, size_t base_offset std::copy_if(order.begin(), order.end(), std::back_inserter(candidates), [&](u32 i) { return !hostloc_info[base_offset + i].locked; }); - ASSERT(!candidates.empty()); + DEBUG_ASSERT(!candidates.empty()); u32 best = candidates[0]; size_t min_lru = hostloc_info[base_offset + best].lru_counter; @@ -294,7 +294,7 @@ u32 RegAlloc::AllocateRegister(const std::vector& order, size_t base_offset void RegAlloc::SpillGpr(u32 index) { auto& gpr_info = hostloc_info[GprOffset + index]; - ASSERT(!gpr_info.locked && !gpr_info.realized); + DEBUG_ASSERT(!gpr_info.locked && !gpr_info.realized); if (gpr_info.values.empty()) { return; } @@ -306,7 +306,7 @@ void RegAlloc::SpillGpr(u32 index) { void RegAlloc::SpillFpr(u32 index) { auto& fpr_info = hostloc_info[FprOffset + index]; - ASSERT(!fpr_info.locked && !fpr_info.realized); + DEBUG_ASSERT(!fpr_info.locked && !fpr_info.realized); if (fpr_info.values.empty()) { return; } diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/a32_address_space.cpp b/src/dynarmic/src/dynarmic/backend/riscv64/a32_address_space.cpp index 490398931c..bba125612c 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/a32_address_space.cpp +++ b/src/dynarmic/src/dynarmic/backend/riscv64/a32_address_space.cpp @@ -94,7 +94,7 @@ void A32AddressSpace::EmitPrelude() { void A32AddressSpace::SetCursorPtr(CodePtr ptr) { ptrdiff_t offset = ptr - GetMemPtr(); - ASSERT(offset >= 0); + DEBUG_ASSERT(offset >= 0); as.RewindBuffer(offset); } diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/a32_interface.cpp b/src/dynarmic/src/dynarmic/backend/riscv64/a32_interface.cpp index ab3ee13f6b..63995976cf 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/a32_interface.cpp +++ b/src/dynarmic/src/dynarmic/backend/riscv64/a32_interface.cpp @@ -31,7 +31,7 @@ struct Jit::Impl final { , core(conf) {} HaltReason Run() { - ASSERT(!jit_interface->is_executing); + DEBUG_ASSERT(!jit_interface->is_executing); jit_interface->is_executing = true; HaltReason hr = core.Run(current_address_space, current_state, &halt_reason); RequestCacheInvalidation(); @@ -40,9 +40,9 @@ struct Jit::Impl final { } HaltReason Step() { - ASSERT(!jit_interface->is_executing); + DEBUG_ASSERT(!jit_interface->is_executing); jit_interface->is_executing = true; - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); RequestCacheInvalidation(); jit_interface->is_executing = false; return HaltReason{}; diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/a64_interface.cpp b/src/dynarmic/src/dynarmic/backend/riscv64/a64_interface.cpp index 67c4986109..3636e5221c 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/a64_interface.cpp +++ b/src/dynarmic/src/dynarmic/backend/riscv64/a64_interface.cpp @@ -28,12 +28,12 @@ struct Jit::Impl final { , jit_interface(jit_interface) {} HaltReason Run() { - ASSERT(false); + DEBUG_ASSERT(false); return HaltReason{}; } HaltReason Step() { - ASSERT(false); + DEBUG_ASSERT(false); return HaltReason{}; } @@ -51,7 +51,7 @@ struct Jit::Impl final { } void Reset() { - ASSERT(!is_executing); + DEBUG_ASSERT(!is_executing); //jit_state = {}; } diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/code_block.h b/src/dynarmic/src/dynarmic/backend/riscv64/code_block.h index 4917399f10..2938d1f272 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/code_block.h +++ b/src/dynarmic/src/dynarmic/backend/riscv64/code_block.h @@ -22,7 +22,7 @@ class CodeBlock { public: explicit CodeBlock(std::size_t size) noexcept : memsize(size) { mem = (u8*)mmap(nullptr, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANON | MAP_PRIVATE, -1, 0); - ASSERT(mem != nullptr); + DEBUG_ASSERT(mem != nullptr); } ~CodeBlock() noexcept { diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64.cpp b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64.cpp index 795ec4ca21..9c6feab55f 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64.cpp +++ b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64.cpp @@ -35,39 +35,39 @@ void EmitIR(biscuit::Assembler&, EmitContext& ctx, IR::Ins template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext& ctx, IR::Inst* inst) { [[maybe_unused]] auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(ctx.reg_alloc.IsValueLive(inst)); + DEBUG_ASSERT(ctx.reg_alloc.IsValueLive(inst)); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext& ctx, IR::Inst* inst) { [[maybe_unused]] auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(ctx.reg_alloc.IsValueLive(inst)); + DEBUG_ASSERT(ctx.reg_alloc.IsValueLive(inst)); } template<> @@ -87,12 +87,12 @@ void EmitIR(biscuit::Assembler& as, EmitContext& ctx, I template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> @@ -109,7 +109,7 @@ void EmitIR(biscuit::Assembler& as, EmitContext& c template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } EmittedBlockInfo EmitRV64(biscuit::Assembler& as, IR::Block block, const EmitConfig& emit_conf) { diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_a32.cpp b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_a32.cpp index 36709c7dbc..d3d574d933 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_a32.cpp +++ b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_a32.cpp @@ -228,7 +228,7 @@ void EmitA32Terminal(biscuit::Assembler& as, EmitContext& ctx) { template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> @@ -243,17 +243,17 @@ void EmitIR(biscuit::Assembler& as, EmitContext& ctx template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> @@ -272,27 +272,27 @@ void EmitIR(biscuit::Assembler& as, EmitContext& ctx template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> @@ -307,17 +307,17 @@ void EmitIR(biscuit::Assembler& as, EmitContext& ctx template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> @@ -325,7 +325,7 @@ void EmitIR(biscuit::Assembler& as, EmitContext& ctx, auto args = ctx.reg_alloc.GetArgumentInfo(inst); // TODO: Add full implementation - ASSERT(!args[0].IsImmediate() && !args[1].IsImmediate()); + DEBUG_ASSERT(!args[0].IsImmediate() && !args[1].IsImmediate()); auto Xnz = ctx.reg_alloc.ReadX(args[0]); auto Xc = ctx.reg_alloc.ReadX(args[1]); @@ -341,82 +341,82 @@ void EmitIR(biscuit::Assembler& as, EmitContext& ctx, template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } } // namespace Dynarmic::Backend::RV64 diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_a32_coprocessor.cpp b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_a32_coprocessor.cpp index b6a41f71b2..7f40fbb87a 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_a32_coprocessor.cpp +++ b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_a32_coprocessor.cpp @@ -22,37 +22,37 @@ namespace Dynarmic::Backend::RV64 { template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } } // namespace Dynarmic::Backend::RV64 diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_a32_memory.cpp b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_a32_memory.cpp index fa96d52e6e..0a58396178 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_a32_memory.cpp +++ b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_a32_memory.cpp @@ -22,87 +22,87 @@ namespace Dynarmic::Backend::RV64 { template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } } // namespace Dynarmic::Backend::RV64 diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_a64.cpp b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_a64.cpp index eed51547c6..291b50f1b1 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_a64.cpp +++ b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_a64.cpp @@ -22,182 +22,182 @@ namespace Dynarmic::Backend::RV64 { template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } } // namespace Dynarmic::Backend::RV64 diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_a64_memory.cpp b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_a64_memory.cpp index 84802837c5..1d28a0f099 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_a64_memory.cpp +++ b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_a64_memory.cpp @@ -22,107 +22,107 @@ namespace Dynarmic::Backend::RV64 { template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } } // namespace Dynarmic::Backend::RV64 diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_cryptography.cpp b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_cryptography.cpp index 44ebc2e3fc..8a05e77c1a 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_cryptography.cpp +++ b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_cryptography.cpp @@ -22,82 +22,82 @@ namespace Dynarmic::Backend::RV64 { template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } } // namespace Dynarmic::Backend::RV64 diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_data_processing.cpp b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_data_processing.cpp index d41433b12b..61d81b6192 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_data_processing.cpp +++ b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_data_processing.cpp @@ -22,67 +22,67 @@ namespace Dynarmic::Backend::RV64 { template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> @@ -95,8 +95,8 @@ void EmitIR(biscuit::Assembler& as, EmitContext& auto& carry_arg = args[2]; // TODO: Add full implementation - ASSERT(carry_inst != nullptr); - ASSERT(shift_arg.IsImmediate()); + DEBUG_ASSERT(carry_inst != nullptr); + DEBUG_ASSERT(shift_arg.IsImmediate()); auto Xresult = ctx.reg_alloc.WriteX(inst); auto Xcarry_out = ctx.reg_alloc.WriteX(carry_inst); @@ -124,7 +124,7 @@ void EmitIR(biscuit::Assembler& as, EmitContext& template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> @@ -136,8 +136,8 @@ void EmitIR(biscuit::Assembler& as, EmitContext auto& shift_arg = args[1]; // TODO: Add full implementation - ASSERT(carry_inst == nullptr); - ASSERT(shift_arg.IsImmediate()); + DEBUG_ASSERT(carry_inst == nullptr); + DEBUG_ASSERT(shift_arg.IsImmediate()); const u8 shift = shift_arg.GetImmediateU8(); auto Xresult = ctx.reg_alloc.WriteX(inst); @@ -153,72 +153,72 @@ void EmitIR(biscuit::Assembler& as, EmitContext template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template @@ -264,7 +264,7 @@ static void AddImmWithFlags(biscuit::Assembler& as, biscuit::GPR rd, biscuit::GP as.SLLI(Xscratch1, Xscratch1, 28); as.OR(flags, flags, Xscratch1); } else { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } } @@ -279,7 +279,7 @@ static void EmitAddSub(biscuit::Assembler& as, EmitContext& ctx, IR::Inst* inst) auto Xa = ctx.reg_alloc.ReadX(args[0]); if (overflow_inst) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } else if (nzcv_inst) { if (args[1].IsImmediate()) { const u64 imm = args[1].GetImmediateU64(); @@ -294,17 +294,17 @@ static void EmitAddSub(biscuit::Assembler& as, EmitContext& ctx, IR::Inst* inst) AddImmWithFlags(as, *Xresult, *Xa, sub ? -imm : imm, *Xflags); } } else { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } } else { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } } else { if (args[1].IsImmediate()) { const u64 imm = args[1].GetImmediateU64(); if (args[2].IsImmediate()) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } else { auto Xnzcv = ctx.reg_alloc.ReadX(args[2]); RegAlloc::Realize(Xresult, Xa, Xnzcv); @@ -317,7 +317,7 @@ static void EmitAddSub(biscuit::Assembler& as, EmitContext& ctx, IR::Inst* inst) as.ADDW(Xresult, Xa, Xscratch0); } } else { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } } } @@ -329,7 +329,7 @@ void EmitIR(biscuit::Assembler& as, EmitContext& ctx, IR::Ins template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> @@ -339,237 +339,237 @@ void EmitIR(biscuit::Assembler& as, EmitContext& ctx, IR::Ins template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } } // namespace Dynarmic::Backend::RV64 diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_floating_point.cpp b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_floating_point.cpp index 0c5d5984bc..03ee158d31 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_floating_point.cpp +++ b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_floating_point.cpp @@ -22,442 +22,442 @@ namespace Dynarmic::Backend::RV64 { template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } } // namespace Dynarmic::Backend::RV64 diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_packed.cpp b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_packed.cpp index acd73e86a3..ea7e52de11 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_packed.cpp +++ b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_packed.cpp @@ -22,172 +22,172 @@ namespace Dynarmic::Backend::RV64 { template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } } // namespace Dynarmic::Backend::RV64 diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_saturation.cpp b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_saturation.cpp index 9fae6cda77..8a7c259e98 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_saturation.cpp +++ b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_saturation.cpp @@ -22,112 +22,112 @@ namespace Dynarmic::Backend::RV64 { template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } } // namespace Dynarmic::Backend::RV64 diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_vector.cpp b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_vector.cpp index 5e56a34f19..55e86d9979 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_vector.cpp +++ b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_vector.cpp @@ -22,1377 +22,1377 @@ namespace Dynarmic::Backend::RV64 { template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } } // namespace Dynarmic::Backend::RV64 diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_vector_floating_point.cpp b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_vector_floating_point.cpp index 661cfc5403..0bd5202ca3 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_vector_floating_point.cpp +++ b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_vector_floating_point.cpp @@ -22,337 +22,337 @@ namespace Dynarmic::Backend::RV64 { template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } } // namespace Dynarmic::Backend::RV64 diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_vector_saturation.cpp b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_vector_saturation.cpp index 6662afcd69..021ec076df 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_vector_saturation.cpp +++ b/src/dynarmic/src/dynarmic/backend/riscv64/emit_riscv64_vector_saturation.cpp @@ -22,82 +22,82 @@ namespace Dynarmic::Backend::RV64 { template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } template<> void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } } // namespace Dynarmic::Backend::RV64 diff --git a/src/dynarmic/src/dynarmic/backend/riscv64/reg_alloc.cpp b/src/dynarmic/src/dynarmic/backend/riscv64/reg_alloc.cpp index fdb8ff898f..45f400debb 100644 --- a/src/dynarmic/src/dynarmic/backend/riscv64/reg_alloc.cpp +++ b/src/dynarmic/src/dynarmic/backend/riscv64/reg_alloc.cpp @@ -44,19 +44,19 @@ bool Argument::GetImmediateU1() const { u8 Argument::GetImmediateU8() const { const u64 imm = value.GetImmediateAsU64(); - ASSERT(imm < 0x100); + DEBUG_ASSERT(imm < 0x100); return u8(imm); } u16 Argument::GetImmediateU16() const { const u64 imm = value.GetImmediateAsU64(); - ASSERT(imm < 0x10000); + DEBUG_ASSERT(imm < 0x10000); return u16(imm); } u32 Argument::GetImmediateU32() const { const u64 imm = value.GetImmediateAsU64(); - ASSERT(imm < 0x100000000); + DEBUG_ASSERT(imm < 0x100000000); return u32(imm); } @@ -65,12 +65,12 @@ u64 Argument::GetImmediateU64() const { } IR::Cond Argument::GetImmediateCond() const { - ASSERT(IsImmediate() && GetType() == IR::Type::Cond); + DEBUG_ASSERT(IsImmediate() && GetType() == IR::Type::Cond); return value.GetCond(); } IR::AccType Argument::GetImmediateAccType() const { - ASSERT(IsImmediate() && GetType() == IR::Type::AccType); + DEBUG_ASSERT(IsImmediate() && GetType() == IR::Type::AccType); return value.GetAccType(); } @@ -79,7 +79,7 @@ bool HostLocInfo::Contains(const IR::Inst* value) const { } void HostLocInfo::SetupScratchLocation() { - ASSERT(IsCompletelyEmpty()); + DEBUG_ASSERT(IsCompletelyEmpty()); realized = true; } @@ -104,7 +104,7 @@ RegAlloc::ArgumentInfo RegAlloc::GetArgumentInfo(IR::Inst* inst) { const IR::Value arg = inst->GetArg(i); ret[i].value = arg; if (!arg.IsImmediate() && !IsValuelessType(arg.GetType())) { - ASSERT(ValueLocation(arg.GetInst()) && "argument must already been defined"); + DEBUG_ASSERT(ValueLocation(arg.GetInst()) && "argument must already been defined"); ValueInfo(arg.GetInst()).uses_this_inst++; } } @@ -128,7 +128,7 @@ void RegAlloc::UpdateAllUses() { } void RegAlloc::DefineAsExisting(IR::Inst* inst, Argument& arg) { - ASSERT(!ValueLocation(inst)); + DEBUG_ASSERT(!ValueLocation(inst)); if (arg.value.IsImmediate()) { inst->ReplaceUsesWith(arg.value); @@ -142,15 +142,15 @@ void RegAlloc::DefineAsExisting(IR::Inst* inst, Argument& arg) { void RegAlloc::AssertNoMoreUses() const { const auto is_empty = [](const auto& i) { return i.IsCompletelyEmpty(); }; - ASSERT(std::all_of(gprs.begin(), gprs.end(), is_empty)); - ASSERT(std::all_of(fprs.begin(), fprs.end(), is_empty)); - ASSERT(std::all_of(spills.begin(), spills.end(), is_empty)); + DEBUG_ASSERT(std::all_of(gprs.begin(), gprs.end(), is_empty)); + DEBUG_ASSERT(std::all_of(fprs.begin(), fprs.end(), is_empty)); + DEBUG_ASSERT(std::all_of(spills.begin(), spills.end(), is_empty)); } template u32 RegAlloc::GenerateImmediate(const IR::Value& value) { // TODO - // ASSERT(value.GetType() != IR::Type::U1); + // DEBUG_ASSERT(value.GetType() != IR::Type::U1); if constexpr (kind == HostLoc::Kind::Gpr) { const u32 new_location_index = AllocateRegister(gprs, gpr_order); @@ -161,7 +161,7 @@ u32 RegAlloc::GenerateImmediate(const IR::Value& value) { return new_location_index; } else if constexpr (kind == HostLoc::Kind::Fpr) { - ASSERT(false && "Unimplemented instruction"); + DEBUG_ASSERT(false && "Unimplemented instruction"); } else { UNREACHABLE(); } @@ -175,15 +175,15 @@ u32 RegAlloc::RealizeReadImpl(const IR::Value& value) { } const auto current_location = ValueLocation(value.GetInst()); - ASSERT(current_location); + DEBUG_ASSERT(current_location); if (current_location->kind == required_kind) { ValueInfo(*current_location).realized = true; return current_location->index; } - ASSERT(!ValueInfo(*current_location).realized); - ASSERT(!ValueInfo(*current_location).locked); + DEBUG_ASSERT(!ValueInfo(*current_location).realized); + DEBUG_ASSERT(!ValueInfo(*current_location).locked); if constexpr (required_kind == HostLoc::Kind::Gpr) { const u32 new_location_index = AllocateRegister(gprs, gpr_order); @@ -194,7 +194,7 @@ u32 RegAlloc::RealizeReadImpl(const IR::Value& value) { UNREACHABLE(); //logic error case HostLoc::Kind::Fpr: as.FMV_X_D(biscuit::GPR(new_location_index), biscuit::FPR{current_location->index}); - // ASSERT size fits + // DEBUG_ASSERT size fits break; case HostLoc::Kind::Spill: as.LD(biscuit::GPR{new_location_index}, spill_offset + current_location->index * spill_slot_size, biscuit::sp); @@ -229,7 +229,7 @@ u32 RegAlloc::RealizeReadImpl(const IR::Value& value) { template u32 RegAlloc::RealizeWriteImpl(const IR::Inst* value) { - ASSERT(!ValueLocation(value)); + DEBUG_ASSERT(!ValueLocation(value)); const auto setup_location = [&](HostLocInfo& info) { info = {}; @@ -274,7 +274,7 @@ u32 RegAlloc::AllocateRegister(const std::array& regs, const st } void RegAlloc::SpillGpr(u32 index) { - ASSERT(!gprs[index].locked && !gprs[index].realized); + DEBUG_ASSERT(!gprs[index].locked && !gprs[index].realized); if (gprs[index].values.empty()) { return; } @@ -284,7 +284,7 @@ void RegAlloc::SpillGpr(u32 index) { } void RegAlloc::SpillFpr(u32 index) { - ASSERT(!fprs[index].locked && !fprs[index].realized); + DEBUG_ASSERT(!fprs[index].locked && !fprs[index].realized); if (fprs[index].values.empty()) { return; } @@ -295,7 +295,7 @@ void RegAlloc::SpillFpr(u32 index) { u32 RegAlloc::FindFreeSpill() const { const auto iter = std::find_if(spills.begin(), spills.end(), [](const HostLocInfo& info) { return info.values.empty(); }); - ASSERT(iter != spills.end() && "All spill locations are full"); + DEBUG_ASSERT(iter != spills.end() && "All spill locations are full"); return static_cast(iter - spills.begin()); } diff --git a/src/dynarmic/src/dynarmic/backend/x64/a32_emit_x64.cpp b/src/dynarmic/src/dynarmic/backend/x64/a32_emit_x64.cpp index 5c6a90e15a..176f14d8ef 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/a32_emit_x64.cpp +++ b/src/dynarmic/src/dynarmic/backend/x64/a32_emit_x64.cpp @@ -209,11 +209,11 @@ void A32EmitX64::InvalidateCacheRanges(const boost::icl::interval_set& rang void A32EmitX64::EmitCondPrelude(const A32EmitContext& ctx) { if (ctx.block.GetCondition() == IR::Cond::AL) { - ASSERT(!ctx.block.HasConditionFailedLocation()); + DEBUG_ASSERT(!ctx.block.HasConditionFailedLocation()); return; } - ASSERT(ctx.block.HasConditionFailedLocation()); + DEBUG_ASSERT(ctx.block.HasConditionFailedLocation()); Xbyak::Label pass = EmitCond(ctx.block.GetCondition()); if (conf.enable_cycle_counting) { @@ -311,7 +311,7 @@ void A32EmitX64::EmitA32GetRegister(A32EmitContext& ctx, IR::Inst* inst) { void A32EmitX64::EmitA32GetExtendedRegister32(A32EmitContext& ctx, IR::Inst* inst) { const A32::ExtReg reg = inst->GetArg(0).GetA32ExtRegRef(); - ASSERT(A32::IsSingleExtReg(reg)); + DEBUG_ASSERT(A32::IsSingleExtReg(reg)); const Xbyak::Xmm result = ctx.reg_alloc.ScratchXmm(code); code.movss(result, MJitStateExtReg(reg)); @@ -320,7 +320,7 @@ void A32EmitX64::EmitA32GetExtendedRegister32(A32EmitContext& ctx, IR::Inst* ins void A32EmitX64::EmitA32GetExtendedRegister64(A32EmitContext& ctx, IR::Inst* inst) { const A32::ExtReg reg = inst->GetArg(0).GetA32ExtRegRef(); - ASSERT(A32::IsDoubleExtReg(reg)); + DEBUG_ASSERT(A32::IsDoubleExtReg(reg)); const Xbyak::Xmm result = ctx.reg_alloc.ScratchXmm(code); code.movsd(result, MJitStateExtReg(reg)); @@ -329,7 +329,7 @@ void A32EmitX64::EmitA32GetExtendedRegister64(A32EmitContext& ctx, IR::Inst* ins void A32EmitX64::EmitA32GetVector(A32EmitContext& ctx, IR::Inst* inst) { const A32::ExtReg reg = inst->GetArg(0).GetA32ExtRegRef(); - ASSERT(A32::IsDoubleExtReg(reg) || A32::IsQuadExtReg(reg)); + DEBUG_ASSERT(A32::IsDoubleExtReg(reg) || A32::IsQuadExtReg(reg)); const Xbyak::Xmm result = ctx.reg_alloc.ScratchXmm(code); if (A32::IsDoubleExtReg(reg)) { @@ -358,7 +358,7 @@ void A32EmitX64::EmitA32SetRegister(A32EmitContext& ctx, IR::Inst* inst) { void A32EmitX64::EmitA32SetExtendedRegister32(A32EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); const A32::ExtReg reg = inst->GetArg(0).GetA32ExtRegRef(); - ASSERT(A32::IsSingleExtReg(reg)); + DEBUG_ASSERT(A32::IsSingleExtReg(reg)); if (args[1].IsInXmm(ctx.reg_alloc)) { Xbyak::Xmm to_store = ctx.reg_alloc.UseXmm(code, args[1]); @@ -372,7 +372,7 @@ void A32EmitX64::EmitA32SetExtendedRegister32(A32EmitContext& ctx, IR::Inst* ins void A32EmitX64::EmitA32SetExtendedRegister64(A32EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); const A32::ExtReg reg = inst->GetArg(0).GetA32ExtRegRef(); - ASSERT(A32::IsDoubleExtReg(reg)); + DEBUG_ASSERT(A32::IsDoubleExtReg(reg)); if (args[1].IsInXmm(ctx.reg_alloc)) { const Xbyak::Xmm to_store = ctx.reg_alloc.UseXmm(code, args[1]); @@ -386,7 +386,7 @@ void A32EmitX64::EmitA32SetExtendedRegister64(A32EmitContext& ctx, IR::Inst* ins void A32EmitX64::EmitA32SetVector(A32EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); const A32::ExtReg reg = inst->GetArg(0).GetA32ExtRegRef(); - ASSERT(A32::IsDoubleExtReg(reg) || A32::IsQuadExtReg(reg)); + DEBUG_ASSERT(A32::IsDoubleExtReg(reg) || A32::IsQuadExtReg(reg)); const Xbyak::Xmm to_store = ctx.reg_alloc.UseXmm(code, args[1]); if (A32::IsDoubleExtReg(reg)) { @@ -647,7 +647,7 @@ void A32EmitX64::EmitA32GetGEFlags(A32EmitContext& ctx, IR::Inst* inst) { void A32EmitX64::EmitA32SetGEFlags(A32EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(!args[0].IsImmediate()); + DEBUG_ASSERT(!args[0].IsImmediate()); if (args[0].IsInXmm(ctx.reg_alloc)) { const Xbyak::Xmm to_store = ctx.reg_alloc.UseXmm(code, args[0]); @@ -788,7 +788,7 @@ void A32EmitX64::EmitA32ExceptionRaised(A32EmitContext& ctx, IR::Inst* inst) { ctx.reg_alloc.EndOfAllocScope(); auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(args[0].IsImmediate() && args[1].IsImmediate()); + DEBUG_ASSERT(args[0].IsImmediate() && args[1].IsImmediate()); const u32 pc = args[0].GetImmediateU32(); const u64 exception = args[1].GetImmediateU64(); Devirtualize<&A32::UserCallbacks::ExceptionRaised>(conf.callbacks).EmitCall(code, [&](RegList param) { diff --git a/src/dynarmic/src/dynarmic/backend/x64/a32_interface.cpp b/src/dynarmic/src/dynarmic/backend/x64/a32_interface.cpp index 72627b9e1a..2071d711dc 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/a32_interface.cpp +++ b/src/dynarmic/src/dynarmic/backend/x64/a32_interface.cpp @@ -74,7 +74,7 @@ struct Jit::Impl { ~Impl() = default; HaltReason Run() { - ASSERT(!jit_interface->is_executing); + DEBUG_ASSERT(!jit_interface->is_executing); PerformRequestedCacheInvalidation(static_cast(Atomic::Load(&jit_state.halt_reason))); jit_interface->is_executing = true; const CodePtr current_codeptr = [this] { @@ -94,7 +94,7 @@ struct Jit::Impl { } HaltReason Step() { - ASSERT(!jit_interface->is_executing); + DEBUG_ASSERT(!jit_interface->is_executing); PerformRequestedCacheInvalidation(static_cast(Atomic::Load(&jit_state.halt_reason))); jit_interface->is_executing = true; const HaltReason hr = block_of_code.StepCode(&jit_state, GetCurrentSingleStep()); @@ -116,7 +116,7 @@ struct Jit::Impl { } void Reset() { - ASSERT(!jit_interface->is_executing); + DEBUG_ASSERT(!jit_interface->is_executing); jit_state = {}; } diff --git a/src/dynarmic/src/dynarmic/backend/x64/a64_emit_x64.cpp b/src/dynarmic/src/dynarmic/backend/x64/a64_emit_x64.cpp index 71e5e62cd9..d8fa4e83de 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/a64_emit_x64.cpp +++ b/src/dynarmic/src/dynarmic/backend/x64/a64_emit_x64.cpp @@ -501,7 +501,7 @@ void A64EmitX64::EmitA64SetPC(A64EmitContext& ctx, IR::Inst* inst) { void A64EmitX64::EmitA64CallSupervisor(A64EmitContext& ctx, IR::Inst* inst) { ctx.reg_alloc.HostCall(code, nullptr); auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(args[0].IsImmediate()); + DEBUG_ASSERT(args[0].IsImmediate()); const u32 imm = args[0].GetImmediateU32(); Devirtualize<&A64::UserCallbacks::CallSVC>(conf.callbacks).EmitCall(code, [&](RegList param) { code.mov(param[0], imm); @@ -513,7 +513,7 @@ void A64EmitX64::EmitA64CallSupervisor(A64EmitContext& ctx, IR::Inst* inst) { void A64EmitX64::EmitA64ExceptionRaised(A64EmitContext& ctx, IR::Inst* inst) { ctx.reg_alloc.HostCall(code, nullptr); auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(args[0].IsImmediate() && args[1].IsImmediate()); + DEBUG_ASSERT(args[0].IsImmediate() && args[1].IsImmediate()); const u64 pc = args[0].GetImmediateU64(); const u64 exception = args[1].GetImmediateU64(); Devirtualize<&A64::UserCallbacks::ExceptionRaised>(conf.callbacks).EmitCall(code, [&](RegList param) { diff --git a/src/dynarmic/src/dynarmic/backend/x64/a64_interface.cpp b/src/dynarmic/src/dynarmic/backend/x64/a64_interface.cpp index bb072129e7..cbd5871aa2 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/a64_interface.cpp +++ b/src/dynarmic/src/dynarmic/backend/x64/a64_interface.cpp @@ -66,13 +66,13 @@ public: , emitter(block_of_code, conf, jit) , polyfill_options(GenPolyfillOptions(block_of_code)) { - ASSERT(conf.page_table_address_space_bits >= 12 && conf.page_table_address_space_bits <= 64); + DEBUG_ASSERT(conf.page_table_address_space_bits >= 12 && conf.page_table_address_space_bits <= 64); } ~Impl() = default; HaltReason Run() { - ASSERT(!is_executing); + DEBUG_ASSERT(!is_executing); PerformRequestedCacheInvalidation(static_cast(Atomic::Load(&jit_state.halt_reason))); is_executing = true; // TODO: Check code alignment @@ -92,7 +92,7 @@ public: } HaltReason Step() { - ASSERT(!is_executing); + DEBUG_ASSERT(!is_executing); PerformRequestedCacheInvalidation(static_cast(Atomic::Load(&jit_state.halt_reason))); is_executing = true; const HaltReason hr = block_of_code.StepCode(&jit_state, GetCurrentSingleStep()); @@ -116,7 +116,7 @@ public: } void Reset() { - ASSERT(!is_executing); + DEBUG_ASSERT(!is_executing); jit_state = {}; } diff --git a/src/dynarmic/src/dynarmic/backend/x64/block_of_code.cpp b/src/dynarmic/src/dynarmic/backend/x64/block_of_code.cpp index 384d6203a4..94bc4c91a1 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/block_of_code.cpp +++ b/src/dynarmic/src/dynarmic/backend/x64/block_of_code.cpp @@ -191,12 +191,12 @@ void BlockOfCode::DisableWriting() { } void BlockOfCode::ClearCache() { - ASSERT(prelude_complete); + DEBUG_ASSERT(prelude_complete); SetCodePtr(code_begin); } size_t BlockOfCode::SpaceRemaining() const { - ASSERT(prelude_complete); + DEBUG_ASSERT(prelude_complete); const u8* current_ptr = getCurr(); if (current_ptr >= &top_[maxSize_]) return 0; @@ -466,7 +466,7 @@ void BlockOfCode::SetCodePtr(CodePtr code_ptr) { void BlockOfCode::EnsurePatchLocationSize(CodePtr begin, size_t size) { size_t current_size = getCurr() - reinterpret_cast(begin); - ASSERT(current_size <= size); + DEBUG_ASSERT(current_size <= size); nop(size - current_size); } diff --git a/src/dynarmic/src/dynarmic/backend/x64/constant_pool.cpp b/src/dynarmic/src/dynarmic/backend/x64/constant_pool.cpp index 8782ab0c73..eb6b418249 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/constant_pool.cpp +++ b/src/dynarmic/src/dynarmic/backend/x64/constant_pool.cpp @@ -28,7 +28,7 @@ Xbyak::Address ConstantPool::GetConstant(BlockOfCode& code, const Xbyak::Address const auto constant = ConstantT(lower, upper); auto it = constant_info.find(constant); if (it == constant_info.end()) { - ASSERT(insertion_point < pool.size()); + DEBUG_ASSERT(insertion_point < pool.size()); ConstantT& target_constant = pool[insertion_point]; target_constant = constant; it = constant_info.insert({constant, &target_constant}).first; diff --git a/src/dynarmic/src/dynarmic/backend/x64/emit_x64.cpp b/src/dynarmic/src/dynarmic/backend/x64/emit_x64.cpp index b9df3987ca..63578eac48 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/emit_x64.cpp +++ b/src/dynarmic/src/dynarmic/backend/x64/emit_x64.cpp @@ -148,7 +148,7 @@ void EmitX64::EmitVerboseDebuggingOutput(RegAlloc& reg_alloc) { void EmitX64::EmitPushRSB(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(args[0].IsImmediate()); + DEBUG_ASSERT(args[0].IsImmediate()); const u64 unique_hash_of_target = args[0].GetImmediateU64(); ctx.reg_alloc.ScratchGpr(code, HostLoc::RCX); @@ -288,7 +288,7 @@ void EmitX64::EmitNZCVFromPackedFlags(EmitContext& ctx, IR::Inst* inst) { } void EmitX64::EmitAddCycles(size_t cycles) { - ASSERT(cycles < (std::numeric_limits::max)()); + DEBUG_ASSERT(cycles < (std::numeric_limits::max)()); code.sub(qword[rsp + ABI_SHADOW_SPACE + offsetof(StackLayout, cycles_remaining)], static_cast(cycles)); } diff --git a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_data_processing.cpp b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_data_processing.cpp index d05d4aa036..7d0334a01c 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_data_processing.cpp +++ b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_data_processing.cpp @@ -129,7 +129,7 @@ void EmitX64::EmitIsZero64(EmitContext& ctx, IR::Inst* inst) { void EmitX64::EmitTestBit(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); const Xbyak::Reg64 result = ctx.reg_alloc.UseScratchGpr(code, args[0]); - ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].IsImmediate()); // TODO: Flag optimization code.bt(result, args[1].GetImmediateU8()); code.setc(result.cvt8()); diff --git a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_floating_point.cpp b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_floating_point.cpp index 756a6f0a36..1cf5c75ff0 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_floating_point.cpp +++ b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_floating_point.cpp @@ -1842,7 +1842,7 @@ void EmitX64::EmitFPFixedS32ToSingle(EmitContext& ctx, IR::Inst* inst) { if (rounding_mode == ctx.FPCR().RMode() || ctx.HasOptimization(OptimizationFlag::Unsafe_IgnoreStandardFPCRValue)) { code.cvtsi2ss(result, from); } else { - ASSERT(rounding_mode == FP::RoundingMode::ToNearest_TieEven); + DEBUG_ASSERT(rounding_mode == FP::RoundingMode::ToNearest_TieEven); code.EnterStandardASIMD(); code.cvtsi2ss(result, from); code.LeaveStandardASIMD(); @@ -1878,7 +1878,7 @@ void EmitX64::EmitFPFixedU32ToSingle(EmitContext& ctx, IR::Inst* inst) { if (rounding_mode == ctx.FPCR().RMode() || ctx.HasOptimization(OptimizationFlag::Unsafe_IgnoreStandardFPCRValue)) { op(); } else { - ASSERT(rounding_mode == FP::RoundingMode::ToNearest_TieEven); + DEBUG_ASSERT(rounding_mode == FP::RoundingMode::ToNearest_TieEven); code.EnterStandardASIMD(); op(); code.LeaveStandardASIMD(); @@ -1984,7 +1984,7 @@ void EmitX64::EmitFPFixedS64ToDouble(EmitContext& ctx, IR::Inst* inst) { const Xbyak::Xmm result = ctx.reg_alloc.ScratchXmm(code); const size_t fbits = args[1].GetImmediateU8(); const FP::RoundingMode rounding_mode = static_cast(args[2].GetImmediateU8()); - ASSERT(rounding_mode == ctx.FPCR().RMode()); + DEBUG_ASSERT(rounding_mode == ctx.FPCR().RMode()); code.cvtsi2sd(result, from); @@ -2003,7 +2003,7 @@ void EmitX64::EmitFPFixedS64ToSingle(EmitContext& ctx, IR::Inst* inst) { const Xbyak::Xmm result = ctx.reg_alloc.ScratchXmm(code); const size_t fbits = args[1].GetImmediateU8(); const FP::RoundingMode rounding_mode = static_cast(args[2].GetImmediateU8()); - ASSERT(rounding_mode == ctx.FPCR().RMode()); + DEBUG_ASSERT(rounding_mode == ctx.FPCR().RMode()); code.cvtsi2ss(result, from); @@ -2022,7 +2022,7 @@ void EmitX64::EmitFPFixedU64ToDouble(EmitContext& ctx, IR::Inst* inst) { const Xbyak::Xmm result = ctx.reg_alloc.ScratchXmm(code); const size_t fbits = args[1].GetImmediateU8(); const FP::RoundingMode rounding_mode = static_cast(args[2].GetImmediateU8()); - ASSERT(rounding_mode == ctx.FPCR().RMode()); + DEBUG_ASSERT(rounding_mode == ctx.FPCR().RMode()); if (code.HasHostFeature(HostFeature::AVX512F)) { code.vcvtusi2sd(result, result, from); @@ -2053,7 +2053,7 @@ void EmitX64::EmitFPFixedU64ToSingle(EmitContext& ctx, IR::Inst* inst) { const Xbyak::Xmm result = ctx.reg_alloc.ScratchXmm(code); const size_t fbits = args[1].GetImmediateU8(); const FP::RoundingMode rounding_mode = static_cast(args[2].GetImmediateU8()); - ASSERT(rounding_mode == ctx.FPCR().RMode()); + DEBUG_ASSERT(rounding_mode == ctx.FPCR().RMode()); if (code.HasHostFeature(HostFeature::AVX512F)) { const Xbyak::Reg64 from = ctx.reg_alloc.UseGpr(code, args[0]); diff --git a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.cpp.inc b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.cpp.inc index 4fa14d504b..8e734c22eb 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.cpp.inc +++ b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.cpp.inc @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + /* This file is part of the dynarmic project. * Copyright (c) 2022 MerryMage * SPDX-License-Identifier: 0BSD @@ -113,7 +116,7 @@ void AxxEmitX64::EmitMemoryRead(AxxEmitContext& ctx, IR::Inst* inst) { }); } else { // Use page table - ASSERT(conf.page_table); + DEBUG_ASSERT(conf.page_table); const auto src_ptr = EmitVAddrLookup(code, ctx, bitsize, *abort, vaddr); EmitReadMemoryMov(code, value_idx, src_ptr, ordered); @@ -200,7 +203,7 @@ void AxxEmitX64::EmitMemoryWrite(AxxEmitContext& ctx, IR::Inst* inst) { }); } else { // Use page table - ASSERT(conf.page_table); + DEBUG_ASSERT(conf.page_table); const auto dest_ptr = EmitVAddrLookup(code, ctx, bitsize, *abort, vaddr); EmitWriteMemoryMov(code, dest_ptr, value_idx, ordered); @@ -216,7 +219,7 @@ void AxxEmitX64::EmitMemoryWrite(AxxEmitContext& ctx, IR::Inst* inst) { template void AxxEmitX64::EmitExclusiveReadMemory(AxxEmitContext& ctx, IR::Inst* inst) { - ASSERT(conf.global_monitor != nullptr); + DEBUG_ASSERT(conf.global_monitor != nullptr); auto args = ctx.reg_alloc.GetArgumentInfo(inst); const bool ordered = IsOrdered(args[2].GetImmediateAccType()); @@ -267,7 +270,7 @@ void AxxEmitX64::EmitExclusiveReadMemory(AxxEmitContext& ctx, IR::Inst* inst) { template void AxxEmitX64::EmitExclusiveWriteMemory(AxxEmitContext& ctx, IR::Inst* inst) { - ASSERT(conf.global_monitor != nullptr); + DEBUG_ASSERT(conf.global_monitor != nullptr); auto args = ctx.reg_alloc.GetArgumentInfo(inst); const bool ordered = IsOrdered(args[3].GetImmediateAccType()); @@ -320,7 +323,7 @@ void AxxEmitX64::EmitExclusiveWriteMemory(AxxEmitContext& ctx, IR::Inst* inst) { template void AxxEmitX64::EmitExclusiveReadMemoryInline(AxxEmitContext& ctx, IR::Inst* inst) { - ASSERT(conf.global_monitor && conf.fastmem_pointer); + DEBUG_ASSERT(conf.global_monitor && conf.fastmem_pointer); if (!exception_handler.SupportsFastmem()) { EmitExclusiveReadMemory(ctx, inst); return; @@ -397,7 +400,7 @@ void AxxEmitX64::EmitExclusiveReadMemoryInline(AxxEmitContext& ctx, IR::Inst* in template void AxxEmitX64::EmitExclusiveWriteMemoryInline(AxxEmitContext& ctx, IR::Inst* inst) { - ASSERT(conf.global_monitor && conf.fastmem_pointer); + DEBUG_ASSERT(conf.global_monitor && conf.fastmem_pointer); if (!exception_handler.SupportsFastmem()) { EmitExclusiveWriteMemory(ctx, inst); return; diff --git a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h index 9686e4fc04..63f36150e9 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h +++ b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_memory.h @@ -148,7 +148,7 @@ template<> code.and_(tmp, u32((1 << valid_page_index_bits) - 1)); } } else { - ASSERT(valid_page_index_bits < 32); + DEBUG_ASSERT(valid_page_index_bits < 32); code.mov(tmp, vaddr); code.shr(tmp, int(page_table_const_bits)); code.test(tmp, u32(-(1 << valid_page_index_bits))); diff --git a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_saturation.cpp b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_saturation.cpp index e116382b93..36cca018c6 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_saturation.cpp +++ b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_saturation.cpp @@ -118,7 +118,7 @@ void EmitX64::EmitSignedSaturation(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); const size_t N = args[1].GetImmediateU8(); - ASSERT(N >= 1 && N <= 32); + DEBUG_ASSERT(N >= 1 && N <= 32); if (N == 32) { if (overflow_inst) { @@ -167,7 +167,7 @@ void EmitX64::EmitUnsignedSaturation(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); const size_t N = args[1].GetImmediateU8(); - ASSERT(N <= 31); + DEBUG_ASSERT(N <= 31); const u32 saturated_value = (1u << N) - 1; diff --git a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_sha.cpp b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_sha.cpp index cd166f0cb8..a4a9767b39 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_sha.cpp +++ b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_sha.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later /* This file is part of the dynarmic project. @@ -18,7 +18,7 @@ void EmitX64::EmitSHA256Hash(EmitContext& ctx, IR::Inst* inst) { const bool part1 = args[3].GetImmediateU1(); - ASSERT(code.HasHostFeature(HostFeature::SHA)); + DEBUG_ASSERT(code.HasHostFeature(HostFeature::SHA)); // 3 2 1 0 // x = d c b a @@ -54,7 +54,7 @@ void EmitX64::EmitSHA256Hash(EmitContext& ctx, IR::Inst* inst) { void EmitX64::EmitSHA256MessageSchedule0(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(code.HasHostFeature(HostFeature::SHA)); + DEBUG_ASSERT(code.HasHostFeature(HostFeature::SHA)); const Xbyak::Xmm x = ctx.reg_alloc.UseScratchXmm(code, args[0]); const Xbyak::Xmm y = ctx.reg_alloc.UseXmm(code, args[1]); @@ -67,7 +67,7 @@ void EmitX64::EmitSHA256MessageSchedule0(EmitContext& ctx, IR::Inst* inst) { void EmitX64::EmitSHA256MessageSchedule1(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(code.HasHostFeature(HostFeature::SHA)); + DEBUG_ASSERT(code.HasHostFeature(HostFeature::SHA)); const Xbyak::Xmm x = ctx.reg_alloc.UseScratchXmm(code, args[0]); const Xbyak::Xmm y = ctx.reg_alloc.UseXmm(code, args[1]); diff --git a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_vector.cpp b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_vector.cpp index 1165abb0e4..191adea07a 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_vector.cpp +++ b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_vector.cpp @@ -177,7 +177,7 @@ static void EmitTwoArgumentFallback(BlockOfCode& code, EmitContext& ctx, IR::Ins void EmitX64::EmitVectorGetElement8(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].IsImmediate()); const u8 index = args[1].GetImmediateU8(); // TODO: DefineValue directly on Argument for index == 0 @@ -201,7 +201,7 @@ void EmitX64::EmitVectorGetElement8(EmitContext& ctx, IR::Inst* inst) { void EmitX64::EmitVectorGetElement16(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].IsImmediate()); const u8 index = args[1].GetImmediateU8(); // TODO: DefineValue directly on Argument for index == 0 @@ -214,7 +214,7 @@ void EmitX64::EmitVectorGetElement16(EmitContext& ctx, IR::Inst* inst) { void EmitX64::EmitVectorGetElement32(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].IsImmediate()); const u8 index = args[1].GetImmediateU8(); // TODO: DefineValue directly on Argument for index == 0 @@ -235,7 +235,7 @@ void EmitX64::EmitVectorGetElement32(EmitContext& ctx, IR::Inst* inst) { void EmitX64::EmitVectorGetElement64(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].IsImmediate()); const u8 index = args[1].GetImmediateU8(); if (index == 0) { @@ -263,7 +263,7 @@ void EmitX64::EmitVectorGetElement64(EmitContext& ctx, IR::Inst* inst) { void EmitX64::EmitVectorSetElement8(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].IsImmediate()); const u8 index = args[1].GetImmediateU8(); auto const source_vector = ctx.reg_alloc.UseScratchXmm(code, args[0]); @@ -295,7 +295,7 @@ void EmitX64::EmitVectorSetElement8(EmitContext& ctx, IR::Inst* inst) { void EmitX64::EmitVectorSetElement16(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].IsImmediate()); const u8 index = args[1].GetImmediateU8(); auto const source_vector = ctx.reg_alloc.UseScratchXmm(code, args[0]); @@ -308,7 +308,7 @@ void EmitX64::EmitVectorSetElement16(EmitContext& ctx, IR::Inst* inst) { void EmitX64::EmitVectorSetElement32(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].IsImmediate()); const u8 index = args[1].GetImmediateU8(); auto const source_vector = ctx.reg_alloc.UseScratchXmm(code, args[0]); @@ -331,7 +331,7 @@ void EmitX64::EmitVectorSetElement32(EmitContext& ctx, IR::Inst* inst) { void EmitX64::EmitVectorSetElement64(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); - ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].IsImmediate()); const u8 index = args[1].GetImmediateU8(); auto const source_vector = ctx.reg_alloc.UseScratchXmm(code, args[0]); @@ -717,9 +717,9 @@ void EmitX64::EmitVectorBroadcast64(EmitContext& ctx, IR::Inst* inst) { void EmitX64::EmitVectorBroadcastElementLower8(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); auto const a = ctx.reg_alloc.UseScratchXmm(code, args[0]); - ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].IsImmediate()); const u8 index = args[1].GetImmediateU8(); - ASSERT(index < 16); + DEBUG_ASSERT(index < 16); if (index > 0) { code.psrldq(a, index); } @@ -741,9 +741,9 @@ void EmitX64::EmitVectorBroadcastElementLower8(EmitContext& ctx, IR::Inst* inst) void EmitX64::EmitVectorBroadcastElementLower16(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); auto const a = ctx.reg_alloc.UseScratchXmm(code, args[0]); - ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].IsImmediate()); const u8 index = args[1].GetImmediateU8(); - ASSERT(index < 8); + DEBUG_ASSERT(index < 8); if (index > 0) { code.psrldq(a, u8(index * 2)); } @@ -754,9 +754,9 @@ void EmitX64::EmitVectorBroadcastElementLower16(EmitContext& ctx, IR::Inst* inst void EmitX64::EmitVectorBroadcastElementLower32(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); auto const a = ctx.reg_alloc.UseScratchXmm(code, args[0]); - ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].IsImmediate()); const u8 index = args[1].GetImmediateU8(); - ASSERT(index < 4); + DEBUG_ASSERT(index < 4); if (index > 0) { code.psrldq(a, u8(index * 4)); @@ -770,9 +770,9 @@ void EmitX64::EmitVectorBroadcastElementLower32(EmitContext& ctx, IR::Inst* inst void EmitX64::EmitVectorBroadcastElement8(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); auto const a = ctx.reg_alloc.UseScratchXmm(code, args[0]); - ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].IsImmediate()); const u8 index = args[1].GetImmediateU8(); - ASSERT(index < 16); + DEBUG_ASSERT(index < 16); if (index > 0) { code.psrldq(a, index); } @@ -794,9 +794,9 @@ void EmitX64::EmitVectorBroadcastElement8(EmitContext& ctx, IR::Inst* inst) { void EmitX64::EmitVectorBroadcastElement16(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); auto const a = ctx.reg_alloc.UseScratchXmm(code, args[0]); - ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].IsImmediate()); const u8 index = args[1].GetImmediateU8(); - ASSERT(index < 8); + DEBUG_ASSERT(index < 8); if (index == 0 && code.HasHostFeature(HostFeature::AVX2)) { code.vpbroadcastw(a, a); } else { @@ -814,9 +814,9 @@ void EmitX64::EmitVectorBroadcastElement16(EmitContext& ctx, IR::Inst* inst) { void EmitX64::EmitVectorBroadcastElement32(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); auto const a = ctx.reg_alloc.UseScratchXmm(code, args[0]); - ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].IsImmediate()); const u8 index = args[1].GetImmediateU8(); - ASSERT(index < 4); + DEBUG_ASSERT(index < 4); code.pshufd(a, a, mcl::bit::replicate_element<2, u8>(index)); @@ -826,9 +826,9 @@ void EmitX64::EmitVectorBroadcastElement32(EmitContext& ctx, IR::Inst* inst) { void EmitX64::EmitVectorBroadcastElement64(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); auto const a = ctx.reg_alloc.UseScratchXmm(code, args[0]); - ASSERT(args[1].IsImmediate()); + DEBUG_ASSERT(args[1].IsImmediate()); const u8 index = args[1].GetImmediateU8(); - ASSERT(index < 2); + DEBUG_ASSERT(index < 2); if (code.HasHostFeature(HostFeature::AVX)) { code.vpermilpd(a, a, mcl::bit::replicate_element<1, u8>(index)); @@ -1314,7 +1314,7 @@ void EmitX64::EmitVectorExtract(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); const u8 position = args[2].GetImmediateU8(); - ASSERT(position % 8 == 0); + DEBUG_ASSERT(position % 8 == 0); if (position == 0) { ctx.reg_alloc.DefineValue(code, inst, args[0]); @@ -1346,7 +1346,7 @@ void EmitX64::EmitVectorExtractLower(EmitContext& ctx, IR::Inst* inst) { auto const xmm_a = ctx.reg_alloc.UseScratchXmm(code, args[0]); const u8 position = args[2].GetImmediateU8(); - ASSERT(position % 8 == 0); + DEBUG_ASSERT(position % 8 == 0); if (position != 0) { auto const xmm_b = ctx.reg_alloc.UseXmm(code, args[1]); @@ -3821,7 +3821,7 @@ void EmitX64::EmitVectorRotateWholeVectorRight(EmitContext& ctx, IR::Inst* inst) auto const operand = ctx.reg_alloc.UseXmm(code, args[0]); auto const result = ctx.reg_alloc.ScratchXmm(code); const u8 shift_amount = args[1].GetImmediateU8(); - ASSERT(shift_amount % 32 == 0); + DEBUG_ASSERT(shift_amount % 32 == 0); const u8 shuffle_imm = std::rotr(0b11100100, shift_amount / 32 * 2); code.pshufd(result, operand, shuffle_imm); @@ -4914,7 +4914,7 @@ static void EmitVectorSignedSaturatedNarrowToUnsigned(size_t original_esize, Blo code.punpcklbw(reconstructed, xmm0); break; case 32: - ASSERT(code.HasHostFeature(HostFeature::SSE41)); + DEBUG_ASSERT(code.HasHostFeature(HostFeature::SSE41)); code.packusdw(dest, xmm0); // SSE4.1 code.movdqa(reconstructed, dest); code.punpcklwd(reconstructed, xmm0); @@ -5276,11 +5276,11 @@ void EmitX64::EmitVectorSub64(EmitContext& ctx, IR::Inst* inst) { void EmitX64::EmitVectorTable(EmitContext&, IR::Inst* inst) { // Do nothing. We *want* to hold on to the refcount for our arguments, so VectorTableLookup can use our arguments. - ASSERT(inst->UseCount() == 1 && "Table cannot be used multiple times"); + DEBUG_ASSERT(inst->UseCount() == 1 && "Table cannot be used multiple times"); } void EmitX64::EmitVectorTableLookup64(EmitContext& ctx, IR::Inst* inst) { - ASSERT(inst->GetArg(1).GetInst()->GetOpcode() == IR::Opcode::VectorTable); + DEBUG_ASSERT(inst->GetArg(1).GetInst()->GetOpcode() == IR::Opcode::VectorTable); auto args = ctx.reg_alloc.GetArgumentInfo(inst); auto table = ctx.reg_alloc.GetArgumentInfo(inst->GetArg(1).GetInst()); @@ -5438,7 +5438,7 @@ void EmitX64::EmitVectorTableLookup64(EmitContext& ctx, IR::Inst* inst) { code.pxor(xmm0, xmm0); code.punpcklqdq(xmm_table1, xmm0); } else { - ASSERT(table_size == 4); + DEBUG_ASSERT(table_size == 4); auto const xmm_table1_upper = ctx.reg_alloc.UseXmm(code, table[3]); code.punpcklqdq(xmm_table1, xmm_table1_upper); ctx.reg_alloc.Release(xmm_table1_upper); @@ -5529,7 +5529,7 @@ void EmitX64::EmitVectorTableLookup64(EmitContext& ctx, IR::Inst* inst) { } void EmitX64::EmitVectorTableLookup128(EmitContext& ctx, IR::Inst* inst) { - ASSERT(inst->GetArg(1).GetInst()->GetOpcode() == IR::Opcode::VectorTable); + DEBUG_ASSERT(inst->GetArg(1).GetInst()->GetOpcode() == IR::Opcode::VectorTable); auto args = ctx.reg_alloc.GetArgumentInfo(inst); auto table = ctx.reg_alloc.GetArgumentInfo(inst->GetArg(1).GetInst()); diff --git a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp index 0ad3b022d0..1bd7f5ef95 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp +++ b/src/dynarmic/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp @@ -676,7 +676,7 @@ void EmitX64::EmitFPVectorFromSignedFixed32(EmitContext& ctx, IR::Inst* inst) { const int fbits = args[1].GetImmediateU8(); const FP::RoundingMode rounding_mode = static_cast(args[2].GetImmediateU8()); const bool fpcr_controlled = args[3].GetImmediateU1(); - ASSERT(rounding_mode == ctx.FPCR(fpcr_controlled).RMode()); + DEBUG_ASSERT(rounding_mode == ctx.FPCR(fpcr_controlled).RMode()); MaybeStandardFPSCRValue(code, ctx, fpcr_controlled, [&] { code.cvtdq2ps(xmm, xmm); @@ -694,7 +694,7 @@ void EmitX64::EmitFPVectorFromSignedFixed64(EmitContext& ctx, IR::Inst* inst) { const int fbits = args[1].GetImmediateU8(); const FP::RoundingMode rounding_mode = static_cast(args[2].GetImmediateU8()); const bool fpcr_controlled = args[3].GetImmediateU1(); - ASSERT(rounding_mode == ctx.FPCR(fpcr_controlled).RMode()); + DEBUG_ASSERT(rounding_mode == ctx.FPCR(fpcr_controlled).RMode()); MaybeStandardFPSCRValue(code, ctx, fpcr_controlled, [&] { if (code.HasHostFeature(HostFeature::AVX512_OrthoFloat)) { @@ -745,7 +745,7 @@ void EmitX64::EmitFPVectorFromUnsignedFixed32(EmitContext& ctx, IR::Inst* inst) const int fbits = args[1].GetImmediateU8(); const FP::RoundingMode rounding_mode = static_cast(args[2].GetImmediateU8()); const bool fpcr_controlled = args[3].GetImmediateU1(); - ASSERT(rounding_mode == ctx.FPCR(fpcr_controlled).RMode()); + DEBUG_ASSERT(rounding_mode == ctx.FPCR(fpcr_controlled).RMode()); MaybeStandardFPSCRValue(code, ctx, fpcr_controlled, [&] { if (code.HasHostFeature(HostFeature::AVX512_Ortho)) { @@ -795,7 +795,7 @@ void EmitX64::EmitFPVectorFromUnsignedFixed64(EmitContext& ctx, IR::Inst* inst) const int fbits = args[1].GetImmediateU8(); const FP::RoundingMode rounding_mode = static_cast(args[2].GetImmediateU8()); const bool fpcr_controlled = args[3].GetImmediateU1(); - ASSERT(rounding_mode == ctx.FPCR(fpcr_controlled).RMode()); + DEBUG_ASSERT(rounding_mode == ctx.FPCR(fpcr_controlled).RMode()); MaybeStandardFPSCRValue(code, ctx, fpcr_controlled, [&] { if (code.HasHostFeature(HostFeature::AVX512_OrthoFloat)) { diff --git a/src/dynarmic/src/dynarmic/backend/x64/exception_handler_windows.cpp b/src/dynarmic/src/dynarmic/backend/x64/exception_handler_windows.cpp index 8d98d4e1fa..a3da2796fa 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/exception_handler_windows.cpp +++ b/src/dynarmic/src/dynarmic/backend/x64/exception_handler_windows.cpp @@ -104,7 +104,7 @@ static PrologueInformation GetPrologueInformation() { entry.code.OpInfo = reg; }; const auto alloc_large = [&](u8 offset, size_t size) { - ASSERT(size % 8 == 0); + DEBUG_ASSERT(size % 8 == 0); size /= 8; auto& entry = next_entry(); @@ -123,7 +123,7 @@ static PrologueInformation GetPrologueInformation() { } }; const auto save_xmm128 = [&](u8 offset, u8 reg, size_t frame_offset) { - ASSERT(frame_offset % 16 == 0); + DEBUG_ASSERT(frame_offset % 16 == 0); auto& entry = next_entry(); entry.code.CodeOffset = offset; @@ -165,7 +165,7 @@ static PrologueInformation GetPrologueInformation() { auto& last_entry = next_entry(); last_entry.FrameOffset = 0; } - ASSERT(ret.unwind_code.size() % 2 == 0); + DEBUG_ASSERT(ret.unwind_code.size() % 2 == 0); return ret; } diff --git a/src/dynarmic/src/dynarmic/backend/x64/hostloc.h b/src/dynarmic/src/dynarmic/backend/x64/hostloc.h index d62090d612..c0bbdf45f7 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/hostloc.h +++ b/src/dynarmic/src/dynarmic/backend/x64/hostloc.h @@ -78,12 +78,12 @@ constexpr bool HostLocIsFlag(HostLoc reg) { } constexpr HostLoc HostLocRegIdx(int idx) { - ASSERT(idx >= 0 && idx <= 15); + DEBUG_ASSERT(idx >= 0 && idx <= 15); return HostLoc(idx); } constexpr HostLoc HostLocXmmIdx(int idx) { - ASSERT(idx >= 0 && idx <= 15); + DEBUG_ASSERT(idx >= 0 && idx <= 15); return HostLoc(size_t(HostLoc::XMM0) + idx); } @@ -159,12 +159,12 @@ const std::bitset<32> any_xmm = BuildRegSet({ }); inline Xbyak::Reg64 HostLocToReg64(HostLoc loc) noexcept { - ASSERT(HostLocIsGPR(loc)); + DEBUG_ASSERT(HostLocIsGPR(loc)); return Xbyak::Reg64(int(loc)); } inline Xbyak::Xmm HostLocToXmm(HostLoc loc) noexcept { - ASSERT(HostLocIsXMM(loc)); + DEBUG_ASSERT(HostLocIsXMM(loc)); return Xbyak::Xmm(int(loc) - int(HostLoc::XMM0)); } diff --git a/src/dynarmic/src/dynarmic/backend/x64/reg_alloc.cpp b/src/dynarmic/src/dynarmic/backend/x64/reg_alloc.cpp index 5a828839c1..f9b1ba9b3d 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/reg_alloc.cpp +++ b/src/dynarmic/src/dynarmic/backend/x64/reg_alloc.cpp @@ -56,11 +56,11 @@ static inline bool IsValuelessType(const IR::Type type) noexcept { } void HostLocInfo::ReleaseOne() noexcept { - ASSERT(is_being_used_count > 0); + DEBUG_ASSERT(is_being_used_count > 0); --is_being_used_count; is_scratch = false; if (current_references > 0) { - ASSERT(size_t(accumulated_uses) + 1 < (std::numeric_limits::max)()); + DEBUG_ASSERT(size_t(accumulated_uses) + 1 < (std::numeric_limits::max)()); ++accumulated_uses; --current_references; if (current_references == 0) @@ -69,7 +69,7 @@ void HostLocInfo::ReleaseOne() noexcept { } void HostLocInfo::ReleaseAll() noexcept { - ASSERT(size_t(accumulated_uses) + current_references < (std::numeric_limits::max)()); + DEBUG_ASSERT(size_t(accumulated_uses) + current_references < (std::numeric_limits::max)()); accumulated_uses += current_references; current_references = 0; is_set_last_use = false; @@ -91,7 +91,7 @@ void HostLocInfo::AddValue(HostLoc loc, IR::Inst* inst) noexcept { } values.push_back(inst); - ASSERT(size_t(total_uses) + inst->UseCount() < (std::numeric_limits::max)()); + DEBUG_ASSERT(size_t(total_uses) + inst->UseCount() < (std::numeric_limits::max)()); total_uses += inst->UseCount(); max_bit_width = std::max(max_bit_width, std::countr_zero(GetBitWidth(inst->GetType()))); } @@ -129,24 +129,24 @@ bool Argument::GetImmediateU1() const noexcept { u8 Argument::GetImmediateU8() const noexcept { const u64 imm = value.GetImmediateAsU64(); - ASSERT(imm <= u64(std::numeric_limits::max())); + DEBUG_ASSERT(imm <= u64(std::numeric_limits::max())); return u8(imm); } u16 Argument::GetImmediateU16() const noexcept { const u64 imm = value.GetImmediateAsU64(); - ASSERT(imm <= u64(std::numeric_limits::max())); + DEBUG_ASSERT(imm <= u64(std::numeric_limits::max())); return u16(imm); } u32 Argument::GetImmediateU32() const noexcept { const u64 imm = value.GetImmediateAsU64(); - ASSERT(imm <= u64(std::numeric_limits::max())); + DEBUG_ASSERT(imm <= u64(std::numeric_limits::max())); return u32(imm); } u64 Argument::GetImmediateS32() const noexcept { - ASSERT(FitsInImmediateS32()); + DEBUG_ASSERT(FitsInImmediateS32()); return value.GetImmediateAsU64(); } @@ -155,12 +155,12 @@ u64 Argument::GetImmediateU64() const noexcept { } IR::Cond Argument::GetImmediateCond() const noexcept { - ASSERT(IsImmediate() && GetType() == IR::Type::Cond); + DEBUG_ASSERT(IsImmediate() && GetType() == IR::Type::Cond); return value.GetCond(); } IR::AccType Argument::GetImmediateAccType() const noexcept { - ASSERT(IsImmediate() && GetType() == IR::Type::AccType); + DEBUG_ASSERT(IsImmediate() && GetType() == IR::Type::AccType); return value.GetAccType(); } @@ -201,7 +201,7 @@ RegAlloc::ArgumentInfo RegAlloc::GetArgumentInfo(const IR::Inst* inst) noexcept ret[i].value = arg; if (!arg.IsImmediate() && !IsValuelessType(arg.GetType())) { auto const loc = ValueLocation(arg.GetInst()); - ASSERT(loc && "argument must already been defined"); + DEBUG_ASSERT(loc && "argument must already been defined"); LocInfo(*loc).AddArgReference(); } } @@ -209,7 +209,7 @@ RegAlloc::ArgumentInfo RegAlloc::GetArgumentInfo(const IR::Inst* inst) noexcept } void RegAlloc::RegisterPseudoOperation(const IR::Inst* inst) noexcept { - ASSERT(IsValueLive(inst) || !inst->HasUses()); + DEBUG_ASSERT(IsValueLive(inst) || !inst->HasUses()); for (size_t i = 0; i < inst->NumArgs(); i++) { auto const arg = inst->GetArg(i); if (!arg.IsImmediate() && !IsValuelessType(arg.GetType())) { @@ -222,37 +222,37 @@ void RegAlloc::RegisterPseudoOperation(const IR::Inst* inst) noexcept { } Xbyak::Reg64 RegAlloc::UseScratchGpr(BlockOfCode& code, Argument& arg) noexcept { - ASSERT(!arg.allocated); + DEBUG_ASSERT(!arg.allocated); arg.allocated = true; return HostLocToReg64(UseScratchImpl(code, arg.value, gpr_order)); } Xbyak::Xmm RegAlloc::UseScratchXmm(BlockOfCode& code, Argument& arg) noexcept { - ASSERT(!arg.allocated); + DEBUG_ASSERT(!arg.allocated); arg.allocated = true; return HostLocToXmm(UseScratchImpl(code, arg.value, xmm_order)); } void RegAlloc::UseScratch(BlockOfCode& code, Argument& arg, HostLoc host_loc) noexcept { - ASSERT(!arg.allocated); + DEBUG_ASSERT(!arg.allocated); arg.allocated = true; UseScratchImpl(code, arg.value, BuildRegSet({host_loc})); } void RegAlloc::DefineValue(BlockOfCode& code, IR::Inst* inst, const Xbyak::Reg& reg) noexcept { - ASSERT(reg.getKind() == Xbyak::Operand::XMM || reg.getKind() == Xbyak::Operand::REG); + DEBUG_ASSERT(reg.getKind() == Xbyak::Operand::XMM || reg.getKind() == Xbyak::Operand::REG); const auto hostloc = static_cast(reg.getIdx() + static_cast(reg.getKind() == Xbyak::Operand::XMM ? HostLoc::XMM0 : HostLoc::RAX)); DefineValueImpl(code, inst, hostloc); } void RegAlloc::DefineValue(BlockOfCode& code, IR::Inst* inst, Argument& arg) noexcept { - ASSERT(!arg.allocated); + DEBUG_ASSERT(!arg.allocated); arg.allocated = true; DefineValueImpl(code, inst, arg.value); } void RegAlloc::Release(const Xbyak::Reg& reg) noexcept { - ASSERT(reg.getKind() == Xbyak::Operand::XMM || reg.getKind() == Xbyak::Operand::REG); + DEBUG_ASSERT(reg.getKind() == Xbyak::Operand::XMM || reg.getKind() == Xbyak::Operand::REG); const auto hostloc = static_cast(reg.getIdx() + static_cast(reg.getKind() == Xbyak::Operand::XMM ? HostLoc::XMM0 : HostLoc::RAX)); LocInfo(hostloc).ReleaseOne(); } @@ -382,15 +382,15 @@ void RegAlloc::HostCall( } void RegAlloc::AllocStackSpace(BlockOfCode& code, const size_t stack_space) noexcept { - ASSERT(stack_space < size_t((std::numeric_limits::max)())); - ASSERT(reserved_stack_space == 0); + DEBUG_ASSERT(stack_space < size_t((std::numeric_limits::max)())); + DEBUG_ASSERT(reserved_stack_space == 0); reserved_stack_space = stack_space; code.sub(code.rsp, u32(stack_space)); } void RegAlloc::ReleaseStackSpace(BlockOfCode& code, const size_t stack_space) noexcept { - ASSERT(stack_space < size_t((std::numeric_limits::max)())); - ASSERT(reserved_stack_space == stack_space); + DEBUG_ASSERT(stack_space < size_t((std::numeric_limits::max)())); + DEBUG_ASSERT(reserved_stack_space == stack_space); reserved_stack_space = 0; code.add(code.rsp, u32(stack_space)); } @@ -449,7 +449,7 @@ HostLoc RegAlloc::SelectARegister(std::bitset<32> desired_locations) const noexc auto const it_final = it_empty_candidate != HostLoc::FirstSpill ? it_empty_candidate : it_candidate != HostLoc::FirstSpill ? it_candidate : it_rex_candidate; - ASSERT(it_final != HostLoc::FirstSpill && "All candidate registers have already been allocated"); + DEBUG_ASSERT(it_final != HostLoc::FirstSpill && "All candidate registers have already been allocated"); // Evil magic - increment LRU counter (will wrap at 256) const_cast(this)->LocInfo(HostLoc(it_final)).lru_counter++; return HostLoc(it_final); @@ -459,26 +459,26 @@ std::optional RegAlloc::ValueLocation(const IR::Inst* value) const noex for (size_t i = 0; i < hostloc_info.size(); i++) if (hostloc_info[i].ContainsValue(value)) { //for (size_t j = 0; j < hostloc_info.size(); ++j) - // ASSERT((i == j || !hostloc_info[j].ContainsValue(value)) && "duplicate defs"); + // DEBUG_ASSERT((i == j || !hostloc_info[j].ContainsValue(value)) && "duplicate defs"); return HostLoc(i); } return std::nullopt; } void RegAlloc::DefineValueImpl(BlockOfCode& code, IR::Inst* def_inst, HostLoc host_loc) noexcept { - ASSERT(!ValueLocation(def_inst) && "def_inst has already been defined"); + DEBUG_ASSERT(!ValueLocation(def_inst) && "def_inst has already been defined"); LocInfo(host_loc).AddValue(host_loc, def_inst); - ASSERT(*ValueLocation(def_inst) == host_loc); + DEBUG_ASSERT(*ValueLocation(def_inst) == host_loc); } void RegAlloc::DefineValueImpl(BlockOfCode& code, IR::Inst* def_inst, const IR::Value& use_inst) noexcept { - ASSERT(!ValueLocation(def_inst) && "def_inst has already been defined"); + DEBUG_ASSERT(!ValueLocation(def_inst) && "def_inst has already been defined"); if (use_inst.IsImmediate()) { const HostLoc location = ScratchImpl(code, gpr_order); DefineValueImpl(code, def_inst, location); LoadImmediate(code, use_inst, location); } else { - ASSERT(ValueLocation(use_inst.GetInst()) && "use_inst must already be defined"); + DEBUG_ASSERT(ValueLocation(use_inst.GetInst()) && "use_inst must already be defined"); const HostLoc location = *ValueLocation(use_inst.GetInst()); DefineValueImpl(code, def_inst, location); } @@ -486,22 +486,22 @@ void RegAlloc::DefineValueImpl(BlockOfCode& code, IR::Inst* def_inst, const IR:: void RegAlloc::Move(BlockOfCode& code, HostLoc to, HostLoc from) noexcept { const size_t bit_width = LocInfo(from).GetMaxBitWidth(); - ASSERT(LocInfo(to).IsEmpty() && !LocInfo(from).IsLocked()); - ASSERT(bit_width <= HostLocBitWidth(to)); - ASSERT(!LocInfo(from).IsEmpty() && "Mov eliminated"); + DEBUG_ASSERT(LocInfo(to).IsEmpty() && !LocInfo(from).IsLocked()); + DEBUG_ASSERT(bit_width <= HostLocBitWidth(to)); + DEBUG_ASSERT(!LocInfo(from).IsEmpty() && "Mov eliminated"); EmitMove(code, bit_width, to, from); LocInfo(to) = std::exchange(LocInfo(from), {}); } void RegAlloc::CopyToScratch(BlockOfCode& code, size_t bit_width, HostLoc to, HostLoc from) noexcept { - ASSERT(LocInfo(to).IsEmpty() && !LocInfo(from).IsEmpty()); + DEBUG_ASSERT(LocInfo(to).IsEmpty() && !LocInfo(from).IsEmpty()); EmitMove(code, bit_width, to, from); } void RegAlloc::Exchange(BlockOfCode& code, HostLoc a, HostLoc b) noexcept { - ASSERT(!LocInfo(a).IsLocked() && !LocInfo(b).IsLocked()); - ASSERT(LocInfo(a).GetMaxBitWidth() <= HostLocBitWidth(b)); - ASSERT(LocInfo(b).GetMaxBitWidth() <= HostLocBitWidth(a)); + DEBUG_ASSERT(!LocInfo(a).IsLocked() && !LocInfo(b).IsLocked()); + DEBUG_ASSERT(LocInfo(a).GetMaxBitWidth() <= HostLocBitWidth(b)); + DEBUG_ASSERT(LocInfo(b).GetMaxBitWidth() <= HostLocBitWidth(a)); if (LocInfo(a).IsEmpty()) { Move(code, a, b); @@ -514,16 +514,16 @@ void RegAlloc::Exchange(BlockOfCode& code, HostLoc a, HostLoc b) noexcept { } void RegAlloc::MoveOutOfTheWay(BlockOfCode& code, HostLoc reg) noexcept { - ASSERT(!LocInfo(reg).IsLocked()); + DEBUG_ASSERT(!LocInfo(reg).IsLocked()); if (!LocInfo(reg).IsEmpty()) { SpillRegister(code, reg); } } void RegAlloc::SpillRegister(BlockOfCode& code, HostLoc loc) noexcept { - ASSERT(HostLocIsRegister(loc) && "Only registers can be spilled"); - ASSERT(!LocInfo(loc).IsEmpty() && "There is no need to spill unoccupied registers"); - ASSERT(!LocInfo(loc).IsLocked() && "Registers that have been allocated must not be spilt"); + DEBUG_ASSERT(HostLocIsRegister(loc) && "Only registers can be spilled"); + DEBUG_ASSERT(!LocInfo(loc).IsEmpty() && "There is no need to spill unoccupied registers"); + DEBUG_ASSERT(!LocInfo(loc).IsLocked() && "Registers that have been allocated must not be spilt"); auto const new_loc = FindFreeSpill(HostLocIsXMM(loc)); Move(code, new_loc, loc); } @@ -559,7 +559,7 @@ HostLoc RegAlloc::FindFreeSpill(bool is_xmm) const noexcept { }() HostLoc RegAlloc::LoadImmediate(BlockOfCode& code, IR::Value imm, HostLoc host_loc) noexcept { - ASSERT(imm.IsImmediate() && "imm is not an immediate"); + DEBUG_ASSERT(imm.IsImmediate() && "imm is not an immediate"); if (HostLocIsGPR(host_loc)) { const Xbyak::Reg64 reg = HostLocToReg64(host_loc); const u64 imm_value = imm.GetImmediateAsU64(); @@ -584,9 +584,9 @@ HostLoc RegAlloc::LoadImmediate(BlockOfCode& code, IR::Value imm, HostLoc host_l void RegAlloc::EmitMove(BlockOfCode& code, const size_t bit_width, const HostLoc to, const HostLoc from) noexcept { auto const spill_to_op_arg_helper = [&](HostLoc loc, size_t reserved_stack_space) { - ASSERT(HostLocIsSpill(loc)); + DEBUG_ASSERT(HostLocIsSpill(loc)); size_t i = size_t(loc) - size_t(HostLoc::FirstSpill); - ASSERT(i < SpillCount && "Spill index greater than number of available spill locations"); + DEBUG_ASSERT(i < SpillCount && "Spill index greater than number of available spill locations"); return Xbyak::util::rsp + reserved_stack_space + ABI_SHADOW_SPACE + offsetof(StackLayout, spill) + i * sizeof(StackLayout::spill[0]); }; auto const spill_xmm_to_op = [&](const HostLoc loc) { @@ -595,21 +595,21 @@ void RegAlloc::EmitMove(BlockOfCode& code, const size_t bit_width, const HostLoc if (HostLocIsXMM(to) && HostLocIsXMM(from)) { MAYBE_AVX(movaps, HostLocToXmm(to), HostLocToXmm(from)); } else if (HostLocIsGPR(to) && HostLocIsGPR(from)) { - ASSERT(bit_width != 128); + DEBUG_ASSERT(bit_width != 128); if (bit_width == 64) { code.mov(HostLocToReg64(to), HostLocToReg64(from)); } else { code.mov(HostLocToReg64(to).cvt32(), HostLocToReg64(from).cvt32()); } } else if (HostLocIsXMM(to) && HostLocIsGPR(from)) { - ASSERT(bit_width != 128); + DEBUG_ASSERT(bit_width != 128); if (bit_width == 64) { MAYBE_AVX(movq, HostLocToXmm(to), HostLocToReg64(from)); } else { MAYBE_AVX(movd, HostLocToXmm(to), HostLocToReg64(from).cvt32()); } } else if (HostLocIsGPR(to) && HostLocIsXMM(from)) { - ASSERT(bit_width != 128); + DEBUG_ASSERT(bit_width != 128); if (bit_width == 64) { MAYBE_AVX(movq, HostLocToReg64(to), HostLocToXmm(from)); } else { @@ -617,7 +617,7 @@ void RegAlloc::EmitMove(BlockOfCode& code, const size_t bit_width, const HostLoc } } else if (HostLocIsXMM(to) && HostLocIsSpill(from)) { const Xbyak::Address spill_addr = spill_xmm_to_op(from); - ASSERT(spill_addr.getBit() >= bit_width); + DEBUG_ASSERT(spill_addr.getBit() >= bit_width); switch (bit_width) { case 128: MAYBE_AVX(movaps, HostLocToXmm(to), spill_addr); @@ -635,7 +635,7 @@ void RegAlloc::EmitMove(BlockOfCode& code, const size_t bit_width, const HostLoc } } else if (HostLocIsSpill(to) && HostLocIsXMM(from)) { const Xbyak::Address spill_addr = spill_xmm_to_op(to); - ASSERT(spill_addr.getBit() >= bit_width); + DEBUG_ASSERT(spill_addr.getBit() >= bit_width); switch (bit_width) { case 128: MAYBE_AVX(movaps, spill_addr, HostLocToXmm(from)); @@ -652,14 +652,14 @@ void RegAlloc::EmitMove(BlockOfCode& code, const size_t bit_width, const HostLoc UNREACHABLE(); } } else if (HostLocIsGPR(to) && HostLocIsSpill(from)) { - ASSERT(bit_width != 128); + DEBUG_ASSERT(bit_width != 128); if (bit_width == 64) { code.mov(HostLocToReg64(to), Xbyak::util::qword[spill_to_op_arg_helper(from, reserved_stack_space)]); } else { code.mov(HostLocToReg64(to).cvt32(), Xbyak::util::dword[spill_to_op_arg_helper(from, reserved_stack_space)]); } } else if (HostLocIsSpill(to) && HostLocIsGPR(from)) { - ASSERT(bit_width != 128); + DEBUG_ASSERT(bit_width != 128); if (bit_width == 64) { code.mov(Xbyak::util::qword[spill_to_op_arg_helper(to, reserved_stack_space)], HostLocToReg64(from)); } else { @@ -672,7 +672,7 @@ void RegAlloc::EmitMove(BlockOfCode& code, const size_t bit_width, const HostLoc #undef MAYBE_AVX void RegAlloc::EmitExchange(BlockOfCode& code, const HostLoc a, const HostLoc b) noexcept { - ASSERT(HostLocIsGPR(a) && HostLocIsGPR(b) && "Exchanging XMM registers is uneeded OR invalid emit"); + DEBUG_ASSERT(HostLocIsGPR(a) && HostLocIsGPR(b) && "Exchanging XMM registers is uneeded OR invalid emit"); code.xchg(HostLocToReg64(a), HostLocToReg64(b)); } diff --git a/src/dynarmic/src/dynarmic/backend/x64/reg_alloc.h b/src/dynarmic/src/dynarmic/backend/x64/reg_alloc.h index 455c6a970a..7c3dca65fc 100644 --- a/src/dynarmic/src/dynarmic/backend/x64/reg_alloc.h +++ b/src/dynarmic/src/dynarmic/backend/x64/reg_alloc.h @@ -49,19 +49,19 @@ public: return is_being_used_count == 0 && current_references == 1 && size_t(accumulated_uses) + 1 == size_t(total_uses); } inline void ReadLock() noexcept { - ASSERT(size_t(is_being_used_count) + 1 < (std::numeric_limits::max)()); - ASSERT(!bool(is_scratch)); + DEBUG_ASSERT(size_t(is_being_used_count) + 1 < (std::numeric_limits::max)()); + DEBUG_ASSERT(!bool(is_scratch)); is_being_used_count++; } inline void WriteLock() noexcept { - ASSERT(is_being_used_count == 0); + DEBUG_ASSERT(is_being_used_count == 0); is_being_used_count++; is_scratch = true; } inline void AddArgReference() noexcept { - ASSERT(size_t(current_references) + 1 < (std::numeric_limits::max)()); + DEBUG_ASSERT(size_t(current_references) + 1 < (std::numeric_limits::max)()); ++current_references; - ASSERT(size_t(accumulated_uses) + current_references <= size_t(total_uses)); + DEBUG_ASSERT(size_t(accumulated_uses) + current_references <= size_t(total_uses)); } void ReleaseOne() noexcept; void ReleaseAll() noexcept; @@ -147,12 +147,12 @@ public: return !!ValueLocation(inst); } inline Xbyak::Reg64 UseGpr(BlockOfCode& code, Argument& arg) noexcept { - ASSERT(!arg.allocated); + DEBUG_ASSERT(!arg.allocated); arg.allocated = true; return HostLocToReg64(UseImpl(code, arg.value, gpr_order)); } inline Xbyak::Xmm UseXmm(BlockOfCode& code, Argument& arg) noexcept { - ASSERT(!arg.allocated); + DEBUG_ASSERT(!arg.allocated); arg.allocated = true; return HostLocToXmm(UseImpl(code, arg.value, xmm_order)); } @@ -160,7 +160,7 @@ public: return UseGpr(code, arg); } inline void Use(BlockOfCode& code, Argument& arg, const HostLoc host_loc) noexcept { - ASSERT(!arg.allocated); + DEBUG_ASSERT(!arg.allocated); arg.allocated = true; UseImpl(code, arg.value, BuildRegSet({host_loc})); } @@ -205,7 +205,7 @@ public: iter.ReleaseAll(); } inline void AssertNoMoreUses() noexcept { - ASSERT(std::all_of(hostloc_info.begin(), hostloc_info.end(), [](const auto& i) noexcept { return i.IsEmpty(); })); + DEBUG_ASSERT(std::all_of(hostloc_info.begin(), hostloc_info.end(), [](const auto& i) noexcept { return i.IsEmpty(); })); } #ifndef NDEBUG inline void EmitVerboseDebuggingOutput(BlockOfCode& code) noexcept { diff --git a/src/dynarmic/src/dynarmic/common/fp/fpcr.h b/src/dynarmic/src/dynarmic/common/fp/fpcr.h index 038800c7c2..cc264dc6a4 100644 --- a/src/dynarmic/src/dynarmic/common/fp/fpcr.h +++ b/src/dynarmic/src/dynarmic/common/fp/fpcr.h @@ -73,7 +73,7 @@ public: /// Set rounding mode control field. void RMode(FP::RoundingMode rounding_mode) { - ASSERT(static_cast(rounding_mode) <= 0b11 && "FPCR: Invalid rounding mode"); + DEBUG_ASSERT(static_cast(rounding_mode) <= 0b11 && "FPCR: Invalid rounding mode"); value = mcl::bit::set_bits<22, 23>(value, static_cast(rounding_mode)); } @@ -93,7 +93,7 @@ public: /// Set the stride of a vector when executing AArch32 VFP instructions. /// This field has no function in AArch64 state. void Stride(size_t stride) { - ASSERT(stride >= 1 && stride <= 2 && "FPCR: Invalid stride"); + DEBUG_ASSERT(stride >= 1 && stride <= 2 && "FPCR: Invalid stride"); value = mcl::bit::set_bits<20, 21>(value, stride == 1 ? 0b00u : 0b11u); } @@ -116,7 +116,7 @@ public: /// Sets the length of a vector when executing AArch32 VFP instructions. /// This field has no function in AArch64 state. void Len(size_t len) { - ASSERT(len >= 1 && len <= 8 && "FPCR: Invalid len"); + DEBUG_ASSERT(len >= 1 && len <= 8 && "FPCR: Invalid len"); value = mcl::bit::set_bits<16, 18>(value, static_cast(len - 1)); } diff --git a/src/dynarmic/src/dynarmic/common/fp/op/FPRoundInt.cpp b/src/dynarmic/src/dynarmic/common/fp/op/FPRoundInt.cpp index 426c66efec..b0dc6304ab 100644 --- a/src/dynarmic/src/dynarmic/common/fp/op/FPRoundInt.cpp +++ b/src/dynarmic/src/dynarmic/common/fp/op/FPRoundInt.cpp @@ -26,7 +26,7 @@ namespace Dynarmic::FP { template u64 FPRoundInt(FPT op, FPCR fpcr, RoundingMode rounding, bool exact, FPSR& fpsr) { - ASSERT(rounding != RoundingMode::ToOdd); + DEBUG_ASSERT(rounding != RoundingMode::ToOdd); auto [type, sign, value] = FPUnpack(op, fpcr, fpsr); diff --git a/src/dynarmic/src/dynarmic/common/fp/op/FPToFixed.cpp b/src/dynarmic/src/dynarmic/common/fp/op/FPToFixed.cpp index 7c322050c3..3d4aeb07e2 100644 --- a/src/dynarmic/src/dynarmic/common/fp/op/FPToFixed.cpp +++ b/src/dynarmic/src/dynarmic/common/fp/op/FPToFixed.cpp @@ -25,9 +25,9 @@ namespace Dynarmic::FP { template u64 FPToFixed(size_t ibits, FPT op, size_t fbits, bool unsigned_, FPCR fpcr, RoundingMode rounding, FPSR& fpsr) { - ASSERT(rounding != RoundingMode::ToOdd); - ASSERT(ibits <= 64); - ASSERT(fbits <= ibits); + DEBUG_ASSERT(rounding != RoundingMode::ToOdd); + DEBUG_ASSERT(ibits <= 64); + DEBUG_ASSERT(fbits <= ibits); auto [type, sign, value] = FPUnpack(op, fpcr, fpsr); diff --git a/src/dynarmic/src/dynarmic/common/fp/process_exception.cpp b/src/dynarmic/src/dynarmic/common/fp/process_exception.cpp index 2fee438246..34f1033e02 100644 --- a/src/dynarmic/src/dynarmic/common/fp/process_exception.cpp +++ b/src/dynarmic/src/dynarmic/common/fp/process_exception.cpp @@ -18,27 +18,27 @@ namespace Dynarmic::FP { void FPProcessException(FPExc exception, FPCR fpcr, FPSR& fpsr) { switch (exception) { case FPExc::InvalidOp: - ASSERT(!fpcr.IOE() && "Raising floating point exceptions unimplemented"); + DEBUG_ASSERT(!fpcr.IOE() && "Raising floating point exceptions unimplemented"); fpsr.IOC(true); break; case FPExc::DivideByZero: - ASSERT(!fpcr.DZE() && "Raising floating point exceptions unimplemented"); + DEBUG_ASSERT(!fpcr.DZE() && "Raising floating point exceptions unimplemented"); fpsr.DZC(true); break; case FPExc::Overflow: - ASSERT(!fpcr.OFE() && "Raising floating point exceptions unimplemented"); + DEBUG_ASSERT(!fpcr.OFE() && "Raising floating point exceptions unimplemented"); fpsr.OFC(true); break; case FPExc::Underflow: - ASSERT(!fpcr.UFE() && "Raising floating point exceptions unimplemented"); + DEBUG_ASSERT(!fpcr.UFE() && "Raising floating point exceptions unimplemented"); fpsr.UFC(true); break; case FPExc::Inexact: - ASSERT(!fpcr.IXE() && "Raising floating point exceptions unimplemented"); + DEBUG_ASSERT(!fpcr.IXE() && "Raising floating point exceptions unimplemented"); fpsr.IXC(true); break; case FPExc::InputDenorm: - ASSERT(!fpcr.IDE() && "Raising floating point exceptions unimplemented"); + DEBUG_ASSERT(!fpcr.IDE() && "Raising floating point exceptions unimplemented"); fpsr.IDC(true); break; default: diff --git a/src/dynarmic/src/dynarmic/common/fp/process_nan.cpp b/src/dynarmic/src/dynarmic/common/fp/process_nan.cpp index acc9c329e8..fb8538de03 100644 --- a/src/dynarmic/src/dynarmic/common/fp/process_nan.cpp +++ b/src/dynarmic/src/dynarmic/common/fp/process_nan.cpp @@ -23,7 +23,7 @@ namespace Dynarmic::FP { template FPT FPProcessNaN(FPType type, FPT op, FPCR fpcr, FPSR& fpsr) { - ASSERT(type == FPType::QNaN || type == FPType::SNaN); + DEBUG_ASSERT(type == FPType::QNaN || type == FPType::SNaN); constexpr size_t topfrac = FPInfo::explicit_mantissa_width - 1; diff --git a/src/dynarmic/src/dynarmic/common/fp/unpacked.cpp b/src/dynarmic/src/dynarmic/common/fp/unpacked.cpp index d6bb615cb4..fafa998ef8 100644 --- a/src/dynarmic/src/dynarmic/common/fp/unpacked.cpp +++ b/src/dynarmic/src/dynarmic/common/fp/unpacked.cpp @@ -85,8 +85,8 @@ std::tuple Normalize(FPUnpacked op, int extra_rig template FPT FPRoundBase(FPUnpacked op, FPCR fpcr, RoundingMode rounding, FPSR& fpsr) { - ASSERT(op.mantissa != 0); - ASSERT(rounding != RoundingMode::ToNearest_TieAwayFromZero); + DEBUG_ASSERT(op.mantissa != 0); + DEBUG_ASSERT(rounding != RoundingMode::ToNearest_TieAwayFromZero); constexpr int minimum_exp = FPInfo::exponent_min; constexpr size_t E = FPInfo::exponent_width; diff --git a/src/dynarmic/src/dynarmic/common/llvm_disassemble.cpp b/src/dynarmic/src/dynarmic/common/llvm_disassemble.cpp index 6896b43d62..c9d4dc6497 100644 --- a/src/dynarmic/src/dynarmic/common/llvm_disassemble.cpp +++ b/src/dynarmic/src/dynarmic/common/llvm_disassemble.cpp @@ -35,7 +35,7 @@ std::string DisassembleX64(const void* begin, const void* end) { while (pos < end) { char buffer[80]; size_t inst_size = LLVMDisasmInstruction(llvm_ctx, const_cast(pos), remaining, reinterpret_cast(pos), buffer, sizeof(buffer)); - ASSERT(inst_size); + DEBUG_ASSERT(inst_size); for (const u8* i = pos; i < pos + inst_size; i++) result += fmt::format("{:02x} ", *i); for (size_t i = inst_size; i < 10; i++) diff --git a/src/dynarmic/src/dynarmic/frontend/A32/a32_ir_emitter.cpp b/src/dynarmic/src/dynarmic/frontend/A32/a32_ir_emitter.cpp index 7848539186..4d02f9158c 100644 --- a/src/dynarmic/src/dynarmic/frontend/A32/a32_ir_emitter.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A32/a32_ir_emitter.cpp @@ -64,12 +64,12 @@ IR::U32U64 IREmitter::GetExtendedRegister(ExtReg reg) { } IR::U128 IREmitter::GetVector(ExtReg reg) { - ASSERT(A32::IsDoubleExtReg(reg) || A32::IsQuadExtReg(reg)); + DEBUG_ASSERT(A32::IsDoubleExtReg(reg) || A32::IsQuadExtReg(reg)); return Inst(Opcode::A32GetVector, IR::Value(reg)); } void IREmitter::SetRegister(const Reg reg, const IR::U32& value) { - ASSERT(reg != A32::Reg::PC); + DEBUG_ASSERT(reg != A32::Reg::PC); Inst(Opcode::A32SetRegister, IR::Value(reg), value); } @@ -84,7 +84,7 @@ void IREmitter::SetExtendedRegister(const ExtReg reg, const IR::U32U64& value) { } void IREmitter::SetVector(ExtReg reg, const IR::U128& value) { - ASSERT(A32::IsDoubleExtReg(reg) || A32::IsQuadExtReg(reg)); + DEBUG_ASSERT(A32::IsDoubleExtReg(reg) || A32::IsQuadExtReg(reg)); Inst(Opcode::A32SetVector, IR::Value(reg), value); } @@ -361,7 +361,7 @@ IR::U32 IREmitter::ExclusiveWriteMemory64(const IR::U32& vaddr, const IR::U32& v } void IREmitter::CoprocInternalOperation(size_t coproc_no, bool two, size_t opc1, CoprocReg CRd, CoprocReg CRn, CoprocReg CRm, size_t opc2) { - ASSERT(coproc_no <= 15); + DEBUG_ASSERT(coproc_no <= 15); const IR::Value::CoprocessorInfo coproc_info{static_cast(coproc_no), static_cast(two ? 1 : 0), static_cast(opc1), @@ -373,7 +373,7 @@ void IREmitter::CoprocInternalOperation(size_t coproc_no, bool two, size_t opc1, } void IREmitter::CoprocSendOneWord(size_t coproc_no, bool two, size_t opc1, CoprocReg CRn, CoprocReg CRm, size_t opc2, const IR::U32& word) { - ASSERT(coproc_no <= 15); + DEBUG_ASSERT(coproc_no <= 15); const IR::Value::CoprocessorInfo coproc_info{static_cast(coproc_no), static_cast(two ? 1 : 0), static_cast(opc1), @@ -384,7 +384,7 @@ void IREmitter::CoprocSendOneWord(size_t coproc_no, bool two, size_t opc1, Copro } void IREmitter::CoprocSendTwoWords(size_t coproc_no, bool two, size_t opc, CoprocReg CRm, const IR::U32& word1, const IR::U32& word2) { - ASSERT(coproc_no <= 15); + DEBUG_ASSERT(coproc_no <= 15); const IR::Value::CoprocessorInfo coproc_info{static_cast(coproc_no), static_cast(two ? 1 : 0), static_cast(opc), @@ -393,7 +393,7 @@ void IREmitter::CoprocSendTwoWords(size_t coproc_no, bool two, size_t opc, Copro } IR::U32 IREmitter::CoprocGetOneWord(size_t coproc_no, bool two, size_t opc1, CoprocReg CRn, CoprocReg CRm, size_t opc2) { - ASSERT(coproc_no <= 15); + DEBUG_ASSERT(coproc_no <= 15); const IR::Value::CoprocessorInfo coproc_info{static_cast(coproc_no), static_cast(two ? 1 : 0), static_cast(opc1), @@ -404,7 +404,7 @@ IR::U32 IREmitter::CoprocGetOneWord(size_t coproc_no, bool two, size_t opc1, Cop } IR::U64 IREmitter::CoprocGetTwoWords(size_t coproc_no, bool two, size_t opc, CoprocReg CRm) { - ASSERT(coproc_no <= 15); + DEBUG_ASSERT(coproc_no <= 15); const IR::Value::CoprocessorInfo coproc_info{static_cast(coproc_no), static_cast(two ? 1 : 0), static_cast(opc), @@ -413,7 +413,7 @@ IR::U64 IREmitter::CoprocGetTwoWords(size_t coproc_no, bool two, size_t opc, Cop } void IREmitter::CoprocLoadWords(size_t coproc_no, bool two, bool long_transfer, CoprocReg CRd, const IR::U32& address, bool has_option, u8 option) { - ASSERT(coproc_no <= 15); + DEBUG_ASSERT(coproc_no <= 15); const IR::Value::CoprocessorInfo coproc_info{static_cast(coproc_no), static_cast(two ? 1 : 0), static_cast(long_transfer ? 1 : 0), @@ -424,7 +424,7 @@ void IREmitter::CoprocLoadWords(size_t coproc_no, bool two, bool long_transfer, } void IREmitter::CoprocStoreWords(size_t coproc_no, bool two, bool long_transfer, CoprocReg CRd, const IR::U32& address, bool has_option, u8 option) { - ASSERT(coproc_no <= 15); + DEBUG_ASSERT(coproc_no <= 15); const IR::Value::CoprocessorInfo coproc_info{static_cast(coproc_no), static_cast(two ? 1 : 0), static_cast(long_transfer ? 1 : 0), diff --git a/src/dynarmic/src/dynarmic/frontend/A32/a32_types.h b/src/dynarmic/src/dynarmic/frontend/A32/a32_types.h index 957c643f56..b564cc04ad 100644 --- a/src/dynarmic/src/dynarmic/frontend/A32/a32_types.h +++ b/src/dynarmic/src/dynarmic/frontend/A32/a32_types.h @@ -85,7 +85,7 @@ constexpr bool IsQuadExtReg(ExtReg reg) { } inline size_t RegNumber(Reg reg) { - ASSERT(reg != Reg::INVALID_REG); + DEBUG_ASSERT(reg != Reg::INVALID_REG); return size_t(reg); } @@ -95,13 +95,13 @@ inline size_t RegNumber(ExtReg reg) { } else if (IsDoubleExtReg(reg)) { return size_t(reg) - size_t(ExtReg::D0); } - ASSERT(IsQuadExtReg(reg)); + DEBUG_ASSERT(IsQuadExtReg(reg)); return size_t(reg) - size_t(ExtReg::Q0); } inline Reg operator+(Reg reg, size_t number) { const size_t new_reg = RegNumber(reg) + number; - ASSERT(new_reg <= 15); + DEBUG_ASSERT(new_reg <= 15); return static_cast(new_reg); } @@ -109,7 +109,7 @@ inline Reg operator+(Reg reg, size_t number) { inline ExtReg operator+(ExtReg reg, size_t number) { const auto new_reg = static_cast(static_cast(reg) + number); - ASSERT((IsSingleExtReg(reg) && IsSingleExtReg(new_reg)) + DEBUG_ASSERT((IsSingleExtReg(reg) && IsSingleExtReg(new_reg)) || (IsDoubleExtReg(reg) && IsDoubleExtReg(new_reg)) || (IsQuadExtReg(reg) && IsQuadExtReg(new_reg))); diff --git a/src/dynarmic/src/dynarmic/frontend/A32/translate/conditional_state.cpp b/src/dynarmic/src/dynarmic/frontend/A32/translate/conditional_state.cpp index 64e6bf2c7c..d14c43af3b 100644 --- a/src/dynarmic/src/dynarmic/frontend/A32/translate/conditional_state.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A32/translate/conditional_state.cpp @@ -21,7 +21,7 @@ namespace Dynarmic::A32 { bool CondCanContinue(const ConditionalState cond_state, const A32::IREmitter& ir) { - ASSERT(cond_state != ConditionalState::Break && "Should never happen."); + DEBUG_ASSERT(cond_state != ConditionalState::Break && "Should never happen."); if (cond_state == ConditionalState::None) return true; @@ -32,7 +32,7 @@ bool CondCanContinue(const ConditionalState cond_state, const A32::IREmitter& ir } bool IsConditionPassed(TranslatorVisitor& v, IR::Cond cond) { - ASSERT(v.cond_state != ConditionalState::Break && "This should never happen. We requested a break but that wasn't honored."); + DEBUG_ASSERT(v.cond_state != ConditionalState::Break && "This should never happen. We requested a break but that wasn't honored."); if (cond == IR::Cond::NV) { // NV conditional is obsolete diff --git a/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/a32_translate_impl.cpp b/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/a32_translate_impl.cpp index f5d1830769..4f8102b8ef 100644 --- a/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/a32_translate_impl.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/a32_translate_impl.cpp @@ -29,7 +29,7 @@ bool TranslatorVisitor::ThumbConditionPassed() { bool TranslatorVisitor::VFPConditionPassed(Cond cond) { if (ir.current_location.TFlag()) { - ASSERT(cond == Cond::AL); + DEBUG_ASSERT(cond == Cond::AL); return true; } return ArmConditionPassed(cond); diff --git a/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/asimd_two_regs_shift.cpp b/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/asimd_two_regs_shift.cpp index 4b653c0455..899a807e18 100644 --- a/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/asimd_two_regs_shift.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/asimd_two_regs_shift.cpp @@ -130,7 +130,7 @@ bool ShiftRightNarrowing(TranslatorVisitor& v, bool D, size_t imm6, size_t Vd, b } return v.ir.VectorUnsignedSaturatedNarrow(source_esize, wide_result); case Narrowing::SaturateToSigned: - ASSERT(signedness == Signedness::Signed); + DEBUG_ASSERT(signedness == Signedness::Signed); return v.ir.VectorSignedSaturatedNarrowToSigned(source_esize, wide_result); } UNREACHABLE(); diff --git a/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/load_store.cpp b/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/load_store.cpp index 208e7d1122..505d5205d7 100644 --- a/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/load_store.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/load_store.cpp @@ -95,7 +95,7 @@ bool TranslatorVisitor::arm_LDR_imm(Cond cond, bool P, bool U, bool W, Reg n, Re return UnpredictableInstruction(); } - ASSERT(!(!P && W) && "T form of instruction unimplemented"); + DEBUG_ASSERT(!(!P && W) && "T form of instruction unimplemented"); if ((!P || W) && n == t) { return UnpredictableInstruction(); } @@ -126,7 +126,7 @@ bool TranslatorVisitor::arm_LDR_imm(Cond cond, bool P, bool U, bool W, Reg n, Re // LDR , [, #+/-]{!} // LDR , [], #+/- bool TranslatorVisitor::arm_LDR_reg(Cond cond, bool P, bool U, bool W, Reg n, Reg t, Imm<5> imm5, ShiftType shift, Reg m) { - ASSERT(!(!P && W) && "T form of instruction unimplemented"); + DEBUG_ASSERT(!(!P && W) && "T form of instruction unimplemented"); if (m == Reg::PC) { return UnpredictableInstruction(); } @@ -184,7 +184,7 @@ bool TranslatorVisitor::arm_LDRB_imm(Cond cond, bool P, bool U, bool W, Reg n, R return UnpredictableInstruction(); } - ASSERT(!(!P && W) && "T form of instruction unimplemented"); + DEBUG_ASSERT(!(!P && W) && "T form of instruction unimplemented"); if ((!P || W) && n == t) { return UnpredictableInstruction(); } @@ -209,7 +209,7 @@ bool TranslatorVisitor::arm_LDRB_imm(Cond cond, bool P, bool U, bool W, Reg n, R // LDRB , [, #+/-]{!} // LDRB , [], #+/- bool TranslatorVisitor::arm_LDRB_reg(Cond cond, bool P, bool U, bool W, Reg n, Reg t, Imm<5> imm5, ShiftType shift, Reg m) { - ASSERT(!(!P && W) && "T form of instruction unimplemented"); + DEBUG_ASSERT(!(!P && W) && "T form of instruction unimplemented"); if (t == Reg::PC || m == Reg::PC) { return UnpredictableInstruction(); } @@ -352,7 +352,7 @@ bool TranslatorVisitor::arm_LDRD_reg(Cond cond, bool P, bool U, bool W, Reg n, R // LDRH , [PC, #-/+] bool TranslatorVisitor::arm_LDRH_lit(Cond cond, bool P, bool U, bool W, Reg t, Imm<4> imm8a, Imm<4> imm8b) { - ASSERT(!(!P && W) && "T form of instruction unimplemented"); + DEBUG_ASSERT(!(!P && W) && "T form of instruction unimplemented"); if (P == W) { return UnpredictableInstruction(); } @@ -382,7 +382,7 @@ bool TranslatorVisitor::arm_LDRH_imm(Cond cond, bool P, bool U, bool W, Reg n, R return UnpredictableInstruction(); } - ASSERT(!(!P && W) && "T form of instruction unimplemented"); + DEBUG_ASSERT(!(!P && W) && "T form of instruction unimplemented"); if ((!P || W) && n == t) { return UnpredictableInstruction(); } @@ -407,7 +407,7 @@ bool TranslatorVisitor::arm_LDRH_imm(Cond cond, bool P, bool U, bool W, Reg n, R // LDRH , [, #+/-]{!} // LDRH , [], #+/- bool TranslatorVisitor::arm_LDRH_reg(Cond cond, bool P, bool U, bool W, Reg n, Reg t, Reg m) { - ASSERT(!(!P && W) && "T form of instruction unimplemented"); + DEBUG_ASSERT(!(!P && W) && "T form of instruction unimplemented"); if (t == Reg::PC || m == Reg::PC) { return UnpredictableInstruction(); } @@ -456,7 +456,7 @@ bool TranslatorVisitor::arm_LDRSB_imm(Cond cond, bool P, bool U, bool W, Reg n, return UnpredictableInstruction(); } - ASSERT(!(!P && W) && "T form of instruction unimplemented"); + DEBUG_ASSERT(!(!P && W) && "T form of instruction unimplemented"); if ((!P || W) && n == t) { return UnpredictableInstruction(); } @@ -481,7 +481,7 @@ bool TranslatorVisitor::arm_LDRSB_imm(Cond cond, bool P, bool U, bool W, Reg n, // LDRSB , [, #+/-]{!} // LDRSB , [], #+/- bool TranslatorVisitor::arm_LDRSB_reg(Cond cond, bool P, bool U, bool W, Reg n, Reg t, Reg m) { - ASSERT(!(!P && W) && "T form of instruction unimplemented"); + DEBUG_ASSERT(!(!P && W) && "T form of instruction unimplemented"); if (t == Reg::PC || m == Reg::PC) { return UnpredictableInstruction(); } @@ -529,7 +529,7 @@ bool TranslatorVisitor::arm_LDRSH_imm(Cond cond, bool P, bool U, bool W, Reg n, return UnpredictableInstruction(); } - ASSERT(!(!P && W) && "T form of instruction unimplemented"); + DEBUG_ASSERT(!(!P && W) && "T form of instruction unimplemented"); if ((!P || W) && n == t) { return UnpredictableInstruction(); } @@ -554,7 +554,7 @@ bool TranslatorVisitor::arm_LDRSH_imm(Cond cond, bool P, bool U, bool W, Reg n, // LDRSH , [, #+/-]{!} // LDRSH , [], #+/- bool TranslatorVisitor::arm_LDRSH_reg(Cond cond, bool P, bool U, bool W, Reg n, Reg t, Reg m) { - ASSERT(!(!P && W) && "T form of instruction unimplemented"); + DEBUG_ASSERT(!(!P && W) && "T form of instruction unimplemented"); if (t == Reg::PC || m == Reg::PC) { return UnpredictableInstruction(); } diff --git a/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/status_register_access.cpp b/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/status_register_access.cpp index 7a0640598c..792cc5a13a 100644 --- a/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/status_register_access.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/status_register_access.cpp @@ -34,7 +34,7 @@ bool TranslatorVisitor::arm_MRS(Cond cond, Reg d) { // MSR , # bool TranslatorVisitor::arm_MSR_imm(Cond cond, unsigned mask, int rotate, Imm<8> imm8) { - ASSERT(mask != 0 && "Decode error"); + DEBUG_ASSERT(mask != 0 && "Decode error"); if (!ArmConditionPassed(cond)) { return true; diff --git a/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/thumb16.cpp b/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/thumb16.cpp index 082cd30db2..fbd5f6f5ea 100644 --- a/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/thumb16.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/thumb16.cpp @@ -687,7 +687,7 @@ bool TranslatorVisitor::thumb16_NOP() { // IT{{{}}} bool TranslatorVisitor::thumb16_IT(Imm<8> imm8) { - ASSERT((imm8.Bits<0, 3>() != 0b0000) && "Decode Error"); + DEBUG_ASSERT((imm8.Bits<0, 3>() != 0b0000) && "Decode Error"); if (imm8.Bits<4, 7>() == 0b1111 || (imm8.Bits<4, 7>() == 0b1110 && std::popcount(imm8.Bits<0, 3>()) != 1)) { return UnpredictableInstruction(); } diff --git a/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/thumb32_data_processing_modified_immediate.cpp b/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/thumb32_data_processing_modified_immediate.cpp index 2f4f2f7298..f50248e252 100644 --- a/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/thumb32_data_processing_modified_immediate.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/thumb32_data_processing_modified_immediate.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later /* This file is part of the dynarmic project. @@ -23,7 +23,7 @@ bool TranslatorVisitor::thumb32_TST_imm(Imm<1> i, Reg n, Imm<3> imm3, Imm<8> imm } bool TranslatorVisitor::thumb32_AND_imm(Imm<1> i, bool S, Reg n, Imm<3> imm3, Reg d, Imm<8> imm8) { - ASSERT(!(d == Reg::PC && S) && "Decode error"); + DEBUG_ASSERT(!(d == Reg::PC && S) && "Decode error"); if ((d == Reg::PC && !S) || n == Reg::PC) { return UnpredictableInstruction(); } @@ -69,7 +69,7 @@ bool TranslatorVisitor::thumb32_MOV_imm(Imm<1> i, bool S, Imm<3> imm3, Reg d, Im } bool TranslatorVisitor::thumb32_ORR_imm(Imm<1> i, bool S, Reg n, Imm<3> imm3, Reg d, Imm<8> imm8) { - ASSERT(n != Reg::PC && "Decode error"); + DEBUG_ASSERT(n != Reg::PC && "Decode error"); if (d == Reg::PC) { return UnpredictableInstruction(); } @@ -100,7 +100,7 @@ bool TranslatorVisitor::thumb32_MVN_imm(Imm<1> i, bool S, Imm<3> imm3, Reg d, Im } bool TranslatorVisitor::thumb32_ORN_imm(Imm<1> i, bool S, Reg n, Imm<3> imm3, Reg d, Imm<8> imm8) { - ASSERT(n != Reg::PC && "Decode error"); + DEBUG_ASSERT(n != Reg::PC && "Decode error"); if (d == Reg::PC) { return UnpredictableInstruction(); } @@ -128,7 +128,7 @@ bool TranslatorVisitor::thumb32_TEQ_imm(Imm<1> i, Reg n, Imm<3> imm3, Imm<8> imm } bool TranslatorVisitor::thumb32_EOR_imm(Imm<1> i, bool S, Reg n, Imm<3> imm3, Reg d, Imm<8> imm8) { - ASSERT(!(d == Reg::PC && S) && "Decode error"); + DEBUG_ASSERT(!(d == Reg::PC && S) && "Decode error"); if ((d == Reg::PC && !S) || n == Reg::PC) { return UnpredictableInstruction(); } @@ -156,7 +156,7 @@ bool TranslatorVisitor::thumb32_CMN_imm(Imm<1> i, Reg n, Imm<3> imm3, Imm<8> imm } bool TranslatorVisitor::thumb32_ADD_imm_1(Imm<1> i, bool S, Reg n, Imm<3> imm3, Reg d, Imm<8> imm8) { - ASSERT(!(d == Reg::PC && S) && "Decode error"); + DEBUG_ASSERT(!(d == Reg::PC && S) && "Decode error"); if ((d == Reg::PC && !S) || n == Reg::PC) { return UnpredictableInstruction(); } @@ -214,7 +214,7 @@ bool TranslatorVisitor::thumb32_CMP_imm(Imm<1> i, Reg n, Imm<3> imm3, Imm<8> imm } bool TranslatorVisitor::thumb32_SUB_imm_1(Imm<1> i, bool S, Reg n, Imm<3> imm3, Reg d, Imm<8> imm8) { - ASSERT(!(d == Reg::PC && S) && "Decode error"); + DEBUG_ASSERT(!(d == Reg::PC && S) && "Decode error"); if ((d == Reg::PC && !S) || n == Reg::PC) { return UnpredictableInstruction(); } diff --git a/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/thumb32_data_processing_plain_binary_immediate.cpp b/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/thumb32_data_processing_plain_binary_immediate.cpp index c0bb75962f..a285e7602e 100644 --- a/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/thumb32_data_processing_plain_binary_immediate.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/thumb32_data_processing_plain_binary_immediate.cpp @@ -17,7 +17,7 @@ namespace Dynarmic::A32 { using SaturationFunction = IR::ResultAndOverflow (IREmitter::*)(const IR::U32&, size_t); static bool Saturation(TranslatorVisitor& v, bool sh, Reg n, Reg d, Imm<5> shift_amount, size_t saturate_to, SaturationFunction sat_fn) { - ASSERT(!(sh && shift_amount == 0) && "Invalid decode"); + DEBUG_ASSERT(!(sh && shift_amount == 0) && "Invalid decode"); if (d == Reg::PC || n == Reg::PC) { return v.UnpredictableInstruction(); diff --git a/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/thumb32_data_processing_shifted_register.cpp b/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/thumb32_data_processing_shifted_register.cpp index f6b7cb5c87..370f799dbd 100644 --- a/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/thumb32_data_processing_shifted_register.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/thumb32_data_processing_shifted_register.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later /* This file is part of the dynarmic project. @@ -23,7 +23,7 @@ bool TranslatorVisitor::thumb32_TST_reg(Reg n, Imm<3> imm3, Imm<2> imm2, ShiftTy } bool TranslatorVisitor::thumb32_AND_reg(bool S, Reg n, Imm<3> imm3, Reg d, Imm<2> imm2, ShiftType type, Reg m) { - ASSERT(!(d == Reg::PC && S) && "Decode error"); + DEBUG_ASSERT(!(d == Reg::PC && S) && "Decode error"); if ((d == Reg::PC && !S) || n == Reg::PC || m == Reg::PC) { return UnpredictableInstruction(); @@ -67,7 +67,7 @@ bool TranslatorVisitor::thumb32_MOV_reg(bool S, Imm<3> imm3, Reg d, Imm<2> imm2, } bool TranslatorVisitor::thumb32_ORR_reg(bool S, Reg n, Imm<3> imm3, Reg d, Imm<2> imm2, ShiftType type, Reg m) { - ASSERT(n != Reg::PC && "Decode error"); + DEBUG_ASSERT(n != Reg::PC && "Decode error"); if (d == Reg::PC || m == Reg::PC) { return UnpredictableInstruction(); @@ -97,7 +97,7 @@ bool TranslatorVisitor::thumb32_MVN_reg(bool S, Imm<3> imm3, Reg d, Imm<2> imm2, } bool TranslatorVisitor::thumb32_ORN_reg(bool S, Reg n, Imm<3> imm3, Reg d, Imm<2> imm2, ShiftType type, Reg m) { - ASSERT(n != Reg::PC && "Decode error"); + DEBUG_ASSERT(n != Reg::PC && "Decode error"); if (d == Reg::PC || m == Reg::PC) { return UnpredictableInstruction(); @@ -125,7 +125,7 @@ bool TranslatorVisitor::thumb32_TEQ_reg(Reg n, Imm<3> imm3, Imm<2> imm2, ShiftTy } bool TranslatorVisitor::thumb32_EOR_reg(bool S, Reg n, Imm<3> imm3, Reg d, Imm<2> imm2, ShiftType type, Reg m) { - ASSERT(!(d == Reg::PC && S) && "Decode error"); + DEBUG_ASSERT(!(d == Reg::PC && S) && "Decode error"); if ((d == Reg::PC && !S) || n == Reg::PC || m == Reg::PC) { return UnpredictableInstruction(); @@ -168,7 +168,7 @@ bool TranslatorVisitor::thumb32_CMN_reg(Reg n, Imm<3> imm3, Imm<2> imm2, ShiftTy } bool TranslatorVisitor::thumb32_ADD_reg(bool S, Reg n, Imm<3> imm3, Reg d, Imm<2> imm2, ShiftType type, Reg m) { - ASSERT(!(d == Reg::PC && S) && "Decode error"); + DEBUG_ASSERT(!(d == Reg::PC && S) && "Decode error"); if ((d == Reg::PC && !S) || n == Reg::PC || m == Reg::PC) { return UnpredictableInstruction(); @@ -224,7 +224,7 @@ bool TranslatorVisitor::thumb32_CMP_reg(Reg n, Imm<3> imm3, Imm<2> imm2, ShiftTy } bool TranslatorVisitor::thumb32_SUB_reg(bool S, Reg n, Imm<3> imm3, Reg d, Imm<2> imm2, ShiftType type, Reg m) { - ASSERT(!(d == Reg::PC && S) && "Decode error"); + DEBUG_ASSERT(!(d == Reg::PC && S) && "Decode error"); if ((d == Reg::PC && !S) || n == Reg::PC || m == Reg::PC) { return UnpredictableInstruction(); diff --git a/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/vfp.cpp b/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/vfp.cpp index 794d247929..2d979a4591 100644 --- a/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/vfp.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A32/translate/impl/vfp.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later /* This file is part of the dynarmic project. @@ -1304,11 +1304,11 @@ bool TranslatorVisitor::vfp_VSTR(Cond cond, bool U, bool D, Reg n, size_t Vd, bo // VSTM{mode} {!}, bool TranslatorVisitor::vfp_VSTM_a1(Cond cond, bool p, bool u, bool D, bool w, Reg n, size_t Vd, Imm<8> imm8) { if (!p && !u && !w) { - ASSERT(false && "Decode error"); + DEBUG_ASSERT(false && "Decode error"); } if (p && !w) { - ASSERT(false && "Decode error"); + DEBUG_ASSERT(false && "Decode error"); } if (p == u && w) { @@ -1356,11 +1356,11 @@ bool TranslatorVisitor::vfp_VSTM_a1(Cond cond, bool p, bool u, bool D, bool w, R // VSTM{mode} {!}, bool TranslatorVisitor::vfp_VSTM_a2(Cond cond, bool p, bool u, bool D, bool w, Reg n, size_t Vd, Imm<8> imm8) { if (!p && !u && !w) { - ASSERT(false && "Decode error"); + DEBUG_ASSERT(false && "Decode error"); } if (p && !w) { - ASSERT(false && "Decode error"); + DEBUG_ASSERT(false && "Decode error"); } if (p == u && w) { @@ -1399,11 +1399,11 @@ bool TranslatorVisitor::vfp_VSTM_a2(Cond cond, bool p, bool u, bool D, bool w, R // VLDM{mode} {!}, bool TranslatorVisitor::vfp_VLDM_a1(Cond cond, bool p, bool u, bool D, bool w, Reg n, size_t Vd, Imm<8> imm8) { if (!p && !u && !w) { - ASSERT(false && "Decode error"); + DEBUG_ASSERT(false && "Decode error"); } if (p && !w) { - ASSERT(false && "Decode error"); + DEBUG_ASSERT(false && "Decode error"); } if (p == u && w) { @@ -1449,11 +1449,11 @@ bool TranslatorVisitor::vfp_VLDM_a1(Cond cond, bool p, bool u, bool D, bool w, R // VLDM{mode} {!}, bool TranslatorVisitor::vfp_VLDM_a2(Cond cond, bool p, bool u, bool D, bool w, Reg n, size_t Vd, Imm<8> imm8) { if (!p && !u && !w) { - ASSERT(false && "Decode error"); + DEBUG_ASSERT(false && "Decode error"); } if (p && !w) { - ASSERT(false && "Decode error"); + DEBUG_ASSERT(false && "Decode error"); } if (p == u && w) { diff --git a/src/dynarmic/src/dynarmic/frontend/A32/translate/translate_arm.cpp b/src/dynarmic/src/dynarmic/frontend/A32/translate/translate_arm.cpp index 6c89a4af36..79db2ce4d0 100644 --- a/src/dynarmic/src/dynarmic/frontend/A32/translate/translate_arm.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A32/translate/translate_arm.cpp @@ -73,7 +73,7 @@ void TranslateArm(IR::Block& block, LocationDescriptor descriptor, TranslateCall } } } - ASSERT(block.HasTerminal() && "Terminal has not been set"); + DEBUG_ASSERT(block.HasTerminal() && "Terminal has not been set"); block.SetEndLocation(visitor.ir.current_location); } diff --git a/src/dynarmic/src/dynarmic/frontend/A32/translate/translate_thumb.cpp b/src/dynarmic/src/dynarmic/frontend/A32/translate/translate_thumb.cpp index 2a2fbea63f..b918538596 100644 --- a/src/dynarmic/src/dynarmic/frontend/A32/translate/translate_thumb.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A32/translate/translate_thumb.cpp @@ -172,7 +172,7 @@ void TranslateThumb(IR::Block& block, LocationDescriptor descriptor, TranslateCa } } } - ASSERT(block.HasTerminal() && "Terminal has not been set"); + DEBUG_ASSERT(block.HasTerminal() && "Terminal has not been set"); block.SetEndLocation(visitor.ir.current_location); } diff --git a/src/dynarmic/src/dynarmic/frontend/A64/a64_types.h b/src/dynarmic/src/dynarmic/frontend/A64/a64_types.h index 55d82a740a..4c65a35b3b 100644 --- a/src/dynarmic/src/dynarmic/frontend/A64/a64_types.h +++ b/src/dynarmic/src/dynarmic/frontend/A64/a64_types.h @@ -114,14 +114,14 @@ constexpr size_t VecNumber(Vec vec) { inline Reg operator+(Reg reg, size_t number) { const size_t new_reg = RegNumber(reg) + number; - ASSERT(new_reg <= 31); + DEBUG_ASSERT(new_reg <= 31); return static_cast(new_reg); } inline Vec operator+(Vec vec, size_t number) { const size_t new_vec = VecNumber(vec) + number; - ASSERT(new_vec <= 31); + DEBUG_ASSERT(new_vec <= 31); return static_cast(new_vec); } diff --git a/src/dynarmic/src/dynarmic/frontend/A64/translate/a64_translate.cpp b/src/dynarmic/src/dynarmic/frontend/A64/translate/a64_translate.cpp index 7840c63d79..f63a37c20a 100644 --- a/src/dynarmic/src/dynarmic/frontend/A64/translate/a64_translate.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A64/translate/a64_translate.cpp @@ -39,7 +39,7 @@ void Translate(IR::Block& block, LocationDescriptor descriptor, MemoryReadCodeFu if (single_step && should_continue) { visitor.ir.SetTerm(IR::Term::LinkBlock{*visitor.ir.current_location}); } - ASSERT(block.HasTerminal() && "Terminal has not been set"); + DEBUG_ASSERT(block.HasTerminal() && "Terminal has not been set"); block.SetEndLocation(*visitor.ir.current_location); } diff --git a/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/impl.cpp b/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/impl.cpp index 998fa4c13b..ef99beebf4 100644 --- a/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/impl.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/impl.cpp @@ -170,8 +170,8 @@ void TranslatorVisitor::V_scalar(size_t bitsize, Vec vec, IR::UAnyU128 value) { } IR::U128 TranslatorVisitor::Vpart(size_t bitsize, Vec vec, size_t part) { - ASSERT(part == 0 || part == 1); - ASSERT(bitsize == 64); + DEBUG_ASSERT(part == 0 || part == 1); + DEBUG_ASSERT(bitsize == 64); if (part == 0) { return V(64, vec); } @@ -179,33 +179,33 @@ IR::U128 TranslatorVisitor::Vpart(size_t bitsize, Vec vec, size_t part) { } void TranslatorVisitor::Vpart(size_t bitsize, Vec vec, size_t part, IR::U128 value) { - ASSERT(part == 0 || part == 1); + DEBUG_ASSERT(part == 0 || part == 1); if (part == 0) { - ASSERT(bitsize == 64); + DEBUG_ASSERT(bitsize == 64); V(128, vec, ir.VectorZeroExtend(bitsize, value)); } else { - ASSERT(bitsize == 64); + DEBUG_ASSERT(bitsize == 64); V(128, vec, ir.VectorInterleaveLower(64, V(128, vec), value)); } } IR::UAny TranslatorVisitor::Vpart_scalar(size_t bitsize, Vec vec, size_t part) { - ASSERT(part == 0 || part == 1); + DEBUG_ASSERT(part == 0 || part == 1); if (part == 0) { - ASSERT(bitsize == 8 || bitsize == 16 || bitsize == 32 || bitsize == 64); + DEBUG_ASSERT(bitsize == 8 || bitsize == 16 || bitsize == 32 || bitsize == 64); } else { - ASSERT(bitsize == 64); + DEBUG_ASSERT(bitsize == 64); } return ir.VectorGetElement(bitsize, V(128, vec), part); } void TranslatorVisitor::Vpart_scalar(size_t bitsize, Vec vec, size_t part, IR::UAny value) { - ASSERT(part == 0 || part == 1); + DEBUG_ASSERT(part == 0 || part == 1); if (part == 0) { - ASSERT(bitsize == 8 || bitsize == 16 || bitsize == 32 || bitsize == 64); + DEBUG_ASSERT(bitsize == 8 || bitsize == 16 || bitsize == 32 || bitsize == 64); V(128, vec, ir.ZeroExtendToQuad(value)); } else { - ASSERT(bitsize == 64); + DEBUG_ASSERT(bitsize == 64); V(128, vec, ir.VectorSetElement(64, V(128, vec), 1, value)); } } @@ -315,8 +315,8 @@ IR::U32U64 TranslatorVisitor::ShiftReg(size_t bitsize, Reg reg, Imm<2> shift, IR } IR::U32U64 TranslatorVisitor::ExtendReg(size_t bitsize, Reg reg, Imm<3> option, u8 shift) { - ASSERT(shift <= 4); - ASSERT(bitsize == 32 || bitsize == 64); + DEBUG_ASSERT(shift <= 4); + DEBUG_ASSERT(bitsize == 32 || bitsize == 64); IR::UAny val = X(bitsize, reg); size_t len; IR::U32U64 extended; diff --git a/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/load_store_multiple_structures.cpp b/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/load_store_multiple_structures.cpp index 77c57a9659..6dcf2c9ff9 100644 --- a/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/load_store_multiple_structures.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/load_store_multiple_structures.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + /* This file is part of the dynarmic project. * Copyright (c) 2018 MerryMage * SPDX-License-Identifier: 0BSD @@ -48,7 +51,7 @@ static bool SharedDecodeAndOperation(TranslatorVisitor& v, bool wback, IR::MemOp default: return v.UnallocatedEncoding(); } - ASSERT(rpt == 1 || selem == 1); + DEBUG_ASSERT(rpt == 1 || selem == 1); if ((size == 0b11 && !Q) && selem != 1) { return v.ReservedValue(); diff --git a/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/load_store_register_immediate.cpp b/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/load_store_register_immediate.cpp index d939c45f2c..7c31b89c66 100644 --- a/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/load_store_register_immediate.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/load_store_register_immediate.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + /* This file is part of the dynarmic project. * Copyright (c) 2018 MerryMage * SPDX-License-Identifier: 0BSD @@ -18,10 +21,10 @@ static bool LoadStoreRegisterImmediate(TranslatorVisitor& v, bool wback, bool po signed_ = false; } else if (size == 0b11) { memop = IR::MemOp::PREFETCH; - ASSERT(!opc.Bit<0>()); + DEBUG_ASSERT(!opc.Bit<0>()); } else { memop = IR::MemOp::LOAD; - ASSERT(!(size == 0b10 && opc.Bit<0>() == 1)); + DEBUG_ASSERT(!(size == 0b10 && opc.Bit<0>() == 1)); regsize = opc.Bit<0>() ? 32 : 64; signed_ = true; } diff --git a/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_scalar_shift_by_immediate.cpp b/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_scalar_shift_by_immediate.cpp index 332eb35ebe..f53da9bce8 100644 --- a/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_scalar_shift_by_immediate.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_scalar_shift_by_immediate.cpp @@ -198,7 +198,7 @@ bool ShiftRightNarrowing(TranslatorVisitor& v, Imm<4> immh, Imm<3> immb, Vec Vn, } return v.ir.VectorUnsignedSaturatedNarrow(source_esize, wide_result); case Narrowing::SaturateToSigned: - ASSERT(SignednessSSSBI == SignednessSSSBI::Signed); + DEBUG_ASSERT(SignednessSSSBI == SignednessSSSBI::Signed); return v.ir.VectorSignedSaturatedNarrowToSigned(source_esize, wide_result); } UNREACHABLE(); diff --git a/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_scalar_x_indexed_element.cpp b/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_scalar_x_indexed_element.cpp index bb0c6fc175..08fbae6a00 100644 --- a/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_scalar_x_indexed_element.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_scalar_x_indexed_element.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later /* This file is part of the dynarmic project. @@ -73,7 +73,7 @@ bool MultiplyByElementHalfPrecision(TranslatorVisitor& v, Imm<1> L, Imm<1> M, Im // TODO: Currently we don't implement half-precision paths // for regular multiplication and extended multiplication. - ASSERT(extra_behavior != ExtraBehavior::None + DEBUG_ASSERT(extra_behavior != ExtraBehavior::None && extra_behavior != ExtraBehavior::MultiplyExtended); if (extra_behavior == ExtraBehavior::Subtract) { operand1 = v.ir.FPNeg(operand1); diff --git a/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_shift_by_immediate.cpp b/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_shift_by_immediate.cpp index 33debd1062..50e9856ac2 100644 --- a/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_shift_by_immediate.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_shift_by_immediate.cpp @@ -127,7 +127,7 @@ bool ShiftRightNarrowingSSBI(TranslatorVisitor& v, bool Q, Imm<4> immh, Imm<3> i } return v.ir.VectorUnsignedSaturatedNarrow(source_esize, wide_result); case NarrowingSSBI::SaturateToSigned: - ASSERT(SignednessSSBI == SignednessSSBI::Signed); + DEBUG_ASSERT(SignednessSSBI == SignednessSSBI::Signed); return v.ir.VectorSignedSaturatedNarrowToSigned(source_esize, wide_result); } UNREACHABLE(); diff --git a/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_three_same_extra.cpp b/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_three_same_extra.cpp index 91ade93f4b..f9ce3dbd39 100644 --- a/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_three_same_extra.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_three_same_extra.cpp @@ -66,7 +66,7 @@ bool TranslatorVisitor::FCMLA_vec(bool Q, Imm<2> size, Vec Vm, Imm<2> rot, Vec V const size_t esize = 8U << size.ZeroExtend(); // TODO: Currently we don't support half-precision floating point - ASSERT(esize != 16); + DEBUG_ASSERT(esize != 16); const size_t datasize = Q ? 128 : 64; const size_t num_elements = datasize / esize; @@ -135,7 +135,7 @@ bool TranslatorVisitor::FCADD_vec(bool Q, Imm<2> size, Vec Vm, Imm<1> rot, Vec V const size_t esize = 8U << size.ZeroExtend(); // TODO: Currently we don't support half-precision floating point - ASSERT(esize != 16); + DEBUG_ASSERT(esize != 16); const size_t datasize = Q ? 128 : 64; const size_t num_elements = datasize / esize; diff --git a/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_vector_x_indexed_element.cpp b/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_vector_x_indexed_element.cpp index da11b51d84..8b8e30efd0 100644 --- a/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_vector_x_indexed_element.cpp +++ b/src/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_vector_x_indexed_element.cpp @@ -223,7 +223,7 @@ bool TranslatorVisitor::FCMLA_elt(bool Q, Imm<2> size, Imm<1> L, Imm<1> M, Imm<4 const size_t esize = 8U << size.ZeroExtend(); // TODO: We don't support the half-precision floating point variant yet. - ASSERT(esize != 16); + DEBUG_ASSERT(esize != 16); const size_t index = [=] { if (size == 0b01) { diff --git a/src/dynarmic/src/dynarmic/ir/basic_block.cpp b/src/dynarmic/src/dynarmic/ir/basic_block.cpp index 4a7b2bf261..2db1e80c2b 100644 --- a/src/dynarmic/src/dynarmic/ir/basic_block.cpp +++ b/src/dynarmic/src/dynarmic/ir/basic_block.cpp @@ -69,7 +69,7 @@ void Block::Reset(LocationDescriptor location_) noexcept { terminal = std::monostate{}; cond_failed_cycle_count = 0; cycle_count = 0; - ASSERT(instructions.size() == 0); + DEBUG_ASSERT(instructions.size() == 0); } static std::string TerminalToString(const Term::Terminal& terminal_variant) noexcept { diff --git a/src/dynarmic/src/dynarmic/ir/basic_block.h b/src/dynarmic/src/dynarmic/ir/basic_block.h index 37db8745a4..5ece0f568f 100644 --- a/src/dynarmic/src/dynarmic/ir/basic_block.h +++ b/src/dynarmic/src/dynarmic/ir/basic_block.h @@ -119,12 +119,12 @@ public: } /// Sets the terminal instruction for this basic block. inline void SetTerminal(Term::Terminal term) noexcept { - ASSERT(!HasTerminal() && "Terminal has already been set."); + DEBUG_ASSERT(!HasTerminal() && "Terminal has already been set."); terminal = std::move(term); } /// Replaces the terminal instruction for this basic block. inline void ReplaceTerminal(Term::Terminal term) noexcept { - ASSERT(HasTerminal() && "Terminal has not been set."); + DEBUG_ASSERT(HasTerminal() && "Terminal has not been set."); terminal = std::move(term); } /// Determines whether or not this basic block has a terminal instruction. diff --git a/src/dynarmic/src/dynarmic/ir/ir_emitter.h b/src/dynarmic/src/dynarmic/ir/ir_emitter.h index 23ec707ee9..a99359d940 100644 --- a/src/dynarmic/src/dynarmic/ir/ir_emitter.h +++ b/src/dynarmic/src/dynarmic/ir/ir_emitter.h @@ -118,7 +118,7 @@ public: } return LeastSignificantWord(value); case 64: - ASSERT(value.GetType() == Type::U64); + DEBUG_ASSERT(value.GetType() == Type::U64); return value; } UNREACHABLE(); @@ -189,7 +189,7 @@ public: } U32U64 ConditionalSelect(Cond cond, const U32U64& a, const U32U64& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); if (a.GetType() == Type::U32) { return Inst(Opcode::ConditionalSelect32, Value{cond}, a, b); } else { @@ -272,7 +272,7 @@ public: } U32U64 LogicalShiftLeftMasked(const U32U64& value_in, const U32U64& shift_amount) { - ASSERT(value_in.GetType() == shift_amount.GetType()); + DEBUG_ASSERT(value_in.GetType() == shift_amount.GetType()); if (value_in.GetType() == Type::U32) { return Inst(Opcode::LogicalShiftLeftMasked32, value_in, shift_amount); } else { @@ -281,7 +281,7 @@ public: } U32U64 LogicalShiftRightMasked(const U32U64& value_in, const U32U64& shift_amount) { - ASSERT(value_in.GetType() == shift_amount.GetType()); + DEBUG_ASSERT(value_in.GetType() == shift_amount.GetType()); if (value_in.GetType() == Type::U32) { return Inst(Opcode::LogicalShiftRightMasked32, value_in, shift_amount); } else { @@ -290,7 +290,7 @@ public: } U32U64 ArithmeticShiftRightMasked(const U32U64& value_in, const U32U64& shift_amount) { - ASSERT(value_in.GetType() == shift_amount.GetType()); + DEBUG_ASSERT(value_in.GetType() == shift_amount.GetType()); if (value_in.GetType() == Type::U32) { return Inst(Opcode::ArithmeticShiftRightMasked32, value_in, shift_amount); } else { @@ -299,7 +299,7 @@ public: } U32U64 RotateRightMasked(const U32U64& value_in, const U32U64& shift_amount) { - ASSERT(value_in.GetType() == shift_amount.GetType()); + DEBUG_ASSERT(value_in.GetType() == shift_amount.GetType()); if (value_in.GetType() == Type::U32) { return Inst(Opcode::RotateRightMasked32, value_in, shift_amount); } else { @@ -308,7 +308,7 @@ public: } U32U64 AddWithCarry(const U32U64& a, const U32U64& b, const U1& carry_in) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); if (a.GetType() == Type::U32) { return Inst(Opcode::Add32, a, b, carry_in); } else { @@ -317,7 +317,7 @@ public: } U32U64 Add(const U32U64& a, const U32U64& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); if (a.GetType() == Type::U32) { return Inst(Opcode::Add32, a, b, Imm1(0)); } else { @@ -326,7 +326,7 @@ public: } U32U64 SubWithCarry(const U32U64& a, const U32U64& b, const U1& carry_in) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); if (a.GetType() == Type::U32) { return Inst(Opcode::Sub32, a, b, carry_in); } else { @@ -335,7 +335,7 @@ public: } U32U64 Sub(const U32U64& a, const U32U64& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); if (a.GetType() == Type::U32) { return Inst(Opcode::Sub32, a, b, Imm1(1)); } else { @@ -376,7 +376,7 @@ public: } U32U64 And(const U32U64& a, const U32U64& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); if (a.GetType() == Type::U32) { return Inst(Opcode::And32, a, b); } else { @@ -385,7 +385,7 @@ public: } U32U64 AndNot(const U32U64& a, const U32U64& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); if (a.GetType() == Type::U32) { return Inst(Opcode::AndNot32, a, b); } else { @@ -394,7 +394,7 @@ public: } U32U64 Eor(const U32U64& a, const U32U64& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); if (a.GetType() == Type::U32) { return Inst(Opcode::Eor32, a, b); } else { @@ -403,7 +403,7 @@ public: } U32U64 Or(const U32U64& a, const U32U64& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); if (a.GetType() == Type::U32) { return Inst(Opcode::Or32, a, b); } else { @@ -547,11 +547,11 @@ public: U32U64 ReplicateBit(const U32U64& a, u8 bit) { if (a.GetType() == IR::Type::U32) { - ASSERT(bit < 32); + DEBUG_ASSERT(bit < 32); return Inst(Opcode::ReplicateBit32, a, Imm8(bit)); } - ASSERT(bit < 64); + DEBUG_ASSERT(bit < 64); return Inst(Opcode::ReplicateBit64, a, Imm8(bit)); } @@ -600,21 +600,21 @@ public: } ResultAndOverflow SignedSaturation(const U32& a, size_t bit_size_to_saturate_to) { - ASSERT(bit_size_to_saturate_to >= 1 && bit_size_to_saturate_to <= 32); + DEBUG_ASSERT(bit_size_to_saturate_to >= 1 && bit_size_to_saturate_to <= 32); const auto result = Inst(Opcode::SignedSaturation, a, Imm8(static_cast(bit_size_to_saturate_to))); const auto overflow = Inst(Opcode::GetOverflowFromOp, result); return {result, overflow}; } ResultAndOverflow UnsignedSaturation(const U32& a, size_t bit_size_to_saturate_to) { - ASSERT(bit_size_to_saturate_to <= 31); + DEBUG_ASSERT(bit_size_to_saturate_to <= 31); const auto result = Inst(Opcode::UnsignedSaturation, a, Imm8(static_cast(bit_size_to_saturate_to))); const auto overflow = Inst(Opcode::GetOverflowFromOp, result); return {result, overflow}; } UAny SignedSaturatedAdd(const UAny& a, const UAny& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); const auto result = [&]() -> IR::UAny { switch (a.GetType()) { case IR::Type::U8: @@ -633,7 +633,7 @@ public: } UAny SignedSaturatedDoublingMultiplyReturnHigh(const UAny& a, const UAny& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); const auto result = [&]() -> IR::UAny { switch (a.GetType()) { case IR::Type::U16: @@ -648,7 +648,7 @@ public: } UAny SignedSaturatedSub(const UAny& a, const UAny& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); const auto result = [&]() -> IR::UAny { switch (a.GetType()) { case IR::Type::U8: @@ -667,7 +667,7 @@ public: } UAny UnsignedSaturatedAdd(const UAny& a, const UAny& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); const auto result = [&]() -> IR::UAny { switch (a.GetType()) { case IR::Type::U8: @@ -686,7 +686,7 @@ public: } UAny UnsignedSaturatedSub(const UAny& a, const UAny& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); const auto result = [&]() -> IR::UAny { switch (a.GetType()) { case IR::Type::U8: @@ -989,7 +989,7 @@ public: } UAny VectorGetElement(size_t esize, const U128& a, size_t index) { - ASSERT(esize * index < 128 && "Invalid index"); + DEBUG_ASSERT(esize * index < 128 && "Invalid index"); switch (esize) { case 8: return Inst(Opcode::VectorGetElement8, a, Imm8(static_cast(index))); @@ -1005,7 +1005,7 @@ public: } U128 VectorSetElement(size_t esize, const U128& a, size_t index, const IR::UAny& elem) { - ASSERT(esize * index < 128 && "Invalid index"); + DEBUG_ASSERT(esize * index < 128 && "Invalid index"); switch (esize) { case 8: return Inst(Opcode::VectorSetElement8, a, Imm8(static_cast(index)), elem); @@ -1111,7 +1111,7 @@ public: } U128 VectorBroadcastElementLower(size_t esize, const U128& a, size_t index) { - ASSERT(esize * index < 128 && "Invalid index"); + DEBUG_ASSERT(esize * index < 128 && "Invalid index"); switch (esize) { case 8: return Inst(Opcode::VectorBroadcastElementLower8, a, u8(index)); @@ -1124,7 +1124,7 @@ public: } U128 VectorBroadcastElement(size_t esize, const U128& a, size_t index) { - ASSERT(esize * index < 128 && "Invalid index"); + DEBUG_ASSERT(esize * index < 128 && "Invalid index"); switch (esize) { case 8: return Inst(Opcode::VectorBroadcastElement8, a, u8(index)); @@ -1223,12 +1223,12 @@ public: } U128 VectorExtract(const U128& a, const U128& b, size_t position) { - ASSERT(position <= 128); + DEBUG_ASSERT(position <= 128); return Inst(Opcode::VectorExtract, a, b, Imm8(static_cast(position))); } U128 VectorExtractLower(const U128& a, const U128& b, size_t position) { - ASSERT(position <= 64); + DEBUG_ASSERT(position <= 64); return Inst(Opcode::VectorExtractLower, a, b, Imm8(static_cast(position))); } @@ -1732,7 +1732,7 @@ public: } U128 VectorRotateLeft(size_t esize, const U128& a, u8 amount) { - ASSERT(amount < esize); + DEBUG_ASSERT(amount < esize); if (amount == 0) { return a; @@ -1743,7 +1743,7 @@ public: } U128 VectorRotateRight(size_t esize, const U128& a, u8 amount) { - ASSERT(amount < esize); + DEBUG_ASSERT(amount < esize); if (amount == 0) { return a; @@ -1754,7 +1754,7 @@ public: } U128 VectorRotateWholeVectorRight(const U128& a, u8 amount) { - ASSERT(amount % 32 == 0); + DEBUG_ASSERT(amount % 32 == 0); return Inst(Opcode::VectorRotateWholeVectorRight, a, Imm8(amount)); } @@ -1970,7 +1970,7 @@ public: } U128 VectorSignedSaturatedShiftLeftUnsigned(size_t esize, const U128& a, u8 shift_amount) { - ASSERT(shift_amount < esize); + DEBUG_ASSERT(shift_amount < esize); switch (esize) { case 8: return Inst(Opcode::VectorSignedSaturatedShiftLeftUnsigned8, a, Imm8(shift_amount)); @@ -1999,24 +1999,24 @@ public: } Table VectorTable(std::vector values) { - ASSERT(values.size() >= 1 && values.size() <= 4); + DEBUG_ASSERT(values.size() >= 1 && values.size() <= 4); values.resize(4); return Inst(Opcode::VectorTable, values[0], values[1], values[2], values[3]); } Table VectorTable(std::vector values) { - ASSERT(values.size() >= 1 && values.size() <= 4); + DEBUG_ASSERT(values.size() >= 1 && values.size() <= 4); values.resize(4); return Inst
(Opcode::VectorTable, values[0], values[1], values[2], values[3]); } U64 VectorTableLookup(const U64& defaults, const Table& table, const U64& indices) { - ASSERT(table.GetInst()->GetArg(0).GetType() == Type::U64); + DEBUG_ASSERT(table.GetInst()->GetArg(0).GetType() == Type::U64); return Inst(Opcode::VectorTableLookup64, defaults, table, indices); } U128 VectorTableLookup(const U128& defaults, const Table& table, const U128& indices) { - ASSERT(table.GetInst()->GetArg(0).GetType() == Type::U128); + DEBUG_ASSERT(table.GetInst()->GetArg(0).GetType() == Type::U128); return Inst(Opcode::VectorTableLookup128, defaults, table, indices); } @@ -2130,7 +2130,7 @@ public: } U32U64 FPAdd(const U32U64& a, const U32U64& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); switch (a.GetType()) { case Type::U32: @@ -2143,7 +2143,7 @@ public: } NZCV FPCompare(const U32U64& a, const U32U64& b, bool exc_on_qnan) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); const IR::U1 exc_on_qnan_imm = Imm1(exc_on_qnan); @@ -2158,7 +2158,7 @@ public: } U32U64 FPDiv(const U32U64& a, const U32U64& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); switch (a.GetType()) { case Type::U32: @@ -2171,7 +2171,7 @@ public: } U32U64 FPMax(const U32U64& a, const U32U64& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); switch (a.GetType()) { case Type::U32: @@ -2184,7 +2184,7 @@ public: } U32U64 FPMaxNumeric(const U32U64& a, const U32U64& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); switch (a.GetType()) { case Type::U32: @@ -2197,7 +2197,7 @@ public: } U32U64 FPMin(const U32U64& a, const U32U64& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); switch (a.GetType()) { case Type::U32: @@ -2210,7 +2210,7 @@ public: } U32U64 FPMinNumeric(const U32U64& a, const U32U64& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); switch (a.GetType()) { case Type::U32: @@ -2223,7 +2223,7 @@ public: } U32U64 FPMul(const U32U64& a, const U32U64& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); switch (a.GetType()) { case Type::U32: @@ -2236,7 +2236,7 @@ public: } U16U32U64 FPMulAdd(const U16U32U64& a, const U16U32U64& b, const U16U32U64& c) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); switch (a.GetType()) { case Type::U16: @@ -2251,7 +2251,7 @@ public: } U16U32U64 FPMulSub(const U16U32U64& a, const U16U32U64& b, const U16U32U64& c) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); switch (a.GetType()) { case Type::U16: @@ -2266,7 +2266,7 @@ public: } U32U64 FPMulX(const U32U64& a, const U32U64& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); switch (a.GetType()) { case Type::U32: @@ -2318,7 +2318,7 @@ public: } U16U32U64 FPRecipStepFused(const U16U32U64& a, const U16U32U64& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); switch (a.GetType()) { case Type::U16: @@ -2362,7 +2362,7 @@ public: } U16U32U64 FPRSqrtStepFused(const U16U32U64& a, const U16U32U64& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); switch (a.GetType()) { case Type::U16: @@ -2388,7 +2388,7 @@ public: } U32U64 FPSub(const U32U64& a, const U32U64& b) { - ASSERT(a.GetType() == b.GetType()); + DEBUG_ASSERT(a.GetType() == b.GetType()); switch (a.GetType()) { case Type::U32: @@ -2425,7 +2425,7 @@ public: } U16 FPToFixedS16(const U16U32U64& a, size_t fbits, FP::RoundingMode rounding) { - ASSERT(fbits <= 16); + DEBUG_ASSERT(fbits <= 16); const U8 fbits_imm = Imm8(static_cast(fbits)); const U8 rounding_imm = Imm8(static_cast(rounding)); @@ -2443,7 +2443,7 @@ public: } U32 FPToFixedS32(const U16U32U64& a, size_t fbits, FP::RoundingMode rounding) { - ASSERT(fbits <= 32); + DEBUG_ASSERT(fbits <= 32); const U8 fbits_imm = Imm8(static_cast(fbits)); const U8 rounding_imm = Imm8(static_cast(rounding)); @@ -2461,7 +2461,7 @@ public: } U64 FPToFixedS64(const U16U32U64& a, size_t fbits, FP::RoundingMode rounding) { - ASSERT(fbits <= 64); + DEBUG_ASSERT(fbits <= 64); const U8 fbits_imm = Imm8(static_cast(fbits)); const U8 rounding_imm = Imm8(static_cast(rounding)); @@ -2479,7 +2479,7 @@ public: } U16 FPToFixedU16(const U16U32U64& a, size_t fbits, FP::RoundingMode rounding) { - ASSERT(fbits <= 16); + DEBUG_ASSERT(fbits <= 16); const U8 fbits_imm = Imm8(static_cast(fbits)); const U8 rounding_imm = Imm8(static_cast(rounding)); @@ -2497,7 +2497,7 @@ public: } U32 FPToFixedU32(const U16U32U64& a, size_t fbits, FP::RoundingMode rounding) { - ASSERT(fbits <= 32); + DEBUG_ASSERT(fbits <= 32); const U8 fbits_imm = Imm8(static_cast(fbits)); const U8 rounding_imm = Imm8(static_cast(rounding)); @@ -2515,7 +2515,7 @@ public: } U64 FPToFixedU64(const U16U32U64& a, size_t fbits, FP::RoundingMode rounding) { - ASSERT(fbits <= 64); + DEBUG_ASSERT(fbits <= 64); const U8 fbits_imm = Imm8(static_cast(fbits)); const U8 rounding_imm = Imm8(static_cast(rounding)); @@ -2533,7 +2533,7 @@ public: } U32 FPSignedFixedToSingle(const U16U32U64& a, size_t fbits, FP::RoundingMode rounding) { - ASSERT(fbits <= (a.GetType() == Type::U16 ? 16 : (a.GetType() == Type::U32 ? 32 : 64))); + DEBUG_ASSERT(fbits <= (a.GetType() == Type::U16 ? 16 : (a.GetType() == Type::U32 ? 32 : 64))); const IR::U8 fbits_imm = Imm8(static_cast(fbits)); const IR::U8 rounding_imm = Imm8(static_cast(rounding)); @@ -2551,7 +2551,7 @@ public: } U32 FPUnsignedFixedToSingle(const U16U32U64& a, size_t fbits, FP::RoundingMode rounding) { - ASSERT(fbits <= (a.GetType() == Type::U16 ? 16 : (a.GetType() == Type::U32 ? 32 : 64))); + DEBUG_ASSERT(fbits <= (a.GetType() == Type::U16 ? 16 : (a.GetType() == Type::U32 ? 32 : 64))); const IR::U8 fbits_imm = Imm8(static_cast(fbits)); const IR::U8 rounding_imm = Imm8(static_cast(rounding)); @@ -2569,7 +2569,7 @@ public: } U64 FPSignedFixedToDouble(const U16U32U64& a, size_t fbits, FP::RoundingMode rounding) { - ASSERT(fbits <= (a.GetType() == Type::U16 ? 16 : (a.GetType() == Type::U32 ? 32 : 64))); + DEBUG_ASSERT(fbits <= (a.GetType() == Type::U16 ? 16 : (a.GetType() == Type::U32 ? 32 : 64))); const IR::U8 fbits_imm = Imm8(static_cast(fbits)); const IR::U8 rounding_imm = Imm8(static_cast(rounding)); @@ -2587,7 +2587,7 @@ public: } U64 FPUnsignedFixedToDouble(const U16U32U64& a, size_t fbits, FP::RoundingMode rounding) { - ASSERT(fbits <= (a.GetType() == Type::U16 ? 16 : (a.GetType() == Type::U32 ? 32 : 64))); + DEBUG_ASSERT(fbits <= (a.GetType() == Type::U16 ? 16 : (a.GetType() == Type::U32 ? 32 : 64))); const IR::U8 fbits_imm = Imm8(static_cast(fbits)); const IR::U8 rounding_imm = Imm8(static_cast(rounding)); @@ -2649,12 +2649,12 @@ public: } U128 FPVectorFromHalf(size_t esize, const U128& a, FP::RoundingMode rounding, bool fpcr_controlled = true) { - ASSERT(esize == 32); + DEBUG_ASSERT(esize == 32); return Inst(Opcode::FPVectorFromHalf32, a, Imm8(static_cast(rounding)), Imm1(fpcr_controlled)); } U128 FPVectorFromSignedFixed(size_t esize, const U128& a, size_t fbits, FP::RoundingMode rounding, bool fpcr_controlled = true) { - ASSERT(fbits <= esize); + DEBUG_ASSERT(fbits <= esize); switch (esize) { case 32: return Inst(Opcode::FPVectorFromSignedFixed32, a, Imm8(static_cast(fbits)), Imm8(static_cast(rounding)), Imm1(fpcr_controlled)); @@ -2665,7 +2665,7 @@ public: } U128 FPVectorFromUnsignedFixed(size_t esize, const U128& a, size_t fbits, FP::RoundingMode rounding, bool fpcr_controlled = true) { - ASSERT(fbits <= esize); + DEBUG_ASSERT(fbits <= esize); switch (esize) { case 32: return Inst(Opcode::FPVectorFromUnsignedFixed32, a, Imm8(static_cast(fbits)), Imm8(static_cast(rounding)), Imm1(fpcr_controlled)); @@ -2883,12 +2883,12 @@ public: } U128 FPVectorToHalf(size_t esize, const U128& a, FP::RoundingMode rounding, bool fpcr_controlled = true) { - ASSERT(esize == 32); + DEBUG_ASSERT(esize == 32); return Inst(Opcode::FPVectorToHalf32, a, Imm8(static_cast(rounding)), Imm1(fpcr_controlled)); } U128 FPVectorToSignedFixed(size_t esize, const U128& a, size_t fbits, FP::RoundingMode rounding, bool fpcr_controlled = true) { - ASSERT(fbits <= esize); + DEBUG_ASSERT(fbits <= esize); const U8 fbits_imm = Imm8(static_cast(fbits)); const U8 rounding_imm = Imm8(static_cast(rounding)); @@ -2906,7 +2906,7 @@ public: } U128 FPVectorToUnsignedFixed(size_t esize, const U128& a, size_t fbits, FP::RoundingMode rounding, bool fpcr_controlled = true) { - ASSERT(fbits <= esize); + DEBUG_ASSERT(fbits <= esize); const U8 fbits_imm = Imm8(static_cast(fbits)); const U8 rounding_imm = Imm8(static_cast(rounding)); diff --git a/src/dynarmic/src/dynarmic/ir/microinstruction.cpp b/src/dynarmic/src/dynarmic/ir/microinstruction.cpp index b5541470cd..d5b7f4f573 100644 --- a/src/dynarmic/src/dynarmic/ir/microinstruction.cpp +++ b/src/dynarmic/src/dynarmic/ir/microinstruction.cpp @@ -27,7 +27,7 @@ Inst* Inst::GetAssociatedPseudoOperation(Opcode opcode) { Inst* pseudoop = next_pseudoop; while (pseudoop) { if (pseudoop->GetOpcode() == opcode) { - ASSERT(pseudoop->GetArg(0).GetInst() == this); + DEBUG_ASSERT(pseudoop->GetArg(0).GetInst() == this); return pseudoop; } pseudoop = pseudoop->next_pseudoop; @@ -81,7 +81,7 @@ void Inst::Use(const Value& value) { if (IsAPseudoOperation(op)) { if (op == Opcode::GetNZCVFromOp) { - ASSERT(MayGetNZCVFromOp(value.GetInst()->GetOpcode()) && "This value doesn't support the GetNZCVFromOp pseduo-op"); + DEBUG_ASSERT(MayGetNZCVFromOp(value.GetInst()->GetOpcode()) && "This value doesn't support the GetNZCVFromOp pseduo-op"); } Inst* insert_point = value.GetInst(); diff --git a/src/dynarmic/src/dynarmic/ir/opt_passes.cpp b/src/dynarmic/src/dynarmic/ir/opt_passes.cpp index 02b8e821da..ba9439185b 100644 --- a/src/dynarmic/src/dynarmic/ir/opt_passes.cpp +++ b/src/dynarmic/src/dynarmic/ir/opt_passes.cpp @@ -323,7 +323,7 @@ static void RegisterPass(IR::Block& block) { switch (opcode) { case IR::Opcode::A32GetRegister: { const A32::Reg reg = inst->GetArg(0).GetA32RegRef(); - ASSERT(reg != A32::Reg::PC); + DEBUG_ASSERT(reg != A32::Reg::PC); const size_t reg_index = size_t(reg); do_get(reg_info[reg_index], inst); break; @@ -1430,7 +1430,7 @@ static void VerificationPass(const IR::Block& block) { for (size_t i = 0; i < inst.NumArgs(); i++) { const IR::Type t1 = inst.GetArg(i).GetType(); const IR::Type t2 = IR::GetArgTypeOf(inst.GetOpcode(), i); - ASSERT(IR::AreTypesCompatible(t1, t2)); + DEBUG_ASSERT(IR::AreTypesCompatible(t1, t2)); } } ::Common::unordered_map actual_uses; @@ -1440,7 +1440,7 @@ static void VerificationPass(const IR::Block& block) { actual_uses[arg.GetInst()]++; } for (auto const& pair : actual_uses) - ASSERT(pair.first->UseCount() == pair.second); + DEBUG_ASSERT(pair.first->UseCount() == pair.second); } void Optimize(IR::Block& block, const A32::UserConfig& conf, const Optimization::PolyfillOptions& polyfill_options) { diff --git a/src/dynarmic/src/dynarmic/ir/value.cpp b/src/dynarmic/src/dynarmic/ir/value.cpp index 7f0249b1ec..4a7293ce50 100644 --- a/src/dynarmic/src/dynarmic/ir/value.cpp +++ b/src/dynarmic/src/dynarmic/ir/value.cpp @@ -119,32 +119,32 @@ Type Value::GetType() const noexcept { } A32::Reg Value::GetA32RegRef() const { - ASSERT(type == Type::A32Reg); + DEBUG_ASSERT(type == Type::A32Reg); return inner.imm_a32regref; } A32::ExtReg Value::GetA32ExtRegRef() const { - ASSERT(type == Type::A32ExtReg); + DEBUG_ASSERT(type == Type::A32ExtReg); return inner.imm_a32extregref; } A64::Reg Value::GetA64RegRef() const { - ASSERT(type == Type::A64Reg); + DEBUG_ASSERT(type == Type::A64Reg); return inner.imm_a64regref; } A64::Vec Value::GetA64VecRef() const { - ASSERT(type == Type::A64Vec); + DEBUG_ASSERT(type == Type::A64Vec); return inner.imm_a64vecref; } Inst* Value::GetInst() const { - ASSERT(type == Type::Opaque); + DEBUG_ASSERT(type == Type::Opaque); return inner.inst; } Inst* Value::GetInstRecursive() const { - ASSERT(type == Type::Opaque); + DEBUG_ASSERT(type == Type::Opaque); if (IsIdentity()) return inner.inst->GetArg(0).GetInstRecursive(); return inner.inst; @@ -153,61 +153,61 @@ Inst* Value::GetInstRecursive() const { bool Value::GetU1() const { if (IsIdentity()) return inner.inst->GetArg(0).GetU1(); - ASSERT(type == Type::U1); + DEBUG_ASSERT(type == Type::U1); return inner.imm_u1; } u8 Value::GetU8() const { if (IsIdentity()) return inner.inst->GetArg(0).GetU8(); - ASSERT(type == Type::U8); + DEBUG_ASSERT(type == Type::U8); return inner.imm_u8; } u16 Value::GetU16() const { if (IsIdentity()) return inner.inst->GetArg(0).GetU16(); - ASSERT(type == Type::U16); + DEBUG_ASSERT(type == Type::U16); return inner.imm_u16; } u32 Value::GetU32() const { if (IsIdentity()) return inner.inst->GetArg(0).GetU32(); - ASSERT(type == Type::U32); + DEBUG_ASSERT(type == Type::U32); return inner.imm_u32; } u64 Value::GetU64() const { if (IsIdentity()) return inner.inst->GetArg(0).GetU64(); - ASSERT(type == Type::U64); + DEBUG_ASSERT(type == Type::U64); return inner.imm_u64; } Value::CoprocessorInfo Value::GetCoprocInfo() const { if (IsIdentity()) return inner.inst->GetArg(0).GetCoprocInfo(); - ASSERT(type == Type::CoprocInfo); + DEBUG_ASSERT(type == Type::CoprocInfo); return inner.imm_coproc; } Cond Value::GetCond() const { if (IsIdentity()) return inner.inst->GetArg(0).GetCond(); - ASSERT(type == Type::Cond); + DEBUG_ASSERT(type == Type::Cond); return inner.imm_cond; } AccType Value::GetAccType() const { if (IsIdentity()) return inner.inst->GetArg(0).GetAccType(); - ASSERT(type == Type::AccType); + DEBUG_ASSERT(type == Type::AccType); return inner.imm_acctype; } s64 Value::GetImmediateAsS64() const { - ASSERT(IsImmediate()); + DEBUG_ASSERT(IsImmediate()); switch (GetType()) { case IR::Type::U1: return s64(GetU1()); @@ -225,7 +225,7 @@ s64 Value::GetImmediateAsS64() const { } u64 Value::GetImmediateAsU64() const { - ASSERT(IsImmediate()); + DEBUG_ASSERT(IsImmediate()); switch (GetType()) { case IR::Type::U1: return u64(GetU1()); diff --git a/src/dynarmic/src/dynarmic/ir/value.h b/src/dynarmic/src/dynarmic/ir/value.h index 1fec942e2e..44b4c37c02 100644 --- a/src/dynarmic/src/dynarmic/ir/value.h +++ b/src/dynarmic/src/dynarmic/ir/value.h @@ -147,12 +147,12 @@ public: template> /* implicit */ TypedValue(const TypedValue& value) : Value(value) { - ASSERT((value.GetType() & type_) != Type::Void); + DEBUG_ASSERT((value.GetType() & type_) != Type::Void); } explicit TypedValue(const Value& value) : Value(value) { - ASSERT((value.GetType() & type_) != Type::Void); + DEBUG_ASSERT((value.GetType() & type_) != Type::Void); } explicit TypedValue(Inst* inst) diff --git a/src/dynarmic/src/dynarmic/mcl/bit.hpp b/src/dynarmic/src/dynarmic/mcl/bit.hpp index ea4d6c057f..f8b285ab72 100644 --- a/src/dynarmic/src/dynarmic/mcl/bit.hpp +++ b/src/dynarmic/src/dynarmic/mcl/bit.hpp @@ -74,7 +74,7 @@ constexpr T ones() { /// Create a mask with `count` number of one bits. template constexpr T ones(size_t count) { - ASSERT(count <= bitsizeof && "count larger than bitsize of T"); + DEBUG_ASSERT(count <= bitsizeof && "count larger than bitsize of T"); if (count == 0) return 0; return T(~T(0)) >> (bitsizeof - count); @@ -92,9 +92,9 @@ constexpr T mask() { /// Create a mask of type T for bits [begin_bit, end_bit] inclusive. template constexpr T mask(size_t begin_bit, size_t end_bit) { - ASSERT(begin_bit <= end_bit && "invalid bit range (position of beginning bit cannot be greater than that of end bit)"); - ASSERT(begin_bit < bitsizeof && "begin_bit must be smaller than size of T"); - ASSERT(end_bit < bitsizeof && "end_bit must be smaller than size of T"); + DEBUG_ASSERT(begin_bit <= end_bit && "invalid bit range (position of beginning bit cannot be greater than that of end bit)"); + DEBUG_ASSERT(begin_bit < bitsizeof && "begin_bit must be smaller than size of T"); + DEBUG_ASSERT(end_bit < bitsizeof && "end_bit must be smaller than size of T"); return ones(end_bit - begin_bit + 1) << begin_bit; } @@ -194,7 +194,7 @@ constexpr T sign_extend(T value) { /// Sign-extends a value that has bit_count bits to the full bitwidth of type T. template constexpr T sign_extend(size_t bit_count, T value) { - ASSERT(bit_count != 0 && "cannot sign-extend zero-sized value"); + DEBUG_ASSERT(bit_count != 0 && "cannot sign-extend zero-sized value"); using S = std::make_signed_t; const size_t shift_amount = bitsizeof - bit_count; return T(S(value << shift_amount) >> shift_amount); @@ -222,8 +222,8 @@ constexpr T replicate_element(T value) { /// Replicate an element across a value of type T. template constexpr T replicate_element(size_t element_size, T value) { - ASSERT(element_size <= bitsizeof && "element_size is too large"); - ASSERT(bitsizeof % element_size == 0 && "bitsize of T not divisible by element_size"); + DEBUG_ASSERT(element_size <= bitsizeof && "element_size is too large"); + DEBUG_ASSERT(bitsizeof % element_size == 0 && "bitsize of T not divisible by element_size"); if (element_size == bitsizeof) return value; return replicate_element(element_size * 2, T(value | (value << element_size)));