dynarmic/tests/fuzz_util.h

33 lines
753 B
C
Raw Normal View History

2018-01-13 19:04:19 +01:00
/* This file is part of the dynarmic project.
* Copyright (c) 2018 MerryMage
* This software may be used and distributed according to the terms of the GNU
* General Public License version 2 or any later version.
*/
#pragma once
#include <array>
#include <iosfwd>
2018-01-13 19:04:19 +01:00
#include "common/common_types.h"
using Vector = std::array<u64, 2>;
std::ostream& operator<<(std::ostream& o, Vector vec);
Vector RandomVector();
u32 RandomFpcr();
2018-01-13 19:04:19 +01: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;
};