mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-06 06:28:13 +01:00
Switch boost::optional to std::optional
This commit is contained in:
parent
85bc96a61c
commit
764a93bf5a
42 changed files with 137 additions and 125 deletions
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include "common/bit_util.h"
|
||||
#include "common/common_types.h"
|
||||
|
|
@ -78,14 +78,14 @@ public:
|
|||
}
|
||||
|
||||
/// Indicates the stride of a vector.
|
||||
boost::optional<size_t> Stride() const {
|
||||
std::optional<size_t> Stride() const {
|
||||
switch (Common::Bits<20, 21>(value)) {
|
||||
case 0b00:
|
||||
return 1;
|
||||
case 0b11:
|
||||
return 2;
|
||||
default:
|
||||
return boost::none;
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,10 +10,9 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
#include "common/bit_util.h"
|
||||
#include "common/common_types.h"
|
||||
#include "frontend/decoder/decoder_detail.h"
|
||||
|
|
@ -43,13 +42,13 @@ std::vector<ArmMatcher<V>> GetArmDecodeTable() {
|
|||
}
|
||||
|
||||
template<typename V>
|
||||
boost::optional<const ArmMatcher<V>&> DecodeArm(u32 instruction) {
|
||||
std::optional<std::reference_wrapper<const ArmMatcher<V>>> DecodeArm(u32 instruction) {
|
||||
static const auto table = GetArmDecodeTable<V>();
|
||||
|
||||
const auto matches_instruction = [instruction](const auto& matcher) { return matcher.Matches(instruction); };
|
||||
|
||||
auto iter = std::find_if(table.begin(), table.end(), matches_instruction);
|
||||
return iter != table.end() ? boost::optional<const ArmMatcher<V>&>(*iter) : boost::none;
|
||||
return iter != table.end() ? std::optional<std::reference_wrapper<const ArmMatcher<V>>>(*iter) : std::nullopt;
|
||||
}
|
||||
|
||||
} // namespace Dynarmic::A32
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@
|
|||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "frontend/decoder/decoder_detail.h"
|
||||
#include "frontend/decoder/matcher.h"
|
||||
|
|
@ -21,7 +21,7 @@ template <typename Visitor>
|
|||
using Thumb16Matcher = Decoder::Matcher<Visitor, u16>;
|
||||
|
||||
template<typename V>
|
||||
boost::optional<const Thumb16Matcher<V>&> DecodeThumb16(u16 instruction) {
|
||||
std::optional<std::reference_wrapper<const Thumb16Matcher<V>>> DecodeThumb16(u16 instruction) {
|
||||
static const std::vector<Thumb16Matcher<V>> table = {
|
||||
|
||||
#define INST(fn, name, bitstring) Decoder::detail::detail<Thumb16Matcher<V>>::GetMatcher(fn, name, bitstring)
|
||||
|
|
@ -120,7 +120,7 @@ boost::optional<const Thumb16Matcher<V>&> DecodeThumb16(u16 instruction) {
|
|||
const auto matches_instruction = [instruction](const auto& matcher){ return matcher.Matches(instruction); };
|
||||
|
||||
auto iter = std::find_if(table.begin(), table.end(), matches_instruction);
|
||||
return iter != table.end() ? boost::optional<const Thumb16Matcher<V>&>(*iter) : boost::none;
|
||||
return iter != table.end() ? std::optional<std::reference_wrapper<const Thumb16Matcher<V>>>(*iter) : std::nullopt;
|
||||
}
|
||||
|
||||
} // namespace Dynarmic::A32
|
||||
|
|
|
|||
|
|
@ -7,10 +7,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "frontend/decoder/decoder_detail.h"
|
||||
#include "frontend/decoder/matcher.h"
|
||||
|
|
@ -21,7 +20,7 @@ template <typename Visitor>
|
|||
using Thumb32Matcher = Decoder::Matcher<Visitor, u32>;
|
||||
|
||||
template<typename V>
|
||||
boost::optional<const Thumb32Matcher<V>&> DecodeThumb32(u32 instruction) {
|
||||
std::optional<std::reference_wrapper<const Thumb32Matcher<V>>> DecodeThumb32(u32 instruction) {
|
||||
static const std::vector<Thumb32Matcher<V>> table = {
|
||||
|
||||
#define INST(fn, name, bitstring) Decoder::detail::detail<Thumb32Matcher<V>>::GetMatcher(fn, name, bitstring)
|
||||
|
|
@ -349,7 +348,7 @@ boost::optional<const Thumb32Matcher<V>&> DecodeThumb32(u32 instruction) {
|
|||
const auto matches_instruction = [instruction](const auto& matcher){ return matcher.Matches(instruction); };
|
||||
|
||||
auto iter = std::find_if(table.begin(), table.end(), matches_instruction);
|
||||
return iter != table.end() ? boost::optional<const Thumb32Matcher<V>&>(*iter) : boost::none;
|
||||
return iter != table.end() ? std::optional<std::reference_wrapper<const Thumb32Matcher<V>>>(*iter) : std::nullopt;
|
||||
}
|
||||
|
||||
} // namespace Dynarmic::A32
|
||||
|
|
|
|||
|
|
@ -7,9 +7,10 @@
|
|||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "frontend/decoder/decoder_detail.h"
|
||||
|
|
@ -21,7 +22,7 @@ template <typename Visitor>
|
|||
using VFP2Matcher = Decoder::Matcher<Visitor, u32>;
|
||||
|
||||
template<typename V>
|
||||
boost::optional<const VFP2Matcher<V>&> DecodeVFP2(u32 instruction) {
|
||||
std::optional<std::reference_wrapper<const VFP2Matcher<V>>> DecodeVFP2(u32 instruction) {
|
||||
static const std::vector<VFP2Matcher<V>> table = {
|
||||
|
||||
#define INST(fn, name, bitstring) Decoder::detail::detail<VFP2Matcher<V>>::GetMatcher(&V::fn, name, bitstring),
|
||||
|
|
@ -31,12 +32,12 @@ boost::optional<const VFP2Matcher<V>&> DecodeVFP2(u32 instruction) {
|
|||
};
|
||||
|
||||
if ((instruction & 0xF0000000) == 0xF0000000)
|
||||
return boost::none; // Don't try matching any unconditional instructions.
|
||||
return std::nullopt; // Don't try matching any unconditional instructions.
|
||||
|
||||
const auto matches_instruction = [instruction](const auto& matcher){ return matcher.Matches(instruction); };
|
||||
|
||||
auto iter = std::find_if(table.begin(), table.end(), matches_instruction);
|
||||
return iter != table.end() ? boost::optional<const VFP2Matcher<V>&>(*iter) : boost::none;
|
||||
return iter != table.end() ? std::optional<std::reference_wrapper<const VFP2Matcher<V>>>(*iter) : std::nullopt;
|
||||
}
|
||||
|
||||
} // namespace Dynarmic::A32
|
||||
|
|
|
|||
|
|
@ -1068,9 +1068,9 @@ public:
|
|||
std::string DisassembleArm(u32 instruction) {
|
||||
DisassemblerVisitor visitor;
|
||||
if (auto vfp_decoder = DecodeVFP2<DisassemblerVisitor>(instruction)) {
|
||||
return vfp_decoder->call(visitor, instruction);
|
||||
return vfp_decoder->get().call(visitor, instruction);
|
||||
} else if (auto decoder = DecodeArm<DisassemblerVisitor>(instruction)) {
|
||||
return decoder->call(visitor, instruction);
|
||||
return decoder->get().call(visitor, instruction);
|
||||
} else {
|
||||
return fmt::format("UNKNOWN: {:x}", instruction);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -328,7 +328,7 @@ public:
|
|||
std::string DisassembleThumb16(u16 instruction) {
|
||||
DisassemblerVisitor visitor;
|
||||
auto decoder = DecodeThumb16<DisassemblerVisitor>(instruction);
|
||||
return !decoder ? fmt::format("UNKNOWN: {:x}", instruction) : decoder->call(visitor, instruction);
|
||||
return !decoder ? fmt::format("UNKNOWN: {:x}", instruction) : decoder->get().call(visitor, instruction);
|
||||
}
|
||||
|
||||
} // namespace Dynarmic::A32
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ IR::Block TranslateArm(LocationDescriptor descriptor, MemoryReadCodeFuncType mem
|
|||
const u32 arm_instruction = memory_read_code(arm_pc);
|
||||
|
||||
if (const auto vfp_decoder = DecodeVFP2<ArmTranslatorVisitor>(arm_instruction)) {
|
||||
should_continue = vfp_decoder->call(visitor, arm_instruction);
|
||||
should_continue = vfp_decoder->get().call(visitor, arm_instruction);
|
||||
} else if (const auto decoder = DecodeArm<ArmTranslatorVisitor>(arm_instruction)) {
|
||||
should_continue = decoder->call(visitor, arm_instruction);
|
||||
should_continue = decoder->get().call(visitor, arm_instruction);
|
||||
} else {
|
||||
should_continue = visitor.arm_UDF();
|
||||
}
|
||||
|
|
@ -73,9 +73,9 @@ bool TranslateSingleArmInstruction(IR::Block& block, LocationDescriptor descript
|
|||
|
||||
bool should_continue = true;
|
||||
if (const auto vfp_decoder = DecodeVFP2<ArmTranslatorVisitor>(arm_instruction)) {
|
||||
should_continue = vfp_decoder->call(visitor, arm_instruction);
|
||||
should_continue = vfp_decoder->get().call(visitor, arm_instruction);
|
||||
} else if (const auto decoder = DecodeArm<ArmTranslatorVisitor>(arm_instruction)) {
|
||||
should_continue = decoder->call(visitor, arm_instruction);
|
||||
should_continue = decoder->get().call(visitor, arm_instruction);
|
||||
} else {
|
||||
should_continue = visitor.arm_UDF();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -891,13 +891,13 @@ IR::Block TranslateThumb(LocationDescriptor descriptor, MemoryReadCodeFuncType m
|
|||
|
||||
if (inst_size == ThumbInstSize::Thumb16) {
|
||||
if (const auto decoder = DecodeThumb16<ThumbTranslatorVisitor>(static_cast<u16>(thumb_instruction))) {
|
||||
should_continue = decoder->call(visitor, static_cast<u16>(thumb_instruction));
|
||||
should_continue = decoder->get().call(visitor, static_cast<u16>(thumb_instruction));
|
||||
} else {
|
||||
should_continue = visitor.thumb16_UDF();
|
||||
}
|
||||
} else {
|
||||
if (const auto decoder = DecodeThumb32<ThumbTranslatorVisitor>(thumb_instruction)) {
|
||||
should_continue = decoder->call(visitor, thumb_instruction);
|
||||
should_continue = decoder->get().call(visitor, thumb_instruction);
|
||||
} else {
|
||||
should_continue = visitor.thumb32_UDF();
|
||||
}
|
||||
|
|
@ -920,13 +920,13 @@ bool TranslateSingleThumbInstruction(IR::Block& block, LocationDescriptor descri
|
|||
bool should_continue = true;
|
||||
if (is_thumb_16) {
|
||||
if (const auto decoder = DecodeThumb16<ThumbTranslatorVisitor>(static_cast<u16>(thumb_instruction))) {
|
||||
should_continue = decoder->call(visitor, static_cast<u16>(thumb_instruction));
|
||||
should_continue = decoder->get().call(visitor, static_cast<u16>(thumb_instruction));
|
||||
} else {
|
||||
should_continue = visitor.thumb16_UDF();
|
||||
}
|
||||
} else {
|
||||
if (const auto decoder = DecodeThumb32<ThumbTranslatorVisitor>(thumb_instruction)) {
|
||||
should_continue = decoder->call(visitor, thumb_instruction);
|
||||
should_continue = decoder->get().call(visitor, thumb_instruction);
|
||||
} else {
|
||||
should_continue = visitor.thumb32_UDF();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,11 +8,10 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
#include "common/bit_util.h"
|
||||
#include "common/common_types.h"
|
||||
#include "frontend/decoder/decoder_detail.h"
|
||||
|
|
@ -51,13 +50,13 @@ std::vector<Matcher<Visitor>> GetDecodeTable() {
|
|||
}
|
||||
|
||||
template<typename Visitor>
|
||||
boost::optional<const Matcher<Visitor>&> Decode(u32 instruction) {
|
||||
std::optional<std::reference_wrapper<const Matcher<Visitor>>> Decode(u32 instruction) {
|
||||
static const auto table = GetDecodeTable<Visitor>();
|
||||
|
||||
const auto matches_instruction = [instruction](const auto& matcher) { return matcher.Matches(instruction); };
|
||||
|
||||
auto iter = std::find_if(table.begin(), table.end(), matches_instruction);
|
||||
return iter != table.end() ? boost::optional<const Matcher<Visitor>&>(*iter) : boost::none;
|
||||
return iter != table.end() ? std::optional<std::reference_wrapper<const Matcher<Visitor>>>(*iter) : std::nullopt;
|
||||
}
|
||||
|
||||
} // namespace Dynarmic::A64
|
||||
|
|
|
|||
|
|
@ -7,8 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <initializer_list>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include <dynarmic/A64/config.h>
|
||||
|
||||
|
|
@ -30,7 +29,7 @@ public:
|
|||
explicit IREmitter(IR::Block& block) : IR::IREmitter(block) {}
|
||||
explicit IREmitter(IR::Block& block, LocationDescriptor descriptor) : IR::IREmitter(block), current_location(descriptor) {}
|
||||
|
||||
boost::optional<LocationDescriptor> current_location;
|
||||
std::optional<LocationDescriptor> current_location;
|
||||
|
||||
u64 PC();
|
||||
u64 AlignPC(size_t alignment);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* General Public License version 2 or any later version.
|
||||
*/
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include "frontend/A64/translate/impl/impl.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* General Public License version 2 or any later version.
|
||||
*/
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include "frontend/A64/translate/impl/impl.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* General Public License version 2 or any later version.
|
||||
*/
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include "frontend/A64/translate/impl/impl.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* General Public License version 2 or any later version.
|
||||
*/
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include "frontend/A64/translate/impl/impl.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* General Public License version 2 or any later version.
|
||||
*/
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include "common/fp/rounding_mode.h"
|
||||
#include "frontend/A64/translate/impl/impl.h"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* General Public License version 2 or any later version.
|
||||
*/
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include "frontend/A64/translate/impl/impl.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* General Public License version 2 or any later version.
|
||||
*/
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include "frontend/A64/translate/impl/impl.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* General Public License version 2 or any later version.
|
||||
*/
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include "frontend/A64/translate/impl/impl.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -39,15 +39,15 @@ bool TranslatorVisitor::RaiseException(Exception exception) {
|
|||
return false;
|
||||
}
|
||||
|
||||
boost::optional<TranslatorVisitor::BitMasks> TranslatorVisitor::DecodeBitMasks(bool immN, Imm<6> imms, Imm<6> immr, bool immediate) {
|
||||
std::optional<TranslatorVisitor::BitMasks> TranslatorVisitor::DecodeBitMasks(bool immN, Imm<6> imms, Imm<6> immr, bool immediate) {
|
||||
int len = Common::HighestSetBit((immN ? 1 << 6 : 0) | (imms.ZeroExtend() ^ 0b111111));
|
||||
if (len < 1)
|
||||
return boost::none;
|
||||
return std::nullopt;
|
||||
|
||||
size_t levels = Common::Ones<size_t>(len);
|
||||
|
||||
if (immediate && (imms.ZeroExtend() & levels) == levels)
|
||||
return boost::none;
|
||||
return std::nullopt;
|
||||
|
||||
s32 S = s32(imms.ZeroExtend() & levels);
|
||||
s32 R = s32(immr.ZeroExtend() & levels);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include "frontend/A64/imm.h"
|
||||
#include "frontend/A64/ir_emitter.h"
|
||||
|
|
@ -43,7 +43,7 @@ struct TranslatorVisitor final {
|
|||
u64 wmask, tmask;
|
||||
};
|
||||
|
||||
boost::optional<BitMasks> DecodeBitMasks(bool N, Imm<6> immr, Imm<6> imms, bool immediate);
|
||||
std::optional<BitMasks> DecodeBitMasks(bool N, Imm<6> immr, Imm<6> imms, bool immediate);
|
||||
u64 AdvSIMDExpandImm(bool op, Imm<4> cmode, Imm<8> imm8);
|
||||
|
||||
IR::UAny I(size_t bitsize, u64 value);
|
||||
|
|
@ -1069,7 +1069,7 @@ struct TranslatorVisitor final {
|
|||
bool FNMSUB_float(Imm<2> type, Vec Vm, Vec Va, Vec Vn, Vec Vd);
|
||||
};
|
||||
|
||||
inline boost::optional<size_t> FPGetDataSize(Imm<2> type) {
|
||||
inline std::optional<size_t> FPGetDataSize(Imm<2> type) {
|
||||
switch (type.ZeroExtend()) {
|
||||
case 0b00:
|
||||
return 32;
|
||||
|
|
@ -1078,7 +1078,7 @@ inline boost::optional<size_t> FPGetDataSize(Imm<2> type) {
|
|||
case 0b11:
|
||||
return 16;
|
||||
}
|
||||
return boost::none;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
} // namespace Dynarmic::A64
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@
|
|||
* General Public License version 2 or any later version.
|
||||
*/
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include "frontend/A64/translate/impl/impl.h"
|
||||
|
||||
namespace Dynarmic::A64 {
|
||||
|
||||
static bool ExclusiveSharedDecodeAndOperation(TranslatorVisitor& v, bool pair, size_t size, bool L, bool o0, boost::optional<Reg> Rs, boost::optional<Reg> Rt2, Reg Rn, Reg Rt) {
|
||||
static bool ExclusiveSharedDecodeAndOperation(TranslatorVisitor& v, bool pair, size_t size, bool L, bool o0, std::optional<Reg> Rs, std::optional<Reg> Rt2, Reg Rn, Reg Rt) {
|
||||
// Shared Decode
|
||||
|
||||
const AccType acctype = o0 ? AccType::ORDERED : AccType::ATOMIC;
|
||||
|
|
|
|||
|
|
@ -5,14 +5,13 @@
|
|||
*/
|
||||
|
||||
#include <tuple>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include "frontend/A64/translate/impl/impl.h"
|
||||
|
||||
namespace Dynarmic::A64 {
|
||||
|
||||
static bool SharedDecodeAndOperation(TranslatorVisitor& v, bool wback, MemOp memop, bool Q, boost::optional<Reg> Rm, Imm<4> opcode, Imm<2> size, Reg Rn, Vec Vt) {
|
||||
static bool SharedDecodeAndOperation(TranslatorVisitor& v, bool wback, MemOp memop, bool Q, std::optional<Reg> Rm, Imm<4> opcode, Imm<2> size, Reg Rn, Vec Vt) {
|
||||
const size_t datasize = Q ? 128 : 64;
|
||||
const size_t esize = 8 << size.ZeroExtend<size_t>();
|
||||
const size_t elements = datasize / esize;
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@
|
|||
* General Public License version 2 or any later version.
|
||||
*/
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include "frontend/A64/translate/impl/impl.h"
|
||||
|
||||
namespace Dynarmic::A64 {
|
||||
|
||||
static bool SharedDecodeAndOperation(TranslatorVisitor& v, bool wback, MemOp memop,
|
||||
bool Q, bool S, bool R, bool replicate, boost::optional<Reg> Rm,
|
||||
bool Q, bool S, bool R, bool replicate, std::optional<Reg> Rm,
|
||||
Imm<3> opcode, Imm<2> size, Reg Rn, Vec Vt) {
|
||||
const size_t selem = (opcode.Bit<0>() << 1 | u32{R}) + 1;
|
||||
size_t scale = opcode.Bits<1, 2>();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@
|
|||
* General Public License version 2 or any later version.
|
||||
*/
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include "common/bit_util.h"
|
||||
#include "frontend/A64/translate/impl/impl.h"
|
||||
|
||||
|
|
@ -49,7 +50,7 @@ bool RoundingShiftLeft(TranslatorVisitor& v, Imm<2> size, Vec Vm, Vec Vn, Vec Vd
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ScalarCompare(TranslatorVisitor& v, Imm<2> size, boost::optional<Vec> Vm, Vec Vn, Vec Vd,
|
||||
bool ScalarCompare(TranslatorVisitor& v, Imm<2> size, std::optional<Vec> Vm, Vec Vn, Vec Vd,
|
||||
ComparisonType type, ComparisonVariant variant) {
|
||||
if (size != 0b11) {
|
||||
return v.ReservedValue();
|
||||
|
|
@ -59,7 +60,7 @@ bool ScalarCompare(TranslatorVisitor& v, Imm<2> size, boost::optional<Vec> Vm, V
|
|||
const size_t datasize = 64;
|
||||
|
||||
const IR::U128 operand1 = v.V(datasize, Vn);
|
||||
const IR::U128 operand2 = variant == ComparisonVariant::Register ? v.V(datasize, Vm.get()) : v.ir.ZeroVector();
|
||||
const IR::U128 operand2 = variant == ComparisonVariant::Register ? v.V(datasize, *Vm) : v.ir.ZeroVector();
|
||||
|
||||
const IR::U128 result = [&] {
|
||||
switch (type) {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ IR::Block Translate(LocationDescriptor descriptor, MemoryReadCodeFuncType memory
|
|||
const u32 instruction = memory_read_code(pc);
|
||||
|
||||
if (auto decoder = Decode<TranslatorVisitor>(instruction)) {
|
||||
should_continue = decoder->call(visitor, instruction);
|
||||
should_continue = decoder->get().call(visitor, instruction);
|
||||
} else {
|
||||
should_continue = visitor.InterpretThisInstruction();
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ bool TranslateSingleInstruction(IR::Block& block, LocationDescriptor descriptor,
|
|||
|
||||
bool should_continue = true;
|
||||
if (auto decoder = Decode<TranslatorVisitor>(instruction)) {
|
||||
should_continue = decoder->call(visitor, instruction);
|
||||
should_continue = decoder->get().call(visitor, instruction);
|
||||
} else {
|
||||
should_continue = visitor.InterpretThisInstruction();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ void Block::SetCondition(Cond condition) {
|
|||
}
|
||||
|
||||
LocationDescriptor Block::ConditionFailedLocation() const {
|
||||
return cond_failed.get();
|
||||
return *cond_failed;
|
||||
}
|
||||
|
||||
void Block::SetConditionFailedLocation(LocationDescriptor fail_location) {
|
||||
|
|
@ -73,7 +73,7 @@ const size_t& Block::ConditionFailedCycleCount() const {
|
|||
}
|
||||
|
||||
bool Block::HasConditionFailedLocation() const {
|
||||
return cond_failed.is_initialized();
|
||||
return cond_failed.has_value();
|
||||
}
|
||||
|
||||
Block::InstructionList& Block::Instructions() {
|
||||
|
|
|
|||
|
|
@ -8,10 +8,9 @@
|
|||
|
||||
#include <initializer_list>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "common/intrusive_list.h"
|
||||
#include "common/memory_pool.h"
|
||||
|
|
@ -139,7 +138,7 @@ private:
|
|||
/// Conditional to pass in order to execute this block
|
||||
Cond cond = Cond::AL;
|
||||
/// Block to execute next if `cond` did not pass.
|
||||
boost::optional<LocationDescriptor> cond_failed = {};
|
||||
std::optional<LocationDescriptor> cond_failed = {};
|
||||
/// Number of cycles this block takes to execute if the conditional fails.
|
||||
size_t cond_failed_cycle_count = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue