2018-01-13 18:04:19 +00:00
|
|
|
/* This file is part of the dynarmic project.
|
|
|
|
* Copyright (c) 2018 MerryMage
|
2020-04-23 15:25:11 +01:00
|
|
|
* SPDX-License-Identifier: 0BSD
|
2018-01-13 18:04:19 +00:00
|
|
|
*/
|
|
|
|
|
2018-08-11 18:17:41 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <array>
|
|
|
|
#include <iosfwd>
|
2018-01-13 18:04:19 +00:00
|
|
|
|
2021-05-19 17:28:35 +01:00
|
|
|
#include "dynarmic/common/common_types.h"
|
2018-01-13 18:04:19 +00:00
|
|
|
|
2018-08-11 18:17:41 +01:00
|
|
|
using Vector = std::array<u64, 2>;
|
|
|
|
|
|
|
|
std::ostream& operator<<(std::ostream& o, Vector vec);
|
|
|
|
Vector RandomVector();
|
|
|
|
u32 RandomFpcr();
|
|
|
|
|
2018-01-13 18:04:19 +00:00
|
|
|
struct InstructionGenerator final {
|
|
|
|
public:
|
|
|
|
explicit InstructionGenerator(const char* format);
|
|
|
|
|
|
|
|
u32 Generate() const;
|
|
|
|
u32 Bits() const { return bits; }
|
|
|
|
u32 Mask() const { return mask; }
|
|
|
|
bool Match(u32 inst) const { return (inst & mask) == bits; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
u32 bits = 0;
|
|
|
|
u32 mask = 0;
|
|
|
|
};
|