xb format --all (we are now format clean). Buildbot will yell at you.
This commit is contained in:
parent
f902f8b78a
commit
fb1f4906d9
|
@ -15,6 +15,16 @@ Code that really breaks from the formatting rules will not be accepted, as then
|
|||
no one else can use clang-format on the code without also touching all your
|
||||
lines.
|
||||
|
||||
The buildbot runs `xb lint --all` on the master branch, and will run
|
||||
`xb lint --origin` on pull requests. Run `xb format` before you commit each
|
||||
local change so that you are consistently clean, otherwise you may have to
|
||||
rebase. If you forget, run `xb format --origin` and rebase your changes (so you
|
||||
don't end up with 5 changes and then a 6th 'whoops' one - that's nasty).
|
||||
|
||||
The buildbot is running LLVM 3.6.1. If you are noticing style differences
|
||||
between your local lint/format and the buildbot, ensure you are running that
|
||||
version.
|
||||
|
||||
## Tools
|
||||
|
||||
### clang-format
|
||||
|
|
|
@ -35,7 +35,8 @@ using namespace System::Security::Permissions;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the value or you can default the Revision and Build Numbers
|
||||
// You can specify all the value or you can default the Revision and Build
|
||||
// Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly:AssemblyVersionAttribute("1.0.*")];
|
||||
|
|
|
@ -42,7 +42,7 @@ Disassembler::~Disassembler() {
|
|||
delete string_buffer_;
|
||||
}
|
||||
|
||||
String^ Disassembler::DisassemblePPC(IntPtr code_address, size_t code_size) {
|
||||
String ^ Disassembler::DisassemblePPC(IntPtr code_address, size_t code_size) {
|
||||
string_buffer_->Reset();
|
||||
|
||||
auto code_base = reinterpret_cast<const uint32_t*>(code_address.ToPointer());
|
||||
|
@ -59,7 +59,7 @@ String^ Disassembler::DisassemblePPC(IntPtr code_address, size_t code_size) {
|
|||
return gcnew String(string_buffer_->ToString());
|
||||
}
|
||||
|
||||
String^ Disassembler::DisassembleX64(IntPtr code_address, size_t code_size) {
|
||||
String ^ Disassembler::DisassembleX64(IntPtr code_address, size_t code_size) {
|
||||
string_buffer_->Reset();
|
||||
|
||||
auto code_base = reinterpret_cast<const uint8_t*>(code_address.ToPointer());
|
||||
|
|
|
@ -21,13 +21,14 @@ namespace Native {
|
|||
using namespace System;
|
||||
using namespace System::Text;
|
||||
|
||||
public ref class Disassembler {
|
||||
public
|
||||
ref class Disassembler {
|
||||
public:
|
||||
Disassembler();
|
||||
~Disassembler();
|
||||
|
||||
String^ DisassemblePPC(IntPtr code_address, size_t code_size);
|
||||
String^ DisassembleX64(IntPtr code_address, size_t code_size);
|
||||
String ^ DisassemblePPC(IntPtr code_address, size_t code_size);
|
||||
String ^ DisassembleX64(IntPtr code_address, size_t code_size);
|
||||
|
||||
private:
|
||||
uintptr_t capstone_handle_;
|
||||
|
|
|
@ -38,15 +38,14 @@ namespace apu {
|
|||
using namespace xe::cpu;
|
||||
|
||||
AudioSystem::AudioSystem(Emulator* emulator)
|
||||
: emulator_(emulator),
|
||||
memory_(emulator->memory()),
|
||||
worker_running_(false) {
|
||||
: emulator_(emulator), memory_(emulator->memory()), worker_running_(false) {
|
||||
std::memset(clients_, 0, sizeof(clients_));
|
||||
for (size_t i = 0; i < kMaximumClientCount; ++i) {
|
||||
unused_clients_.push(i);
|
||||
}
|
||||
for (size_t i = 0; i < kMaximumClientCount; ++i) {
|
||||
client_semaphores_[i] = CreateSemaphore(NULL, 0, kMaximumQueuedFrames, NULL);
|
||||
client_semaphores_[i] =
|
||||
CreateSemaphore(NULL, 0, kMaximumQueuedFrames, NULL);
|
||||
wait_handles_[i] = client_semaphores_[i];
|
||||
}
|
||||
shutdown_event_ = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||
|
|
|
@ -48,7 +48,8 @@ class AudioSystem {
|
|||
AudioDriver** out_driver) = 0;
|
||||
virtual void DestroyDriver(AudioDriver* driver) = 0;
|
||||
|
||||
// TODO(gibbed): respect XAUDIO2_MAX_QUEUED_BUFFERS somehow (ie min(64, XAUDIO2_MAX_QUEUED_BUFFERS))
|
||||
// TODO(gibbed): respect XAUDIO2_MAX_QUEUED_BUFFERS somehow (ie min(64,
|
||||
// XAUDIO2_MAX_QUEUED_BUFFERS))
|
||||
static const size_t kMaximumQueuedFrames = 64;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -27,15 +27,15 @@ namespace xe {
|
|||
namespace apu {
|
||||
|
||||
XmaContext::XmaContext()
|
||||
: id_(0)
|
||||
, guest_ptr_(0)
|
||||
, is_allocated_(false)
|
||||
, is_enabled_(false)
|
||||
, decoding_packet_(false)
|
||||
, codec_(nullptr)
|
||||
, context_(nullptr)
|
||||
, decoded_frame_(nullptr)
|
||||
, packet_(nullptr) {}
|
||||
: id_(0),
|
||||
guest_ptr_(0),
|
||||
is_allocated_(false),
|
||||
is_enabled_(false),
|
||||
decoding_packet_(false),
|
||||
codec_(nullptr),
|
||||
context_(nullptr),
|
||||
decoded_frame_(nullptr),
|
||||
packet_(nullptr) {}
|
||||
|
||||
XmaContext::~XmaContext() {
|
||||
if (context_) {
|
||||
|
@ -48,11 +48,11 @@ XmaContext::~XmaContext() {
|
|||
av_frame_free(&decoded_frame_);
|
||||
}
|
||||
if (current_frame_) {
|
||||
delete [] current_frame_;
|
||||
delete[] current_frame_;
|
||||
}
|
||||
}
|
||||
|
||||
int XmaContext::Setup(uint32_t id, Memory* memory, uint32_t guest_ptr) {
|
||||
int XmaContext::Setup(uint32_t id, Memory *memory, uint32_t guest_ptr) {
|
||||
id_ = id;
|
||||
memory_ = memory;
|
||||
guest_ptr_ = guest_ptr;
|
||||
|
@ -94,7 +94,7 @@ int XmaContext::Setup(uint32_t id, Memory* memory, uint32_t guest_ptr) {
|
|||
extra_data_.decode_flags = 0x10D6;
|
||||
|
||||
context_->extradata_size = sizeof(extra_data_);
|
||||
context_->extradata = (uint8_t*)&extra_data_;
|
||||
context_->extradata = (uint8_t *)&extra_data_;
|
||||
|
||||
// Current frame stuff whatever
|
||||
// samples per frame * 2 max channels * output bytes
|
||||
|
@ -126,10 +126,11 @@ void XmaContext::Enable() {
|
|||
auto context_ptr = memory()->TranslateVirtual(guest_ptr());
|
||||
XMA_CONTEXT_DATA data(context_ptr);
|
||||
|
||||
XELOGAPU("XmaContext: kicking context %d (%d/%d bytes)", id(),
|
||||
XELOGAPU(
|
||||
"XmaContext: kicking context %d (%d/%d bytes)", id(),
|
||||
(data.input_buffer_read_offset & ~0x7FF) / 8,
|
||||
(data.input_buffer_0_packet_count + data.input_buffer_1_packet_count)
|
||||
* kBytesPerPacket);
|
||||
(data.input_buffer_0_packet_count + data.input_buffer_1_packet_count) *
|
||||
kBytesPerPacket);
|
||||
|
||||
// Reset valid flags so our audio decoder knows to process this one.
|
||||
data.input_buffer_0_valid = data.input_buffer_0_ptr != 0;
|
||||
|
@ -190,16 +191,20 @@ void XmaContext::Release() {
|
|||
|
||||
int XmaContext::GetSampleRate(int id) {
|
||||
switch (id) {
|
||||
case 0: return 24000;
|
||||
case 1: return 32000;
|
||||
case 2: return 44100;
|
||||
case 3: return 48000;
|
||||
case 0:
|
||||
return 24000;
|
||||
case 1:
|
||||
return 32000;
|
||||
case 2:
|
||||
return 44100;
|
||||
case 3:
|
||||
return 48000;
|
||||
}
|
||||
assert_always();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void XmaContext::DecodePackets(XMA_CONTEXT_DATA& data) {
|
||||
void XmaContext::DecodePackets(XMA_CONTEXT_DATA &data) {
|
||||
SCOPE_profile_cpu_f("apu");
|
||||
|
||||
// What I see:
|
||||
|
@ -231,10 +236,12 @@ void XmaContext::DecodePackets(XMA_CONTEXT_DATA& data) {
|
|||
// Output buffers are in raw PCM samples, 256 bytes per block.
|
||||
// Output buffer is a ring buffer. We need to write from the write offset
|
||||
// to the read offset.
|
||||
uint8_t* output_buffer = memory()->TranslatePhysical(data.output_buffer_ptr);
|
||||
uint8_t *output_buffer = memory()->TranslatePhysical(data.output_buffer_ptr);
|
||||
uint32_t output_capacity = data.output_buffer_block_count * kBytesPerSubframe;
|
||||
uint32_t output_read_offset = data.output_buffer_read_offset * kBytesPerSubframe;
|
||||
uint32_t output_write_offset = data.output_buffer_write_offset * kBytesPerSubframe;
|
||||
uint32_t output_read_offset =
|
||||
data.output_buffer_read_offset * kBytesPerSubframe;
|
||||
uint32_t output_write_offset =
|
||||
data.output_buffer_write_offset * kBytesPerSubframe;
|
||||
|
||||
RingBuffer output_rb(output_buffer, output_capacity);
|
||||
output_rb.set_read_offset(output_read_offset);
|
||||
|
@ -254,7 +261,7 @@ void XmaContext::DecodePackets(XMA_CONTEXT_DATA& data) {
|
|||
while (decode_attempts_remaining) {
|
||||
read_bytes = DecodePacket(work_buffer, 0, output_remaining_bytes);
|
||||
if (read_bytes >= 0) {
|
||||
//assert_true((read_bytes % 256) == 0);
|
||||
// assert_true((read_bytes % 256) == 0);
|
||||
auto written_bytes = output_rb.Write(work_buffer, read_bytes);
|
||||
assert_true(read_bytes == written_bytes);
|
||||
|
||||
|
@ -269,7 +276,8 @@ void XmaContext::DecodePackets(XMA_CONTEXT_DATA& data) {
|
|||
}
|
||||
|
||||
if (!decode_attempts_remaining) {
|
||||
XELOGAPU("XmaContext: libav failed to decode packet (returned %.8X)", -read_bytes);
|
||||
XELOGAPU("XmaContext: libav failed to decode packet (returned %.8X)",
|
||||
-read_bytes);
|
||||
|
||||
// Failed out.
|
||||
if (data.input_buffer_0_valid || data.input_buffer_1_valid) {
|
||||
|
@ -309,10 +317,10 @@ void XmaContext::DecodePackets(XMA_CONTEXT_DATA& data) {
|
|||
|
||||
int XmaContext::StartPacket(XMA_CONTEXT_DATA &data) {
|
||||
// Translate pointers for future use.
|
||||
uint8_t* in0 = data.input_buffer_0_valid
|
||||
uint8_t *in0 = data.input_buffer_0_valid
|
||||
? memory()->TranslatePhysical(data.input_buffer_0_ptr)
|
||||
: nullptr;
|
||||
uint8_t* in1 = data.input_buffer_1_valid
|
||||
uint8_t *in1 = data.input_buffer_1_valid
|
||||
? memory()->TranslatePhysical(data.input_buffer_1_ptr)
|
||||
: nullptr;
|
||||
|
||||
|
@ -348,9 +356,8 @@ int XmaContext::StartPacket(XMA_CONTEXT_DATA &data) {
|
|||
// Still have data to read.
|
||||
auto packet = input_buffer + input_offset_bytes;
|
||||
assert_true(input_offset_bytes % 2048 == 0);
|
||||
PreparePacket(packet, seq_offset_bytes,
|
||||
kBytesPerPacket,
|
||||
sample_rate, channels);
|
||||
PreparePacket(packet, seq_offset_bytes, kBytesPerPacket, sample_rate,
|
||||
channels);
|
||||
data.input_buffer_read_offset += kBytesPerPacket * 8;
|
||||
|
||||
input_remaining_bytes -= kBytesPerPacket;
|
||||
|
@ -395,7 +402,8 @@ int XmaContext::PreparePacket(uint8_t *input, size_t seq_offset, size_t size,
|
|||
|
||||
context_->sample_rate = sample_rate;
|
||||
context_->channels = channels;
|
||||
extra_data_.channel_mask = channels == 2 ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
|
||||
extra_data_.channel_mask =
|
||||
channels == 2 ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
|
||||
|
||||
if (avcodec_open2(context_, codec_, NULL) < 0) {
|
||||
XELOGE("XmaContext: Failed to reopen libav context");
|
||||
|
@ -487,8 +495,7 @@ int XmaContext::DecodePacket(uint8_t *output, size_t output_offset,
|
|||
|
||||
// Total size of the frame's samples
|
||||
// Magic number 2 is sizeof an output sample
|
||||
frame_samples_size_ =
|
||||
context_->channels * decoded_frame_->nb_samples * 2;
|
||||
frame_samples_size_ = context_->channels * decoded_frame_->nb_samples * 2;
|
||||
|
||||
to_copy = std::min(output_size, (size_t)(frame_samples_size_));
|
||||
std::memcpy(output + output_offset, current_frame_, to_copy);
|
||||
|
|
|
@ -133,7 +133,8 @@ class XmaContext {
|
|||
static const uint32_t kBytesPerSample = 2;
|
||||
static const uint32_t kSamplesPerFrame = 512;
|
||||
static const uint32_t kSamplesPerSubframe = 128;
|
||||
static const uint32_t kBytesPerSubframe = kSamplesPerSubframe * kBytesPerSample;
|
||||
static const uint32_t kBytesPerSubframe =
|
||||
kSamplesPerSubframe * kBytesPerSample;
|
||||
|
||||
static const uint32_t kOutputBytesPerBlock = 256;
|
||||
static const uint32_t kOutputMaxSizeBytes = 31 * kOutputBytesPerBlock;
|
||||
|
@ -164,7 +165,7 @@ class XmaContext {
|
|||
static int GetSampleRate(int id);
|
||||
|
||||
void DecodePackets(XMA_CONTEXT_DATA& data);
|
||||
int StartPacket(XMA_CONTEXT_DATA &data);
|
||||
int StartPacket(XMA_CONTEXT_DATA& data);
|
||||
|
||||
int PreparePacket(uint8_t* input, size_t seq_offset, size_t size,
|
||||
int sample_rate, int channels);
|
||||
|
|
|
@ -53,17 +53,16 @@ namespace apu {
|
|||
using namespace xe::cpu;
|
||||
|
||||
XmaDecoder::XmaDecoder(Emulator* emulator)
|
||||
: emulator_(emulator)
|
||||
, memory_(emulator->memory())
|
||||
, processor_(emulator->processor())
|
||||
, worker_running_(false)
|
||||
, context_data_first_ptr_(0)
|
||||
, context_data_last_ptr_(0) {
|
||||
}
|
||||
: emulator_(emulator),
|
||||
memory_(emulator->memory()),
|
||||
processor_(emulator->processor()),
|
||||
worker_running_(false),
|
||||
context_data_first_ptr_(0),
|
||||
context_data_last_ptr_(0) {}
|
||||
|
||||
XmaDecoder::~XmaDecoder() {}
|
||||
|
||||
void av_log_callback(void *avcl, int level, const char *fmt, va_list va) {
|
||||
void av_log_callback(void* avcl, int level, const char* fmt, va_list va) {
|
||||
StringBuffer buff;
|
||||
buff.AppendVarargs(fmt, va);
|
||||
xe::log_line('i', "libav: %s", buff.GetString());
|
||||
|
@ -82,12 +81,14 @@ X_STATUS XmaDecoder::Setup() {
|
|||
// Setup XMA context data.
|
||||
context_data_first_ptr_ = memory()->SystemHeapAlloc(
|
||||
sizeof(XMA_CONTEXT_DATA) * kContextCount, 256, kSystemHeapPhysical);
|
||||
context_data_last_ptr_ = context_data_first_ptr_ + (sizeof(XMA_CONTEXT_DATA) * kContextCount - 1);
|
||||
context_data_last_ptr_ =
|
||||
context_data_first_ptr_ + (sizeof(XMA_CONTEXT_DATA) * kContextCount - 1);
|
||||
registers_.context_array_ptr = context_data_first_ptr_;
|
||||
|
||||
// Setup XMA contexts.
|
||||
for (int i = 0; i < kContextCount; ++i) {
|
||||
uint32_t guest_ptr = registers_.context_array_ptr + i * sizeof(XMA_CONTEXT_DATA);
|
||||
uint32_t guest_ptr =
|
||||
registers_.context_array_ptr + i * sizeof(XMA_CONTEXT_DATA);
|
||||
XmaContext& context = contexts_[i];
|
||||
if (context.Setup(i, memory(), guest_ptr)) {
|
||||
assert_always();
|
||||
|
|
|
@ -41,9 +41,7 @@ class XmaDecoder {
|
|||
virtual X_STATUS Setup();
|
||||
virtual void Shutdown();
|
||||
|
||||
uint32_t context_array_ptr() const {
|
||||
return registers_.context_array_ptr;
|
||||
}
|
||||
uint32_t context_array_ptr() const { return registers_.context_array_ptr; }
|
||||
|
||||
uint32_t AllocateContext();
|
||||
void ReleaseContext(uint32_t guest_ptr);
|
||||
|
|
|
@ -66,9 +66,7 @@ void* Arena::Alloc(size_t size) {
|
|||
return p;
|
||||
}
|
||||
|
||||
void Arena::Rewind(size_t size) {
|
||||
active_chunk_->offset -= size;
|
||||
}
|
||||
void Arena::Rewind(size_t size) { active_chunk_->offset -= size; }
|
||||
|
||||
void* Arena::CloneContents() {
|
||||
size_t total_length = 0;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
namespace xe {
|
||||
|
||||
template <typename T, size_t N>
|
||||
size_t countof(T (&arr)[N]) {
|
||||
size_t countof(T(&arr)[N]) {
|
||||
return std::extent<T[N]>::value;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,10 +15,7 @@
|
|||
namespace xe {
|
||||
|
||||
RingBuffer::RingBuffer(uint8_t* buffer, size_t capacity)
|
||||
: buffer_(buffer)
|
||||
, capacity_(capacity)
|
||||
, read_offset_(0)
|
||||
, write_offset_(0) {}
|
||||
: buffer_(buffer), capacity_(capacity), read_offset_(0), write_offset_(0) {}
|
||||
|
||||
size_t RingBuffer::Read(uint8_t* buffer, size_t count) {
|
||||
count = std::min(count, capacity_);
|
||||
|
|
|
@ -48,13 +48,9 @@ class RingBuffer {
|
|||
}
|
||||
}
|
||||
|
||||
void set_read_offset(size_t offset) {
|
||||
read_offset_ = offset % capacity_;
|
||||
}
|
||||
void set_read_offset(size_t offset) { read_offset_ = offset % capacity_; }
|
||||
|
||||
void set_write_offset(size_t offset) {
|
||||
write_offset_ = offset % capacity_;
|
||||
}
|
||||
void set_write_offset(size_t offset) { write_offset_ = offset % capacity_; }
|
||||
|
||||
private:
|
||||
uint8_t* buffer_;
|
||||
|
|
|
@ -66,7 +66,8 @@ bool X64CodeCache::Initialize() {
|
|||
|
||||
// Create mmap file. This allows us to share the code cache with the debugger.
|
||||
wchar_t file_name[256];
|
||||
wsprintf(file_name, L"Local\\xenia_code_cache_%p", Clock::QueryHostTickCount());
|
||||
wsprintf(file_name, L"Local\\xenia_code_cache_%p",
|
||||
Clock::QueryHostTickCount());
|
||||
file_name_ = file_name;
|
||||
mapping_ = CreateFileMapping(INVALID_HANDLE_VALUE, NULL,
|
||||
PAGE_EXECUTE_READWRITE | SEC_RESERVE, 0,
|
||||
|
|
|
@ -358,8 +358,9 @@ template <hir::Opcode OPCODE, typename DEST, typename SRC1, typename SRC2>
|
|||
struct I<OPCODE, DEST, SRC1, SRC2> : DestField<DEST> {
|
||||
typedef DestField<DEST> BASE;
|
||||
static const hir::Opcode opcode = OPCODE;
|
||||
static const uint32_t key = InstrKey::Construct<
|
||||
OPCODE, DEST::key_type, SRC1::key_type, SRC2::key_type>::value;
|
||||
static const uint32_t key =
|
||||
InstrKey::Construct<OPCODE, DEST::key_type, SRC1::key_type,
|
||||
SRC2::key_type>::value;
|
||||
static const KeyType dest_type = DEST::key_type;
|
||||
static const KeyType src1_type = SRC1::key_type;
|
||||
static const KeyType src2_type = SRC2::key_type;
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
// TODO(benvanik): fix this so we can auto format.
|
||||
// clang-format off
|
||||
|
||||
// A note about vectors:
|
||||
// Xenia represents vectors as xyzw pairs, with indices 0123.
|
||||
// XMM registers are xyzw pairs with indices 3210, making them more like wzyx.
|
||||
|
|
|
@ -65,41 +65,41 @@ void Disasm_X_FRT_RA0_RB(InstrData& i, StringBuffer* str) {
|
|||
}
|
||||
void Disasm_D_RT_RA_I(InstrData& i, StringBuffer* str) {
|
||||
str->AppendFormat("%-8s r%d, r%d, %d", i.type->name, i.D.RT, i.D.RA,
|
||||
(int32_t)(int16_t) XEEXTS16(i.D.DS));
|
||||
(int32_t)(int16_t)XEEXTS16(i.D.DS));
|
||||
}
|
||||
void Disasm_D_RT_RA0_I(InstrData& i, StringBuffer* str) {
|
||||
if (i.D.RA) {
|
||||
str->AppendFormat("%-8s r%d, r%d, %d", i.type->name, i.D.RT, i.D.RA,
|
||||
(int32_t)(int16_t) XEEXTS16(i.D.DS));
|
||||
(int32_t)(int16_t)XEEXTS16(i.D.DS));
|
||||
} else {
|
||||
str->AppendFormat("%-8s r%d, 0, %d", i.type->name, i.D.RT,
|
||||
(int32_t)(int16_t) XEEXTS16(i.D.DS));
|
||||
(int32_t)(int16_t)XEEXTS16(i.D.DS));
|
||||
}
|
||||
}
|
||||
void Disasm_D_FRT_RA_I(InstrData& i, StringBuffer* str) {
|
||||
str->AppendFormat("%-8s f%d, r%d, %d", i.type->name, i.D.RT, i.D.RA,
|
||||
(int32_t)(int16_t) XEEXTS16(i.D.DS));
|
||||
(int32_t)(int16_t)XEEXTS16(i.D.DS));
|
||||
}
|
||||
void Disasm_D_FRT_RA0_I(InstrData& i, StringBuffer* str) {
|
||||
if (i.D.RA) {
|
||||
str->AppendFormat("%-8s f%d, r%d, %d", i.type->name, i.D.RT, i.D.RA,
|
||||
(int32_t)(int16_t) XEEXTS16(i.D.DS));
|
||||
(int32_t)(int16_t)XEEXTS16(i.D.DS));
|
||||
} else {
|
||||
str->AppendFormat("%-8s f%d, 0, %d", i.type->name, i.D.RT,
|
||||
(int32_t)(int16_t) XEEXTS16(i.D.DS));
|
||||
(int32_t)(int16_t)XEEXTS16(i.D.DS));
|
||||
}
|
||||
}
|
||||
void Disasm_DS_RT_RA_I(InstrData& i, StringBuffer* str) {
|
||||
str->AppendFormat("%-8s r%d, r%d, %d", i.type->name, i.DS.RT, i.DS.RA,
|
||||
(int32_t)(int16_t) XEEXTS16(i.DS.DS << 2));
|
||||
(int32_t)(int16_t)XEEXTS16(i.DS.DS << 2));
|
||||
}
|
||||
void Disasm_DS_RT_RA0_I(InstrData& i, StringBuffer* str) {
|
||||
if (i.DS.RA) {
|
||||
str->AppendFormat("%-8s r%d, r%d, %d", i.type->name, i.DS.RT, i.DS.RA,
|
||||
(int32_t)(int16_t) XEEXTS16(i.DS.DS << 2));
|
||||
(int32_t)(int16_t)XEEXTS16(i.DS.DS << 2));
|
||||
} else {
|
||||
str->AppendFormat("%-8s r%d, 0, %d", i.type->name, i.DS.RT,
|
||||
(int32_t)(int16_t) XEEXTS16(i.DS.DS << 2));
|
||||
(int32_t)(int16_t)XEEXTS16(i.DS.DS << 2));
|
||||
}
|
||||
}
|
||||
void Disasm_D_RA(InstrData& i, StringBuffer* str) {
|
||||
|
|
|
@ -994,8 +994,7 @@ XEEMITTER(dcbz, 0x7C0007EC, X)(PPCHIRBuilder& f, InstrData& i) {
|
|||
// dcbz128 - 128 byte set
|
||||
block_size = 128;
|
||||
address_mask = ~127;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// dcbz - 32 byte set
|
||||
block_size = 32;
|
||||
address_mask = ~31;
|
||||
|
|
|
@ -77,14 +77,14 @@ void InstrOperand::Dump(std::string& out_str) {
|
|||
switch (imm.width) {
|
||||
case 1:
|
||||
if (imm.is_signed) {
|
||||
snprintf(buffer, max_count, "%d", (int32_t)(int8_t) imm.value);
|
||||
snprintf(buffer, max_count, "%d", (int32_t)(int8_t)imm.value);
|
||||
} else {
|
||||
snprintf(buffer, max_count, "0x%.2X", (uint8_t)imm.value);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (imm.is_signed) {
|
||||
snprintf(buffer, max_count, "%d", (int32_t)(int16_t) imm.value);
|
||||
snprintf(buffer, max_count, "%d", (int32_t)(int16_t)imm.value);
|
||||
} else {
|
||||
snprintf(buffer, max_count, "0x%.4X", (uint16_t)imm.value);
|
||||
}
|
||||
|
|
|
@ -68,8 +68,10 @@ PPCTranslator::PPCTranslator(PPCFrontend* frontend) : frontend_(frontend) {
|
|||
if (backend->machine_info()->supports_extended_load_store) {
|
||||
// Backend supports the advanced LOAD/STORE instructions.
|
||||
// These will save us a lot of HIR opcodes.
|
||||
compiler_->AddPass(std::make_unique<passes::MemorySequenceCombinationPass>());
|
||||
if (validate) compiler_->AddPass(std::make_unique<passes::ValidationPass>());
|
||||
compiler_->AddPass(
|
||||
std::make_unique<passes::MemorySequenceCombinationPass>());
|
||||
if (validate)
|
||||
compiler_->AddPass(std::make_unique<passes::ValidationPass>());
|
||||
}
|
||||
compiler_->AddPass(std::make_unique<passes::SimplificationPass>());
|
||||
if (validate) compiler_->AddPass(std::make_unique<passes::ValidationPass>());
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
// clang-format off
|
||||
|
||||
DEFINE_OPCODE(
|
||||
OPCODE_COMMENT,
|
||||
|
|
|
@ -23,7 +23,8 @@ TEST_CASE("ADD_I8", "[instr]") {
|
|||
INT64_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -31,7 +32,8 @@ TEST_CASE("ADD_I8", "[instr]") {
|
|||
auto result = static_cast<int8_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 10;
|
||||
ctx->r[5] = 25;
|
||||
},
|
||||
|
@ -39,7 +41,8 @@ TEST_CASE("ADD_I8", "[instr]") {
|
|||
auto result = static_cast<int8_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0x23);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = -10;
|
||||
ctx->r[5] = -5;
|
||||
},
|
||||
|
@ -47,7 +50,8 @@ TEST_CASE("ADD_I8", "[instr]") {
|
|||
auto result = static_cast<int8_t>(ctx->r[3]);
|
||||
REQUIRE(result == -15);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = INT8_MIN;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -55,7 +59,8 @@ TEST_CASE("ADD_I8", "[instr]") {
|
|||
auto result = static_cast<int8_t>(ctx->r[3]);
|
||||
REQUIRE(result == INT8_MIN);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = UINT8_MAX;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -63,7 +68,8 @@ TEST_CASE("ADD_I8", "[instr]") {
|
|||
auto result = static_cast<uint8_t>(ctx->r[3]);
|
||||
REQUIRE(result == UINT8_MAX);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = INT8_MIN;
|
||||
ctx->r[5] = -1;
|
||||
},
|
||||
|
@ -71,7 +77,8 @@ TEST_CASE("ADD_I8", "[instr]") {
|
|||
auto result = static_cast<int8_t>(ctx->r[3]);
|
||||
REQUIRE(result == INT8_MAX);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = UINT8_MAX;
|
||||
ctx->r[5] = 1;
|
||||
},
|
||||
|
@ -88,7 +95,8 @@ TEST_CASE("ADD_I16", "[instr]") {
|
|||
INT64_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -96,7 +104,8 @@ TEST_CASE("ADD_I16", "[instr]") {
|
|||
auto result = static_cast<int16_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 10;
|
||||
ctx->r[5] = 25;
|
||||
},
|
||||
|
@ -104,7 +113,8 @@ TEST_CASE("ADD_I16", "[instr]") {
|
|||
auto result = static_cast<int16_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0x23);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = -10;
|
||||
ctx->r[5] = -5;
|
||||
},
|
||||
|
@ -112,7 +122,8 @@ TEST_CASE("ADD_I16", "[instr]") {
|
|||
auto result = static_cast<int16_t>(ctx->r[3]);
|
||||
REQUIRE(result == -15);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = INT16_MIN;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -120,7 +131,8 @@ TEST_CASE("ADD_I16", "[instr]") {
|
|||
auto result = static_cast<int16_t>(ctx->r[3]);
|
||||
REQUIRE(result == INT16_MIN);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = UINT16_MAX;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -128,7 +140,8 @@ TEST_CASE("ADD_I16", "[instr]") {
|
|||
auto result = static_cast<uint16_t>(ctx->r[3]);
|
||||
REQUIRE(result == UINT16_MAX);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = INT16_MIN;
|
||||
ctx->r[5] = -1;
|
||||
},
|
||||
|
@ -136,7 +149,8 @@ TEST_CASE("ADD_I16", "[instr]") {
|
|||
auto result = static_cast<int16_t>(ctx->r[3]);
|
||||
REQUIRE(result == INT16_MAX);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = UINT16_MAX;
|
||||
ctx->r[5] = 1;
|
||||
},
|
||||
|
@ -153,7 +167,8 @@ TEST_CASE("ADD_I32", "[instr]") {
|
|||
INT64_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -161,7 +176,8 @@ TEST_CASE("ADD_I32", "[instr]") {
|
|||
auto result = static_cast<int32_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 10;
|
||||
ctx->r[5] = 25;
|
||||
},
|
||||
|
@ -169,7 +185,8 @@ TEST_CASE("ADD_I32", "[instr]") {
|
|||
auto result = static_cast<int32_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0x23);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = -10;
|
||||
ctx->r[5] = -5;
|
||||
},
|
||||
|
@ -177,7 +194,8 @@ TEST_CASE("ADD_I32", "[instr]") {
|
|||
auto result = static_cast<int32_t>(ctx->r[3]);
|
||||
REQUIRE(result == -15);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = INT32_MIN;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -185,7 +203,8 @@ TEST_CASE("ADD_I32", "[instr]") {
|
|||
auto result = static_cast<int32_t>(ctx->r[3]);
|
||||
REQUIRE(result == INT32_MIN);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = UINT32_MAX;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -193,7 +212,8 @@ TEST_CASE("ADD_I32", "[instr]") {
|
|||
auto result = static_cast<uint32_t>(ctx->r[3]);
|
||||
REQUIRE(result == UINT32_MAX);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = INT32_MIN;
|
||||
ctx->r[5] = -1;
|
||||
},
|
||||
|
@ -201,7 +221,8 @@ TEST_CASE("ADD_I32", "[instr]") {
|
|||
auto result = static_cast<int32_t>(ctx->r[3]);
|
||||
REQUIRE(result == INT32_MAX);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = UINT32_MAX;
|
||||
ctx->r[5] = 1;
|
||||
},
|
||||
|
@ -216,7 +237,8 @@ TEST_CASE("ADD_I64", "[instr]") {
|
|||
StoreGPR(b, 3, b.Add(LoadGPR(b, 4), LoadGPR(b, 5)));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -224,7 +246,8 @@ TEST_CASE("ADD_I64", "[instr]") {
|
|||
auto result = ctx->r[3];
|
||||
REQUIRE(result == 0);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 10;
|
||||
ctx->r[5] = 25;
|
||||
},
|
||||
|
@ -232,7 +255,8 @@ TEST_CASE("ADD_I64", "[instr]") {
|
|||
auto result = ctx->r[3];
|
||||
REQUIRE(result == 0x23);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = -10;
|
||||
ctx->r[5] = -5;
|
||||
},
|
||||
|
@ -240,7 +264,8 @@ TEST_CASE("ADD_I64", "[instr]") {
|
|||
auto result = ctx->r[3];
|
||||
REQUIRE(result == -15);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = INT64_MIN;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -248,7 +273,8 @@ TEST_CASE("ADD_I64", "[instr]") {
|
|||
auto result = ctx->r[3];
|
||||
REQUIRE(result == INT64_MIN);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = UINT64_MAX;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -256,7 +282,8 @@ TEST_CASE("ADD_I64", "[instr]") {
|
|||
auto result = ctx->r[3];
|
||||
REQUIRE(result == UINT64_MAX);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = INT64_MIN;
|
||||
ctx->r[5] = -1;
|
||||
},
|
||||
|
@ -264,7 +291,8 @@ TEST_CASE("ADD_I64", "[instr]") {
|
|||
auto result = ctx->r[3];
|
||||
REQUIRE(result == INT64_MAX);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = UINT64_MAX;
|
||||
ctx->r[5] = 1;
|
||||
},
|
||||
|
@ -281,7 +309,8 @@ TEST_CASE("ADD_F32", "[instr]") {
|
|||
FLOAT64_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->f[4] = 0.0;
|
||||
ctx->f[5] = 0.0;
|
||||
},
|
||||
|
@ -289,7 +318,8 @@ TEST_CASE("ADD_F32", "[instr]") {
|
|||
auto result = ctx->f[3];
|
||||
REQUIRE(result == 0.0);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->f[4] = 5.0;
|
||||
ctx->f[5] = 7.0;
|
||||
},
|
||||
|
@ -297,7 +327,8 @@ TEST_CASE("ADD_F32", "[instr]") {
|
|||
auto result = ctx->f[3];
|
||||
REQUIRE(result == 12.0);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->f[4] = FLT_MAX / 2.0;
|
||||
ctx->f[5] = FLT_MAX / 2.0;
|
||||
},
|
||||
|
@ -305,7 +336,8 @@ TEST_CASE("ADD_F32", "[instr]") {
|
|||
auto result = ctx->f[3];
|
||||
REQUIRE(result == FLT_MAX);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->f[4] = -100.0;
|
||||
ctx->f[5] = -150.0;
|
||||
},
|
||||
|
@ -313,7 +345,8 @@ TEST_CASE("ADD_F32", "[instr]") {
|
|||
auto result = ctx->f[3];
|
||||
REQUIRE(result == -250.0);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->f[4] = FLT_MIN;
|
||||
ctx->f[5] = 0.0;
|
||||
},
|
||||
|
@ -321,7 +354,8 @@ TEST_CASE("ADD_F32", "[instr]") {
|
|||
auto result = ctx->f[3];
|
||||
REQUIRE(result == FLT_MIN);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->f[4] = FLT_MAX;
|
||||
ctx->f[5] = 0.0;
|
||||
},
|
||||
|
@ -336,7 +370,8 @@ TEST_CASE("ADD_F64", "[instr]") {
|
|||
StoreFPR(b, 3, b.Add(LoadFPR(b, 4), LoadFPR(b, 5)));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->f[4] = 0.0;
|
||||
ctx->f[5] = 0.0;
|
||||
},
|
||||
|
@ -344,7 +379,8 @@ TEST_CASE("ADD_F64", "[instr]") {
|
|||
auto result = ctx->f[3];
|
||||
REQUIRE(result == 0.0);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->f[4] = 5.0;
|
||||
ctx->f[5] = 7.0;
|
||||
},
|
||||
|
@ -352,7 +388,8 @@ TEST_CASE("ADD_F64", "[instr]") {
|
|||
auto result = ctx->f[3];
|
||||
REQUIRE(result == 12.0);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->f[4] = DBL_MAX / 2.0;
|
||||
ctx->f[5] = DBL_MAX / 2.0;
|
||||
},
|
||||
|
@ -360,7 +397,8 @@ TEST_CASE("ADD_F64", "[instr]") {
|
|||
auto result = ctx->f[3];
|
||||
REQUIRE(result == DBL_MAX);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->f[4] = -100.0;
|
||||
ctx->f[5] = -150.0;
|
||||
},
|
||||
|
@ -368,7 +406,8 @@ TEST_CASE("ADD_F64", "[instr]") {
|
|||
auto result = ctx->f[3];
|
||||
REQUIRE(result == -250.0);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->f[4] = DBL_MIN;
|
||||
ctx->f[5] = 0.0;
|
||||
},
|
||||
|
@ -376,7 +415,8 @@ TEST_CASE("ADD_F64", "[instr]") {
|
|||
auto result = ctx->f[3];
|
||||
REQUIRE(result == DBL_MIN);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->f[4] = DBL_MAX;
|
||||
ctx->f[5] = 0.0;
|
||||
},
|
||||
|
|
|
@ -19,25 +19,28 @@ TEST_CASE("BYTE_SWAP_V128", "[instr]") {
|
|||
TestFunction([](HIRBuilder& b) {
|
||||
StoreVR(b, 3, b.ByteSwap(LoadVR(b, 4)));
|
||||
b.Return();
|
||||
}).Run([](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
|
||||
11, 12, 13, 14, 15);
|
||||
})
|
||||
.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128b(3, 2, 1, 0, 7, 6, 5, 4, 11,
|
||||
10, 9, 8, 15, 14, 13, 12));
|
||||
REQUIRE(result == vec128b(3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15,
|
||||
14, 13, 12));
|
||||
});
|
||||
TestFunction([](HIRBuilder& b) {
|
||||
StoreVR(b, 3, b.ByteSwap(LoadVR(b, 4)));
|
||||
b.Return();
|
||||
}).Run([](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0x0C13100F, 0x0E0D0C0B, 0x0A000000,
|
||||
0x00000000);
|
||||
})
|
||||
.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0x0C13100F, 0x0E0D0C0B, 0x0A000000, 0x00000000);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128i(0x0F10130C, 0x0B0C0D0E,
|
||||
0x0000000A, 0x00000000));
|
||||
REQUIRE(result ==
|
||||
vec128i(0x0F10130C, 0x0B0C0D0E, 0x0000000A, 0x00000000));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -26,10 +26,11 @@ TEST_CASE("EXTRACT_INT8", "[instr]") {
|
|||
b.Return();
|
||||
});
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
test.Run([i](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[i](PPCContext* ctx) {
|
||||
ctx->r[4] = i;
|
||||
ctx->v[4] = vec128b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
|
||||
14, 15);
|
||||
ctx->v[4] =
|
||||
vec128b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
},
|
||||
[i](PPCContext* ctx) {
|
||||
auto result = ctx->r[3];
|
||||
|
@ -40,17 +41,17 @@ TEST_CASE("EXTRACT_INT8", "[instr]") {
|
|||
|
||||
TEST_CASE("EXTRACT_INT8_CONSTANT", "[instr]") {
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
TestFunction(
|
||||
[i](HIRBuilder& b) {
|
||||
StoreGPR(b, 3,
|
||||
b.ZeroExtend(b.Extract(LoadVR(b, 4), b.LoadConstantInt8(i),
|
||||
TestFunction([i](HIRBuilder& b) {
|
||||
StoreGPR(b, 3, b.ZeroExtend(b.Extract(LoadVR(b, 4), b.LoadConstantInt8(i),
|
||||
INT8_TYPE),
|
||||
INT64_TYPE));
|
||||
b.Return();
|
||||
}).Run([i](PPCContext* ctx) {
|
||||
})
|
||||
.Run(
|
||||
[i](PPCContext* ctx) {
|
||||
ctx->r[4] = i;
|
||||
ctx->v[4] = vec128b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
|
||||
13, 14, 15);
|
||||
ctx->v[4] =
|
||||
vec128b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
},
|
||||
[i](PPCContext* ctx) {
|
||||
auto result = ctx->r[3];
|
||||
|
@ -68,10 +69,11 @@ TEST_CASE("EXTRACT_INT16", "[instr]") {
|
|||
b.Return();
|
||||
});
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
test.Run([i](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[i](PPCContext* ctx) {
|
||||
ctx->r[4] = i;
|
||||
ctx->v[4] = vec128s(0x0000, 0x1001, 0x2002, 0x3003, 0x4004,
|
||||
0x5005, 0x6006, 0x7007);
|
||||
ctx->v[4] = vec128s(0x0000, 0x1001, 0x2002, 0x3003, 0x4004, 0x5005,
|
||||
0x6006, 0x7007);
|
||||
},
|
||||
[i](PPCContext* ctx) {
|
||||
auto result = ctx->r[3];
|
||||
|
@ -83,12 +85,13 @@ TEST_CASE("EXTRACT_INT16", "[instr]") {
|
|||
TEST_CASE("EXTRACT_INT16_CONSTANT", "[instr]") {
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
TestFunction([i](HIRBuilder& b) {
|
||||
StoreGPR(b, 3, b.ZeroExtend(b.Extract(LoadVR(b, 4),
|
||||
b.LoadConstantInt8(i),
|
||||
StoreGPR(b, 3, b.ZeroExtend(b.Extract(LoadVR(b, 4), b.LoadConstantInt8(i),
|
||||
INT16_TYPE),
|
||||
INT64_TYPE));
|
||||
b.Return();
|
||||
}).Run([i](PPCContext* ctx) {
|
||||
})
|
||||
.Run(
|
||||
[i](PPCContext* ctx) {
|
||||
ctx->r[4] = i;
|
||||
ctx->v[4] = vec128s(0, 1, 2, 3, 4, 5, 6, 7);
|
||||
},
|
||||
|
@ -108,7 +111,8 @@ TEST_CASE("EXTRACT_INT32", "[instr]") {
|
|||
b.Return();
|
||||
});
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
test.Run([i](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[i](PPCContext* ctx) {
|
||||
ctx->r[4] = i;
|
||||
ctx->v[4] = vec128i(0, 1, 2, 3);
|
||||
},
|
||||
|
@ -122,12 +126,13 @@ TEST_CASE("EXTRACT_INT32", "[instr]") {
|
|||
TEST_CASE("EXTRACT_INT32_CONSTANT", "[instr]") {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
TestFunction([i](HIRBuilder& b) {
|
||||
StoreGPR(b, 3, b.ZeroExtend(b.Extract(LoadVR(b, 4),
|
||||
b.LoadConstantInt8(i),
|
||||
StoreGPR(b, 3, b.ZeroExtend(b.Extract(LoadVR(b, 4), b.LoadConstantInt8(i),
|
||||
INT32_TYPE),
|
||||
INT64_TYPE));
|
||||
b.Return();
|
||||
}).Run([i](PPCContext* ctx) {
|
||||
})
|
||||
.Run(
|
||||
[i](PPCContext* ctx) {
|
||||
ctx->r[4] = i;
|
||||
ctx->v[4] = vec128i(0, 1, 2, 3);
|
||||
},
|
||||
|
|
|
@ -24,16 +24,17 @@ TEST_CASE("INSERT_INT8", "[instr]") {
|
|||
b.Truncate(LoadGPR(b, 5), INT8_TYPE)));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([i](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
|
||||
14, 15);
|
||||
test.Run(
|
||||
[i](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
ctx->r[4] = i;
|
||||
ctx->r[5] = 100 + i;
|
||||
},
|
||||
[i](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
auto expected = vec128b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
|
||||
13, 14, 15);
|
||||
auto expected =
|
||||
vec128b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
expected.i8[i ^ 0x3] = 100 + i;
|
||||
REQUIRE(result == expected);
|
||||
});
|
||||
|
@ -47,7 +48,8 @@ TEST_CASE("INSERT_INT16", "[instr]") {
|
|||
b.Truncate(LoadGPR(b, 5), INT16_TYPE)));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([i](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[i](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128s(0, 1, 2, 3, 4, 5, 6, 7);
|
||||
ctx->r[4] = i;
|
||||
ctx->r[5] = 100 + i;
|
||||
|
@ -68,7 +70,8 @@ TEST_CASE("INSERT_INT32", "[instr]") {
|
|||
b.Truncate(LoadGPR(b, 5), INT32_TYPE)));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([i](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[i](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0, 1, 2, 3);
|
||||
ctx->r[4] = i;
|
||||
ctx->r[5] = 100 + i;
|
||||
|
|
|
@ -25,9 +25,9 @@ TEST_CASE("PACK_D3DCOLOR", "[instr]") {
|
|||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128i(0));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128i(0x40400050, 0x40400060, 0x40400070, 0x40400080);
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0x40400050, 0x40400060, 0x40400070, 0x40400080);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
|
@ -45,17 +45,17 @@ TEST_CASE("PACK_FLOAT16_2", "[instr]") {
|
|||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128i(0));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128i(0x47FFE000, 0xC7FFE000, 0x00000000, 0x3F800000);
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0x47FFE000, 0xC7FFE000, 0x00000000, 0x3F800000);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128i(0, 0, 0, 0x7FFFFFFF));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128i(0x42AAA000, 0x44CCC000, 0x00000000, 0x3F800000);
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0x42AAA000, 0x44CCC000, 0x00000000, 0x3F800000);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
|
@ -73,9 +73,9 @@ TEST_CASE("PACK_FLOAT16_4", "[instr]") {
|
|||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128i(0));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128i(0x449A4000, 0x45B17000, 0x41103261, 0x40922B6B);
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0x449A4000, 0x45B17000, 0x41103261, 0x40922B6B);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
|
@ -94,14 +94,16 @@ TEST_CASE("PACK_SHORT_2", "[instr]") {
|
|||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128i(0));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0x43817E00, 0xC37CFC00, 0, 0);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128i(0, 0, 0, 0x7FFF8001));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0xC0D47D97, 0xC2256E9D, 0, 0);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
|
|
|
@ -19,11 +19,12 @@ TEST_CASE("PERMUTE_V128_BY_INT32_CONSTANT", "[instr]") {
|
|||
{
|
||||
uint32_t mask = PERMUTE_MASK(0, 0, 0, 1, 0, 2, 0, 3);
|
||||
TestFunction([mask](HIRBuilder& b) {
|
||||
StoreVR(b, 3,
|
||||
b.Permute(b.LoadConstantUint32(mask), LoadVR(b, 4),
|
||||
StoreVR(b, 3, b.Permute(b.LoadConstantUint32(mask), LoadVR(b, 4),
|
||||
LoadVR(b, 5), INT32_TYPE));
|
||||
b.Return();
|
||||
}).Run([](PPCContext* ctx) {
|
||||
})
|
||||
.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0, 1, 2, 3);
|
||||
ctx->v[5] = vec128i(4, 5, 6, 7);
|
||||
},
|
||||
|
@ -35,11 +36,12 @@ TEST_CASE("PERMUTE_V128_BY_INT32_CONSTANT", "[instr]") {
|
|||
{
|
||||
uint32_t mask = PERMUTE_MASK(1, 0, 1, 1, 1, 2, 1, 3);
|
||||
TestFunction([mask](HIRBuilder& b) {
|
||||
StoreVR(b, 3,
|
||||
b.Permute(b.LoadConstantUint32(mask), LoadVR(b, 4),
|
||||
StoreVR(b, 3, b.Permute(b.LoadConstantUint32(mask), LoadVR(b, 4),
|
||||
LoadVR(b, 5), INT32_TYPE));
|
||||
b.Return();
|
||||
}).Run([](PPCContext* ctx) {
|
||||
})
|
||||
.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0, 1, 2, 3);
|
||||
ctx->v[5] = vec128i(4, 5, 6, 7);
|
||||
},
|
||||
|
@ -51,11 +53,12 @@ TEST_CASE("PERMUTE_V128_BY_INT32_CONSTANT", "[instr]") {
|
|||
{
|
||||
uint32_t mask = PERMUTE_MASK(0, 3, 0, 2, 0, 1, 0, 0);
|
||||
TestFunction([mask](HIRBuilder& b) {
|
||||
StoreVR(b, 3,
|
||||
b.Permute(b.LoadConstantUint32(mask), LoadVR(b, 4),
|
||||
StoreVR(b, 3, b.Permute(b.LoadConstantUint32(mask), LoadVR(b, 4),
|
||||
LoadVR(b, 5), INT32_TYPE));
|
||||
b.Return();
|
||||
}).Run([](PPCContext* ctx) {
|
||||
})
|
||||
.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0, 1, 2, 3);
|
||||
ctx->v[5] = vec128i(4, 5, 6, 7);
|
||||
},
|
||||
|
@ -67,11 +70,12 @@ TEST_CASE("PERMUTE_V128_BY_INT32_CONSTANT", "[instr]") {
|
|||
{
|
||||
uint32_t mask = PERMUTE_MASK(1, 3, 1, 2, 1, 1, 1, 0);
|
||||
TestFunction([mask](HIRBuilder& b) {
|
||||
StoreVR(b, 3,
|
||||
b.Permute(b.LoadConstantUint32(mask), LoadVR(b, 4),
|
||||
StoreVR(b, 3, b.Permute(b.LoadConstantUint32(mask), LoadVR(b, 4),
|
||||
LoadVR(b, 5), INT32_TYPE));
|
||||
b.Return();
|
||||
}).Run([](PPCContext* ctx) {
|
||||
})
|
||||
.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0, 1, 2, 3);
|
||||
ctx->v[5] = vec128i(4, 5, 6, 7);
|
||||
},
|
||||
|
@ -88,56 +92,60 @@ TEST_CASE("PERMUTE_V128_BY_V128", "[instr]") {
|
|||
b.Permute(LoadVR(b, 3), LoadVR(b, 4), LoadVR(b, 5), INT8_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[3] =
|
||||
vec128b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
ctx->v[4] = vec128b(100, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
|
||||
14, 15);
|
||||
ctx->v[5] = vec128b(16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
|
||||
28, 29, 30, 31);
|
||||
ctx->v[4] =
|
||||
vec128b(100, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
ctx->v[5] = vec128b(16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
|
||||
29, 30, 31);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128b(100, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
|
||||
12, 13, 14, 15));
|
||||
REQUIRE(result == vec128b(100, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
|
||||
13, 14, 15));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
ctx->v[3] = vec128b(16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
|
||||
28, 29, 30, 31);
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[3] = vec128b(16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
|
||||
29, 30, 31);
|
||||
ctx->v[4] =
|
||||
vec128b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
ctx->v[5] = vec128b(116, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
|
||||
27, 28, 29, 30, 31);
|
||||
ctx->v[5] = vec128b(116, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
|
||||
29, 30, 31);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128b(116, 17, 18, 19, 20, 21, 22, 23, 24, 25,
|
||||
26, 27, 28, 29, 30, 31));
|
||||
REQUIRE(result == vec128b(116, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
|
||||
27, 28, 29, 30, 31));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[3] =
|
||||
vec128b(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
|
||||
ctx->v[4] = vec128b(100, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
|
||||
14, 15);
|
||||
ctx->v[5] = vec128b(16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
|
||||
28, 29, 30, 31);
|
||||
ctx->v[4] =
|
||||
vec128b(100, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
ctx->v[5] = vec128b(16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
|
||||
29, 30, 31);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128b(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4,
|
||||
3, 2, 1, 100));
|
||||
REQUIRE(result == vec128b(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3,
|
||||
2, 1, 100));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
ctx->v[3] = vec128b(31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20,
|
||||
19, 18, 17, 16);
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[3] = vec128b(31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19,
|
||||
18, 17, 16);
|
||||
ctx->v[4] =
|
||||
vec128b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
ctx->v[5] = vec128b(16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
|
||||
28, 29, 30, 131);
|
||||
ctx->v[5] = vec128b(16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
|
||||
29, 30, 131);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128b(131, 30, 29, 28, 27, 26, 25, 24, 23, 22,
|
||||
21, 20, 19, 18, 17, 16));
|
||||
REQUIRE(result == vec128b(131, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21,
|
||||
20, 19, 18, 17, 16));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -21,7 +21,8 @@ TEST_CASE("SHA_I8", "[instr]") {
|
|||
INT64_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xF0;
|
||||
ctx->r[5] = 4;
|
||||
},
|
||||
|
@ -29,7 +30,8 @@ TEST_CASE("SHA_I8", "[instr]") {
|
|||
auto result = static_cast<uint8_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFF;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -37,7 +39,8 @@ TEST_CASE("SHA_I8", "[instr]") {
|
|||
auto result = static_cast<uint8_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFF;
|
||||
ctx->r[5] = 1;
|
||||
},
|
||||
|
@ -45,7 +48,8 @@ TEST_CASE("SHA_I8", "[instr]") {
|
|||
auto result = static_cast<uint8_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x80;
|
||||
ctx->r[5] = 8;
|
||||
},
|
||||
|
@ -53,7 +57,8 @@ TEST_CASE("SHA_I8", "[instr]") {
|
|||
auto result = static_cast<uint8_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x7F;
|
||||
ctx->r[5] = 7;
|
||||
},
|
||||
|
@ -70,7 +75,8 @@ TEST_CASE("SHA_I16", "[instr]") {
|
|||
INT64_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFF00;
|
||||
ctx->r[5] = 8;
|
||||
},
|
||||
|
@ -78,7 +84,8 @@ TEST_CASE("SHA_I16", "[instr]") {
|
|||
auto result = static_cast<uint16_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFFFF;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -86,7 +93,8 @@ TEST_CASE("SHA_I16", "[instr]") {
|
|||
auto result = static_cast<uint16_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFFFE;
|
||||
ctx->r[5] = 1;
|
||||
},
|
||||
|
@ -94,7 +102,8 @@ TEST_CASE("SHA_I16", "[instr]") {
|
|||
auto result = static_cast<uint16_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x8000;
|
||||
ctx->r[5] = 16;
|
||||
},
|
||||
|
@ -102,7 +111,8 @@ TEST_CASE("SHA_I16", "[instr]") {
|
|||
auto result = static_cast<uint16_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x7FFF;
|
||||
ctx->r[5] = 15;
|
||||
},
|
||||
|
@ -119,7 +129,8 @@ TEST_CASE("SHA_I32", "[instr]") {
|
|||
INT64_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFFFF0000;
|
||||
ctx->r[5] = 16;
|
||||
},
|
||||
|
@ -127,7 +138,8 @@ TEST_CASE("SHA_I32", "[instr]") {
|
|||
auto result = static_cast<uint32_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFFFFFF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFFFFFFFF;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -135,7 +147,8 @@ TEST_CASE("SHA_I32", "[instr]") {
|
|||
auto result = static_cast<uint32_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFFFFFF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFFFFFFFE;
|
||||
ctx->r[5] = 1;
|
||||
},
|
||||
|
@ -143,7 +156,8 @@ TEST_CASE("SHA_I32", "[instr]") {
|
|||
auto result = static_cast<uint32_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFFFFFF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x80000000;
|
||||
ctx->r[5] = 32;
|
||||
},
|
||||
|
@ -151,7 +165,8 @@ TEST_CASE("SHA_I32", "[instr]") {
|
|||
auto result = static_cast<uint32_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0x80000000);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x7FFFFFFF;
|
||||
ctx->r[5] = 31;
|
||||
},
|
||||
|
@ -167,7 +182,8 @@ TEST_CASE("SHA_I64", "[instr]") {
|
|||
b.Truncate(LoadGPR(b, 5), INT8_TYPE)));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFFFFFFFF00000000ull;
|
||||
ctx->r[5] = 32;
|
||||
},
|
||||
|
@ -175,7 +191,8 @@ TEST_CASE("SHA_I64", "[instr]") {
|
|||
auto result = static_cast<uint64_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFFFFFFFFFFFFFFull);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFFFFFFFFFFFFFFFFull;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -183,7 +200,8 @@ TEST_CASE("SHA_I64", "[instr]") {
|
|||
auto result = static_cast<uint64_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFFFFFFFFFFFFFFull);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFFFFFFFFFFFFFFFEull;
|
||||
ctx->r[5] = 1;
|
||||
},
|
||||
|
@ -191,7 +209,8 @@ TEST_CASE("SHA_I64", "[instr]") {
|
|||
auto result = static_cast<uint64_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFFFFFFFFFFFFFFull);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x8000000000000000ull;
|
||||
ctx->r[5] = 64;
|
||||
},
|
||||
|
@ -199,7 +218,8 @@ TEST_CASE("SHA_I64", "[instr]") {
|
|||
auto result = static_cast<uint64_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0x8000000000000000ull);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x7FFFFFFFFFFFFFFFull;
|
||||
ctx->r[5] = 63;
|
||||
},
|
||||
|
|
|
@ -21,7 +21,8 @@ TEST_CASE("SHL_I8", "[instr]") {
|
|||
INT64_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x0F;
|
||||
ctx->r[5] = 4;
|
||||
},
|
||||
|
@ -29,7 +30,8 @@ TEST_CASE("SHL_I8", "[instr]") {
|
|||
auto result = static_cast<uint8_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xF0);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFF;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -37,7 +39,8 @@ TEST_CASE("SHL_I8", "[instr]") {
|
|||
auto result = static_cast<uint8_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFF;
|
||||
ctx->r[5] = 1;
|
||||
},
|
||||
|
@ -45,7 +48,8 @@ TEST_CASE("SHL_I8", "[instr]") {
|
|||
auto result = static_cast<uint8_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFE);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x80;
|
||||
ctx->r[5] = 8;
|
||||
},
|
||||
|
@ -53,7 +57,8 @@ TEST_CASE("SHL_I8", "[instr]") {
|
|||
auto result = static_cast<uint8_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x7F;
|
||||
ctx->r[5] = 7;
|
||||
},
|
||||
|
@ -70,7 +75,8 @@ TEST_CASE("SHL_I16", "[instr]") {
|
|||
INT64_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x00FF;
|
||||
ctx->r[5] = 8;
|
||||
},
|
||||
|
@ -78,7 +84,8 @@ TEST_CASE("SHL_I16", "[instr]") {
|
|||
auto result = static_cast<uint16_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFF00);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFFFF;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -86,7 +93,8 @@ TEST_CASE("SHL_I16", "[instr]") {
|
|||
auto result = static_cast<uint16_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x7FFF;
|
||||
ctx->r[5] = 1;
|
||||
},
|
||||
|
@ -94,7 +102,8 @@ TEST_CASE("SHL_I16", "[instr]") {
|
|||
auto result = static_cast<uint16_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFE);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x8000;
|
||||
ctx->r[5] = 16;
|
||||
},
|
||||
|
@ -102,7 +111,8 @@ TEST_CASE("SHL_I16", "[instr]") {
|
|||
auto result = static_cast<uint16_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x7FFF;
|
||||
ctx->r[5] = 15;
|
||||
},
|
||||
|
@ -119,7 +129,8 @@ TEST_CASE("SHL_I32", "[instr]") {
|
|||
INT64_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x0000FFFF;
|
||||
ctx->r[5] = 16;
|
||||
},
|
||||
|
@ -127,7 +138,8 @@ TEST_CASE("SHL_I32", "[instr]") {
|
|||
auto result = static_cast<uint32_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFF0000);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFFFFFFFF;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -135,7 +147,8 @@ TEST_CASE("SHL_I32", "[instr]") {
|
|||
auto result = static_cast<uint32_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFFFFFF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x7FFFFFFF;
|
||||
ctx->r[5] = 1;
|
||||
},
|
||||
|
@ -143,7 +156,8 @@ TEST_CASE("SHL_I32", "[instr]") {
|
|||
auto result = static_cast<uint32_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFFFFFE);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x80000000;
|
||||
ctx->r[5] = 32;
|
||||
},
|
||||
|
@ -151,7 +165,8 @@ TEST_CASE("SHL_I32", "[instr]") {
|
|||
auto result = static_cast<uint32_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0x80000000);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x7FFFFFFF;
|
||||
ctx->r[5] = 31;
|
||||
},
|
||||
|
@ -167,7 +182,8 @@ TEST_CASE("SHL_I64", "[instr]") {
|
|||
b.Truncate(LoadGPR(b, 5), INT8_TYPE)));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x00000000FFFFFFFFull;
|
||||
ctx->r[5] = 32;
|
||||
},
|
||||
|
@ -175,7 +191,8 @@ TEST_CASE("SHL_I64", "[instr]") {
|
|||
auto result = static_cast<uint64_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFFFFFF00000000ull);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFFFFFFFFFFFFFFFFull;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -183,7 +200,8 @@ TEST_CASE("SHL_I64", "[instr]") {
|
|||
auto result = static_cast<uint64_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFFFFFFFFFFFFFFull);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x7FFFFFFFFFFFFFFFull;
|
||||
ctx->r[5] = 1;
|
||||
},
|
||||
|
@ -191,7 +209,8 @@ TEST_CASE("SHL_I64", "[instr]") {
|
|||
auto result = static_cast<uint64_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFFFFFFFFFFFFFEull);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x8000000000000000ull;
|
||||
ctx->r[5] = 64;
|
||||
},
|
||||
|
@ -199,7 +218,8 @@ TEST_CASE("SHL_I64", "[instr]") {
|
|||
auto result = static_cast<uint64_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0x8000000000000000ull);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x7FFFFFFFFFFFFFFFull;
|
||||
ctx->r[5] = 63;
|
||||
},
|
||||
|
|
|
@ -22,7 +22,8 @@ TEST_CASE("SHR_I8", "[instr]") {
|
|||
INT64_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xF0;
|
||||
ctx->r[5] = 4;
|
||||
},
|
||||
|
@ -30,7 +31,8 @@ TEST_CASE("SHR_I8", "[instr]") {
|
|||
auto result = static_cast<uint8_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0x0F);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFF;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -38,7 +40,8 @@ TEST_CASE("SHR_I8", "[instr]") {
|
|||
auto result = static_cast<uint8_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFF;
|
||||
ctx->r[5] = 1;
|
||||
},
|
||||
|
@ -46,7 +49,8 @@ TEST_CASE("SHR_I8", "[instr]") {
|
|||
auto result = static_cast<uint8_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0x7F);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x80;
|
||||
ctx->r[5] = 8;
|
||||
},
|
||||
|
@ -54,7 +58,8 @@ TEST_CASE("SHR_I8", "[instr]") {
|
|||
auto result = static_cast<uint8_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x7F;
|
||||
ctx->r[5] = 7;
|
||||
},
|
||||
|
@ -71,7 +76,8 @@ TEST_CASE("SHR_I16", "[instr]") {
|
|||
INT64_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFF00;
|
||||
ctx->r[5] = 8;
|
||||
},
|
||||
|
@ -79,7 +85,8 @@ TEST_CASE("SHR_I16", "[instr]") {
|
|||
auto result = static_cast<uint16_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0x00FF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFFFF;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -87,7 +94,8 @@ TEST_CASE("SHR_I16", "[instr]") {
|
|||
auto result = static_cast<uint16_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFFFE;
|
||||
ctx->r[5] = 1;
|
||||
},
|
||||
|
@ -95,7 +103,8 @@ TEST_CASE("SHR_I16", "[instr]") {
|
|||
auto result = static_cast<uint16_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0x7FFF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x8000;
|
||||
ctx->r[5] = 16;
|
||||
},
|
||||
|
@ -103,7 +112,8 @@ TEST_CASE("SHR_I16", "[instr]") {
|
|||
auto result = static_cast<uint16_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x7FFF;
|
||||
ctx->r[5] = 15;
|
||||
},
|
||||
|
@ -120,7 +130,8 @@ TEST_CASE("SHR_I32", "[instr]") {
|
|||
INT64_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFFFF0000;
|
||||
ctx->r[5] = 16;
|
||||
},
|
||||
|
@ -128,7 +139,8 @@ TEST_CASE("SHR_I32", "[instr]") {
|
|||
auto result = static_cast<uint32_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0x0000FFFF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFFFFFFFF;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -136,7 +148,8 @@ TEST_CASE("SHR_I32", "[instr]") {
|
|||
auto result = static_cast<uint32_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFFFFFF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFFFFFFFE;
|
||||
ctx->r[5] = 1;
|
||||
},
|
||||
|
@ -144,7 +157,8 @@ TEST_CASE("SHR_I32", "[instr]") {
|
|||
auto result = static_cast<uint32_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0x7FFFFFFF);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x80000000;
|
||||
ctx->r[5] = 32;
|
||||
},
|
||||
|
@ -152,7 +166,8 @@ TEST_CASE("SHR_I32", "[instr]") {
|
|||
auto result = static_cast<uint32_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0x80000000);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x7FFFFFFF;
|
||||
ctx->r[5] = 31;
|
||||
},
|
||||
|
@ -168,7 +183,8 @@ TEST_CASE("SHR_I64", "[instr]") {
|
|||
b.Truncate(LoadGPR(b, 5), INT8_TYPE)));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFFFFFFFF00000000ull;
|
||||
ctx->r[5] = 32;
|
||||
},
|
||||
|
@ -176,7 +192,8 @@ TEST_CASE("SHR_I64", "[instr]") {
|
|||
auto result = static_cast<uint64_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0x00000000FFFFFFFFull);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFFFFFFFFFFFFFFFFull;
|
||||
ctx->r[5] = 0;
|
||||
},
|
||||
|
@ -184,7 +201,8 @@ TEST_CASE("SHR_I64", "[instr]") {
|
|||
auto result = static_cast<uint64_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0xFFFFFFFFFFFFFFFFull);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0xFFFFFFFFFFFFFFFEull;
|
||||
ctx->r[5] = 1;
|
||||
},
|
||||
|
@ -192,7 +210,8 @@ TEST_CASE("SHR_I64", "[instr]") {
|
|||
auto result = static_cast<uint64_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0x7FFFFFFFFFFFFFFFull);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x8000000000000000ull;
|
||||
ctx->r[5] = 64;
|
||||
},
|
||||
|
@ -200,7 +219,8 @@ TEST_CASE("SHR_I64", "[instr]") {
|
|||
auto result = static_cast<uint64_t>(ctx->r[3]);
|
||||
REQUIRE(result == 0x8000000000000000ull);
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[4] = 0x7FFFFFFFFFFFFFFFull;
|
||||
ctx->r[5] = 63;
|
||||
},
|
||||
|
@ -215,40 +235,40 @@ TEST_CASE("SHR_V128", "[instr]") {
|
|||
StoreVR(b, 3, b.Shr(LoadVR(b, 4), b.Truncate(LoadGPR(b, 1), INT8_TYPE)));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[1] = 0;
|
||||
ctx->v[4] =
|
||||
vec128i(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
|
||||
ctx->v[4] = vec128i(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result1 = ctx->v[3];
|
||||
REQUIRE(result1 ==
|
||||
vec128i(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[1] = 1;
|
||||
ctx->v[4] =
|
||||
vec128i(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
|
||||
ctx->v[4] = vec128i(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result1 = ctx->v[3];
|
||||
REQUIRE(result1 ==
|
||||
vec128i(0x7FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[1] = 2;
|
||||
ctx->v[4] =
|
||||
vec128i(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
|
||||
ctx->v[4] = vec128i(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result1 = ctx->v[3];
|
||||
REQUIRE(result1 ==
|
||||
vec128i(0x3FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->r[1] = 8;
|
||||
ctx->v[4] =
|
||||
vec128i(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
|
||||
ctx->v[4] = vec128i(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result1 = ctx->v[3];
|
||||
|
|
|
@ -17,28 +17,31 @@ using xe::cpu::frontend::PPCContext;
|
|||
|
||||
TEST_CASE("SWIZZLE_V128", "[instr]") {
|
||||
TestFunction([](HIRBuilder& b) {
|
||||
StoreVR(b, 3, b.Swizzle(LoadVR(b, 4), INT32_TYPE,
|
||||
SWIZZLE_MASK(0, 1, 2, 3)));
|
||||
StoreVR(b, 3,
|
||||
b.Swizzle(LoadVR(b, 4), INT32_TYPE, SWIZZLE_MASK(0, 1, 2, 3)));
|
||||
b.Return();
|
||||
}).Run([](PPCContext* ctx) { ctx->v[4] = vec128i(0, 1, 2, 3); },
|
||||
})
|
||||
.Run([](PPCContext* ctx) { ctx->v[4] = vec128i(0, 1, 2, 3); },
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128i(0, 1, 2, 3));
|
||||
});
|
||||
TestFunction([](HIRBuilder& b) {
|
||||
StoreVR(b, 3, b.Swizzle(LoadVR(b, 4), INT32_TYPE,
|
||||
SWIZZLE_MASK(3, 2, 1, 0)));
|
||||
StoreVR(b, 3,
|
||||
b.Swizzle(LoadVR(b, 4), INT32_TYPE, SWIZZLE_MASK(3, 2, 1, 0)));
|
||||
b.Return();
|
||||
}).Run([](PPCContext* ctx) { ctx->v[4] = vec128i(0, 1, 2, 3); },
|
||||
})
|
||||
.Run([](PPCContext* ctx) { ctx->v[4] = vec128i(0, 1, 2, 3); },
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128i(3, 2, 1, 0));
|
||||
});
|
||||
TestFunction([](HIRBuilder& b) {
|
||||
StoreVR(b, 3, b.Swizzle(LoadVR(b, 4), INT32_TYPE,
|
||||
SWIZZLE_MASK(1, 1, 2, 2)));
|
||||
StoreVR(b, 3,
|
||||
b.Swizzle(LoadVR(b, 4), INT32_TYPE, SWIZZLE_MASK(1, 1, 2, 2)));
|
||||
b.Return();
|
||||
}).Run([](PPCContext* ctx) { ctx->v[4] = vec128i(0, 1, 2, 3); },
|
||||
})
|
||||
.Run([](PPCContext* ctx) { ctx->v[4] = vec128i(0, 1, 2, 3); },
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128i(1, 1, 2, 2));
|
||||
|
|
|
@ -20,7 +20,8 @@ TEST_CASE("UNPACK_D3DCOLOR", "[instr]") {
|
|||
StoreVR(b, 3, b.Unpack(LoadVR(b, 4), PACK_TYPE_D3DCOLOR));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
uint32_t value = 0;
|
||||
ctx->v[4] = vec128i(0, 0, 0, value);
|
||||
},
|
||||
|
@ -28,7 +29,8 @@ TEST_CASE("UNPACK_D3DCOLOR", "[instr]") {
|
|||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128f(1.0f, 1.0f, 1.0f, 1.0f));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
uint32_t value = 0x80506070;
|
||||
ctx->v[4] = vec128i(0, 0, 0, value);
|
||||
},
|
||||
|
@ -73,7 +75,8 @@ TEST_CASE("UNPACK_FLOAT16_4", "[instr]") {
|
|||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128i(0));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128s(0, 0, 0, 0, 0x64D2, 0x6D8B, 0x4881, 0x4491);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
|
@ -94,16 +97,17 @@ TEST_CASE("UNPACK_SHORT_2", "[instr]") {
|
|||
REQUIRE(result ==
|
||||
vec128i(0x40400000, 0x40400000, 0x00000000, 0x3F800000));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128i(0x7004FD60, 0x8201C990, 0x00000000, 0x7FFF8001);
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0x7004FD60, 0x8201C990, 0x00000000, 0x7FFF8001);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
REQUIRE(result ==
|
||||
vec128i(0x40407FFF, 0x403F8001, 0x00000000, 0x3F800000));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0, 0, 0, (0x1234u << 16) | 0x5678u);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
|
|
|
@ -22,18 +22,20 @@ TEST_CASE("VECTOR_ADD_I8", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorAdd(LoadVR(b, 4), LoadVR(b, 5), INT8_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
ctx->v[5] = vec128b(100, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
|
||||
14, 15);
|
||||
ctx->v[5] =
|
||||
vec128b(100, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128b(100, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20,
|
||||
22, 24, 26, 28, 30));
|
||||
REQUIRE(result == vec128b(100, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22,
|
||||
24, 26, 28, 30));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128b(UINT8_MAX);
|
||||
ctx->v[5] = vec128b(1);
|
||||
},
|
||||
|
@ -49,7 +51,8 @@ TEST_CASE("VECTOR_ADD_I8_SAT_SIGNED", "[instr]") {
|
|||
ARITHMETIC_SATURATE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128b(INT8_MAX);
|
||||
ctx->v[5] = vec128b(1);
|
||||
},
|
||||
|
@ -57,7 +60,8 @@ TEST_CASE("VECTOR_ADD_I8_SAT_SIGNED", "[instr]") {
|
|||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128b(INT8_MAX));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128b(INT8_MIN);
|
||||
ctx->v[5] = vec128b(-1);
|
||||
},
|
||||
|
@ -73,7 +77,8 @@ TEST_CASE("VECTOR_ADD_I8_SAT_UNSIGNED", "[instr]") {
|
|||
ARITHMETIC_SATURATE | ARITHMETIC_UNSIGNED));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128b(UINT8_MAX);
|
||||
ctx->v[5] = vec128b(1);
|
||||
},
|
||||
|
@ -88,7 +93,8 @@ TEST_CASE("VECTOR_ADD_I16", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorAdd(LoadVR(b, 4), LoadVR(b, 5), INT16_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128s(0, 1, 2, 3, 4, 5, 6, 7);
|
||||
ctx->v[5] = vec128s(100, 1, 2, 3, 4, 5, 6, 7);
|
||||
},
|
||||
|
@ -96,7 +102,8 @@ TEST_CASE("VECTOR_ADD_I16", "[instr]") {
|
|||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128s(100, 2, 4, 6, 8, 10, 12, 14));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128s(UINT16_MAX);
|
||||
ctx->v[5] = vec128s(1);
|
||||
},
|
||||
|
@ -104,7 +111,8 @@ TEST_CASE("VECTOR_ADD_I16", "[instr]") {
|
|||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128s(0));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128s(0);
|
||||
ctx->v[5] = vec128s(-1);
|
||||
},
|
||||
|
@ -120,7 +128,8 @@ TEST_CASE("VECTOR_ADD_I16_SAT_SIGNED", "[instr]") {
|
|||
ARITHMETIC_SATURATE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128s(INT16_MAX);
|
||||
ctx->v[5] = vec128s(1);
|
||||
},
|
||||
|
@ -128,7 +137,8 @@ TEST_CASE("VECTOR_ADD_I16_SAT_SIGNED", "[instr]") {
|
|||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128s(INT16_MAX));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128s(INT16_MIN);
|
||||
ctx->v[5] = vec128s(-1);
|
||||
},
|
||||
|
@ -144,7 +154,8 @@ TEST_CASE("VECTOR_ADD_I16_SAT_UNSIGNED", "[instr]") {
|
|||
ARITHMETIC_SATURATE | ARITHMETIC_UNSIGNED));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128s(UINT16_MAX);
|
||||
ctx->v[5] = vec128s(1);
|
||||
},
|
||||
|
@ -159,7 +170,8 @@ TEST_CASE("VECTOR_ADD_I32", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorAdd(LoadVR(b, 4), LoadVR(b, 5), INT32_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0, 1, 2, 3);
|
||||
ctx->v[5] = vec128i(100, 1, 2, 3);
|
||||
},
|
||||
|
@ -167,7 +179,8 @@ TEST_CASE("VECTOR_ADD_I32", "[instr]") {
|
|||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128i(100, 2, 4, 6));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(UINT32_MAX);
|
||||
ctx->v[5] = vec128i(1);
|
||||
},
|
||||
|
@ -175,7 +188,8 @@ TEST_CASE("VECTOR_ADD_I32", "[instr]") {
|
|||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128i(0));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0);
|
||||
ctx->v[5] = vec128i(-1);
|
||||
},
|
||||
|
@ -191,7 +205,8 @@ TEST_CASE("VECTOR_ADD_I32_SAT_SIGNED", "[instr]") {
|
|||
ARITHMETIC_SATURATE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(5);
|
||||
ctx->v[5] = vec128i(5);
|
||||
},
|
||||
|
@ -199,7 +214,8 @@ TEST_CASE("VECTOR_ADD_I32_SAT_SIGNED", "[instr]") {
|
|||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128i(10));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(INT32_MAX);
|
||||
ctx->v[5] = vec128i(1);
|
||||
},
|
||||
|
@ -207,7 +223,8 @@ TEST_CASE("VECTOR_ADD_I32_SAT_SIGNED", "[instr]") {
|
|||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128i(INT32_MAX));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(INT32_MIN);
|
||||
ctx->v[5] = vec128i(-1);
|
||||
},
|
||||
|
@ -223,7 +240,8 @@ TEST_CASE("VECTOR_ADD_I32_SAT_UNSIGNED", "[instr]") {
|
|||
ARITHMETIC_SATURATE | ARITHMETIC_UNSIGNED));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(5);
|
||||
ctx->v[5] = vec128i(5);
|
||||
},
|
||||
|
@ -231,7 +249,8 @@ TEST_CASE("VECTOR_ADD_I32_SAT_UNSIGNED", "[instr]") {
|
|||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128i(10));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(UINT32_MAX);
|
||||
ctx->v[5] = vec128i(1);
|
||||
},
|
||||
|
@ -246,7 +265,8 @@ TEST_CASE("VECTOR_ADD_F32", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorAdd(LoadVR(b, 4), LoadVR(b, 5), FLOAT32_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128f(0.12f, 0.34f, 0.56f, 0.78f);
|
||||
ctx->v[5] = vec128f(0.12f, 0.34f, 0.56f, 0.78f);
|
||||
},
|
||||
|
@ -255,7 +275,8 @@ TEST_CASE("VECTOR_ADD_F32", "[instr]") {
|
|||
REQUIRE(result ==
|
||||
vec128i(0x3E75C28F, 0x3F2E147B, 0x3F8F5C29, 0x3FC7AE14));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128f(FLT_MAX);
|
||||
ctx->v[5] = vec128f(FLT_MAX);
|
||||
},
|
||||
|
@ -263,7 +284,8 @@ TEST_CASE("VECTOR_ADD_F32", "[instr]") {
|
|||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128i(0x7F800000));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128f(-FLT_MIN);
|
||||
ctx->v[5] = vec128f(-1.0f);
|
||||
},
|
||||
|
@ -271,7 +293,8 @@ TEST_CASE("VECTOR_ADD_F32", "[instr]") {
|
|||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128i(0xBF800000));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128f(FLT_MAX);
|
||||
ctx->v[5] = vec128f(1.0f);
|
||||
},
|
||||
|
|
|
@ -22,7 +22,8 @@ TEST_CASE("VECTOR_MAX_I8_SIGNED", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorMax(LoadVR(b, 4), LoadVR(b, 5), INT8_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
ctx->v[5] = vec128b(-100, 1, 100, -3, 4, -5, 60, 7, -80, 9, 10,
|
||||
|
@ -41,7 +42,8 @@ TEST_CASE("VECTOR_MAX_I8_UNSIGNED", "[instr]") {
|
|||
ARITHMETIC_UNSIGNED));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
ctx->v[5] = vec128b(-100, 1, 100, -3, 4, -5, 60, 7, -80, 9, 10,
|
||||
|
@ -49,8 +51,8 @@ TEST_CASE("VECTOR_MAX_I8_UNSIGNED", "[instr]") {
|
|||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128b(-100, 1, 100, -3, 4, -5, 60, 7, -80, 9,
|
||||
10, INT8_MIN, INT8_MAX, 13, 14, 15));
|
||||
REQUIRE(result == vec128b(-100, 1, 100, -3, 4, -5, 60, 7, -80, 9, 10,
|
||||
INT8_MIN, INT8_MAX, 13, 14, 15));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -59,7 +61,8 @@ TEST_CASE("VECTOR_MAX_I16_SIGNED", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorMax(LoadVR(b, 4), LoadVR(b, 5), INT16_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128s(0, 1, 2, 3, 4, 5, -6000, 7);
|
||||
ctx->v[5] = vec128s(-1000, 1, -2000, 3, 4, SHRT_MAX, 6, 0);
|
||||
},
|
||||
|
@ -91,7 +94,8 @@ TEST_CASE("VECTOR_MAX_I32_SIGNED", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorMax(LoadVR(b, 4), LoadVR(b, 5), INT32_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0, 1, 123, 3);
|
||||
ctx->v[5] = vec128i(-1000000, 0, INT_MAX, 0);
|
||||
},
|
||||
|
@ -107,7 +111,8 @@ TEST_CASE("VECTOR_MAX_I32_UNSIGNED", "[instr]") {
|
|||
ARITHMETIC_UNSIGNED));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0, 1, 123, 3);
|
||||
ctx->v[5] = vec128i(-1000000, 0, UINT_MAX, 0);
|
||||
},
|
||||
|
|
|
@ -22,7 +22,8 @@ TEST_CASE("VECTOR_MIN_I8_SIGNED", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorMin(LoadVR(b, 4), LoadVR(b, 5), INT8_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
ctx->v[5] = vec128b(-100, 1, 100, -3, 4, -5, 60, 7, -80, 9, 10,
|
||||
|
@ -41,16 +42,17 @@ TEST_CASE("VECTOR_MIN_I8_UNSIGNED", "[instr]") {
|
|||
ARITHMETIC_UNSIGNED));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
ctx->v[5] = vec128b(255, 1, 200, -3, 4, -5, 60, 7, -80, 9, 10, 11,
|
||||
12, 13, 2, 0);
|
||||
ctx->v[5] = vec128b(255, 1, 200, -3, 4, -5, 60, 7, -80, 9, 10, 11, 12,
|
||||
13, 2, 0);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
REQUIRE(result == vec128b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
|
||||
13, 2, 0));
|
||||
REQUIRE(result ==
|
||||
vec128b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 2, 0));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -59,7 +61,8 @@ TEST_CASE("VECTOR_MIN_I16_SIGNED", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorMin(LoadVR(b, 4), LoadVR(b, 5), INT16_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128s(0, 1, 2, 3, 4, 5, -6000, 7);
|
||||
ctx->v[5] = vec128s(-1000, 1, -2000, 3, 4, SHRT_MAX, 6, 0);
|
||||
},
|
||||
|
@ -75,7 +78,8 @@ TEST_CASE("VECTOR_MIN_I16_UNSIGNED", "[instr]") {
|
|||
ARITHMETIC_UNSIGNED));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128s(0, 1, 2, 3, 4, 5, -6000, 7);
|
||||
ctx->v[5] = vec128s(-1000, 1, -2000, 3, 4, USHRT_MAX, 6, 0);
|
||||
},
|
||||
|
@ -90,7 +94,8 @@ TEST_CASE("VECTOR_MIN_I32_SIGNED", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorMin(LoadVR(b, 4), LoadVR(b, 5), INT32_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0, 1, 123, 3);
|
||||
ctx->v[5] = vec128i(-1000000, 0, INT_MAX, 0);
|
||||
},
|
||||
|
@ -106,7 +111,8 @@ TEST_CASE("VECTOR_MIN_I32_UNSIGNED", "[instr]") {
|
|||
ARITHMETIC_UNSIGNED));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0, 1, 123, 3);
|
||||
ctx->v[5] = vec128i(-1000000, 0, UINT_MAX, 0);
|
||||
},
|
||||
|
|
|
@ -41,7 +41,8 @@ TEST_CASE("VECTOR_ROTATE_LEFT_I16", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorRotateLeft(LoadVR(b, 4), LoadVR(b, 5), INT16_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128s(0x0001, 0x0001, 0x0001, 0x0001, 0x1000, 0x1000,
|
||||
0x1000, 0x1000);
|
||||
ctx->v[5] = vec128s(0, 1, 2, 3, 14, 15, 16, 17);
|
||||
|
@ -58,9 +59,9 @@ TEST_CASE("VECTOR_ROTATE_LEFT_I32", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorRotateLeft(LoadVR(b, 4), LoadVR(b, 5), INT32_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128i(0x00000001, 0x00000001, 0x80000000, 0x80000000);
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0x00000001, 0x00000001, 0x80000000, 0x80000000);
|
||||
ctx->v[5] = vec128i(0, 1, 1, 2);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
|
|
|
@ -20,10 +20,10 @@ TEST_CASE("VECTOR_SHA_I8", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorSha(LoadVR(b, 4), LoadVR(b, 5), INT8_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128b(0x7E, 0x7E, 0x7E, 0x7F, 0x80, 0xFF, 0x01, 0x12, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128b(0x7E, 0x7E, 0x7E, 0x7F, 0x80, 0xFF, 0x01, 0x12,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
ctx->v[5] =
|
||||
vec128b(0, 1, 2, 8, 4, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
},
|
||||
|
@ -43,10 +43,10 @@ TEST_CASE("VECTOR_SHA_I8_CONSTANT", "[instr]") {
|
|||
INT8_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128b(0x7E, 0x7E, 0x7E, 0x7F, 0x80, 0xFF, 0x01, 0x12, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128b(0x7E, 0x7E, 0x7E, 0x7F, 0x80, 0xFF, 0x01, 0x12,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
|
@ -61,7 +61,8 @@ TEST_CASE("VECTOR_SHA_I16", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorSha(LoadVR(b, 4), LoadVR(b, 5), INT16_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128s(0x7FFE, 0x7FFE, 0x7FFE, 0x7FFF, 0x8000, 0xFFFF,
|
||||
0x0001, 0x1234);
|
||||
ctx->v[5] = vec128s(0, 1, 8, 15, 15, 8, 1, 16);
|
||||
|
@ -80,7 +81,8 @@ TEST_CASE("VECTOR_SHA_I16_CONSTANT", "[instr]") {
|
|||
INT16_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128s(0x7FFE, 0x7FFE, 0x7FFE, 0x7FFF, 0x8000, 0xFFFF,
|
||||
0x0001, 0x1234);
|
||||
},
|
||||
|
@ -96,9 +98,9 @@ TEST_CASE("VECTOR_SHA_I32", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorSha(LoadVR(b, 4), LoadVR(b, 5), INT32_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128i(0x7FFFFFFE, 0x7FFFFFFE, 0x7FFFFFFE, 0x7FFFFFFF);
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0x7FFFFFFE, 0x7FFFFFFE, 0x7FFFFFFE, 0x7FFFFFFF);
|
||||
ctx->v[5] = vec128i(0, 1, 16, 31);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
|
@ -106,9 +108,9 @@ TEST_CASE("VECTOR_SHA_I32", "[instr]") {
|
|||
REQUIRE(result ==
|
||||
vec128i(0x7FFFFFFE, 0x3FFFFFFF, 0x00007FFF, 0x00000000));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128i(0x80000000, 0xFFFFFFFF, 0x00000001, 0x12345678);
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0x80000000, 0xFFFFFFFF, 0x00000001, 0x12345678);
|
||||
ctx->v[5] = vec128i(31, 16, 1, 32);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
|
|
|
@ -20,10 +20,10 @@ TEST_CASE("VECTOR_SHL_I8", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorShl(LoadVR(b, 4), LoadVR(b, 5), INT8_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128b(0x7E, 0x7E, 0x7E, 0x7F, 0x80, 0xFF, 0x01, 0x12, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128b(0x7E, 0x7E, 0x7E, 0x7F, 0x80, 0xFF, 0x01, 0x12,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
ctx->v[5] =
|
||||
vec128b(0, 1, 2, 8, 4, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
},
|
||||
|
@ -43,10 +43,10 @@ TEST_CASE("VECTOR_SHL_I8_CONSTANT", "[instr]") {
|
|||
INT8_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128b(0x7E, 0x7E, 0x7E, 0x7F, 0x80, 0xFF, 0x01, 0x12, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128b(0x7E, 0x7E, 0x7E, 0x7F, 0x80, 0xFF, 0x01, 0x12,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
|
@ -61,7 +61,8 @@ TEST_CASE("VECTOR_SHL_I16", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorShl(LoadVR(b, 4), LoadVR(b, 5), INT16_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128s(0x7FFE, 0x7FFE, 0x7FFE, 0x7FFF, 0x8000, 0xFFFF,
|
||||
0x0001, 0x1234);
|
||||
ctx->v[5] = vec128s(0, 1, 8, 15, 15, 8, 1, 16);
|
||||
|
@ -80,7 +81,8 @@ TEST_CASE("VECTOR_SHL_I16_CONSTANT", "[instr]") {
|
|||
INT16_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128s(0x7FFE, 0x7FFE, 0x7FFE, 0x7FFF, 0x8000, 0xFFFF,
|
||||
0x0001, 0x1234);
|
||||
},
|
||||
|
@ -96,9 +98,9 @@ TEST_CASE("VECTOR_SHL_I32", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorShl(LoadVR(b, 4), LoadVR(b, 5), INT32_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128i(0x7FFFFFFE, 0x7FFFFFFE, 0x7FFFFFFE, 0x7FFFFFFF);
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0x7FFFFFFE, 0x7FFFFFFE, 0x7FFFFFFE, 0x7FFFFFFF);
|
||||
ctx->v[5] = vec128i(0, 1, 16, 31);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
|
@ -106,9 +108,9 @@ TEST_CASE("VECTOR_SHL_I32", "[instr]") {
|
|||
REQUIRE(result ==
|
||||
vec128i(0x7FFFFFFE, 0xFFFFFFFC, 0xFFFE0000, 0x80000000));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128i(0x80000000, 0xFFFFFFFF, 0x00000001, 0x12345678);
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0x80000000, 0xFFFFFFFF, 0x00000001, 0x12345678);
|
||||
ctx->v[5] = vec128i(31, 16, 1, 32);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
|
|
|
@ -20,10 +20,10 @@ TEST_CASE("VECTOR_SHR_I8", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorShr(LoadVR(b, 4), LoadVR(b, 5), INT8_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128b(0x7E, 0x7E, 0x7E, 0x7F, 0x80, 0xFF, 0x01, 0x12, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128b(0x7E, 0x7E, 0x7E, 0x7F, 0x80, 0xFF, 0x01, 0x12,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
ctx->v[5] =
|
||||
vec128b(0, 1, 2, 8, 4, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
},
|
||||
|
@ -43,10 +43,10 @@ TEST_CASE("VECTOR_SHR_I8_CONSTANT", "[instr]") {
|
|||
INT8_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128b(0x7E, 0x7E, 0x7E, 0x7F, 0x80, 0xFF, 0x01, 0x12, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128b(0x7E, 0x7E, 0x7E, 0x7F, 0x80, 0xFF, 0x01, 0x12,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
auto result = ctx->v[3];
|
||||
|
@ -61,7 +61,8 @@ TEST_CASE("VECTOR_SHR_I16", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorShr(LoadVR(b, 4), LoadVR(b, 5), INT16_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128s(0x7FFE, 0x7FFE, 0x7FFE, 0x7FFF, 0x8000, 0xFFFF,
|
||||
0x0001, 0x1234);
|
||||
ctx->v[5] = vec128s(0, 1, 8, 15, 15, 8, 1, 16);
|
||||
|
@ -80,7 +81,8 @@ TEST_CASE("VECTOR_SHR_I16_CONSTANT", "[instr]") {
|
|||
INT16_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128s(0x7FFE, 0x7FFE, 0x7FFE, 0x7FFF, 0x8000, 0xFFFF,
|
||||
0x0001, 0x1234);
|
||||
},
|
||||
|
@ -96,9 +98,9 @@ TEST_CASE("VECTOR_SHR_I32", "[instr]") {
|
|||
StoreVR(b, 3, b.VectorShr(LoadVR(b, 4), LoadVR(b, 5), INT32_TYPE));
|
||||
b.Return();
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128i(0x7FFFFFFE, 0x7FFFFFFE, 0x7FFFFFFE, 0x7FFFFFFF);
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0x7FFFFFFE, 0x7FFFFFFE, 0x7FFFFFFE, 0x7FFFFFFF);
|
||||
ctx->v[5] = vec128i(0, 1, 16, 31);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
|
@ -106,9 +108,9 @@ TEST_CASE("VECTOR_SHR_I32", "[instr]") {
|
|||
REQUIRE(result ==
|
||||
vec128i(0x7FFFFFFE, 0x3FFFFFFF, 0x00007FFF, 0x00000000));
|
||||
});
|
||||
test.Run([](PPCContext* ctx) {
|
||||
ctx->v[4] =
|
||||
vec128i(0x80000000, 0xFFFFFFFF, 0x00000001, 0x12345678);
|
||||
test.Run(
|
||||
[](PPCContext* ctx) {
|
||||
ctx->v[4] = vec128i(0x80000000, 0xFFFFFFFF, 0x00000001, 0x12345678);
|
||||
ctx->v[5] = vec128i(31, 16, 1, 32);
|
||||
},
|
||||
[](PPCContext* ctx) {
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
namespace xe {
|
||||
|
||||
// KernelState forward decl.
|
||||
namespace kernel { class KernelState; }
|
||||
namespace kernel {
|
||||
class KernelState;
|
||||
}
|
||||
|
||||
namespace cpu {
|
||||
|
||||
|
|
|
@ -328,7 +328,8 @@ void Debugger::OnMessage(std::vector<uint8_t> buffer) {
|
|||
request_data->function_index_start() + 1;
|
||||
std::vector<flatbuffers::Offset<proto::FunctionEntry>> function_list;
|
||||
function_list.reserve(max_function_count);
|
||||
processor_module->ForEachSymbol(request_data->function_index_start(),
|
||||
processor_module->ForEachSymbol(
|
||||
request_data->function_index_start(),
|
||||
request_data->function_index_end(),
|
||||
[&](xe::cpu::SymbolInfo* symbol_info) {
|
||||
if (symbol_info->type() != xe::cpu::SymbolType::kFunction) {
|
||||
|
|
|
@ -33,216 +33,292 @@ MANUALLY_ALIGNED_STRUCT(4) Breakpoint FLATBUFFERS_FINAL_CLASS {
|
|||
|
||||
public:
|
||||
Breakpoint(uint32_t breakpoint_id)
|
||||
: breakpoint_id_(flatbuffers::EndianScalar(breakpoint_id)) { }
|
||||
: breakpoint_id_(flatbuffers::EndianScalar(breakpoint_id)) {}
|
||||
|
||||
uint32_t breakpoint_id() const { return flatbuffers::EndianScalar(breakpoint_id_); }
|
||||
uint32_t breakpoint_id() const {
|
||||
return flatbuffers::EndianScalar(breakpoint_id_);
|
||||
}
|
||||
};
|
||||
STRUCT_END(Breakpoint, 4);
|
||||
|
||||
struct ListBreakpointsRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
struct ListBreakpointsRequest FLATBUFFERS_FINAL_CLASS
|
||||
: private flatbuffers::Table {
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
verifier.EndTable();
|
||||
return VerifyTableStart(verifier) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct ListBreakpointsRequestBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
ListBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
ListBreakpointsRequestBuilder &operator=(const ListBreakpointsRequestBuilder &);
|
||||
ListBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
ListBreakpointsRequestBuilder &operator=(
|
||||
const ListBreakpointsRequestBuilder &);
|
||||
flatbuffers::Offset<ListBreakpointsRequest> Finish() {
|
||||
auto o = flatbuffers::Offset<ListBreakpointsRequest>(fbb_.EndTable(start_, 0));
|
||||
auto o =
|
||||
flatbuffers::Offset<ListBreakpointsRequest>(fbb_.EndTable(start_, 0));
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<ListBreakpointsRequest> CreateListBreakpointsRequest(flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
inline flatbuffers::Offset<ListBreakpointsRequest> CreateListBreakpointsRequest(
|
||||
flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
ListBreakpointsRequestBuilder builder_(_fbb);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct ListBreakpointsResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
const flatbuffers::Vector<const Breakpoint *> *breakpoints() const { return GetPointer<const flatbuffers::Vector<const Breakpoint *> *>(4); }
|
||||
struct ListBreakpointsResponse FLATBUFFERS_FINAL_CLASS
|
||||
: private flatbuffers::Table {
|
||||
const flatbuffers::Vector<const Breakpoint *> *breakpoints() const {
|
||||
return GetPointer<const flatbuffers::Vector<const Breakpoint *> *>(4);
|
||||
}
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* breakpoints */) &&
|
||||
verifier.Verify(breakpoints()) &&
|
||||
verifier.EndTable();
|
||||
verifier.Verify(breakpoints()) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct ListBreakpointsResponseBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_breakpoints(flatbuffers::Offset<flatbuffers::Vector<const Breakpoint *>> breakpoints) { fbb_.AddOffset(4, breakpoints); }
|
||||
ListBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
ListBreakpointsResponseBuilder &operator=(const ListBreakpointsResponseBuilder &);
|
||||
void add_breakpoints(flatbuffers::Offset<
|
||||
flatbuffers::Vector<const Breakpoint *>> breakpoints) {
|
||||
fbb_.AddOffset(4, breakpoints);
|
||||
}
|
||||
ListBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
ListBreakpointsResponseBuilder &operator=(
|
||||
const ListBreakpointsResponseBuilder &);
|
||||
flatbuffers::Offset<ListBreakpointsResponse> Finish() {
|
||||
auto o = flatbuffers::Offset<ListBreakpointsResponse>(fbb_.EndTable(start_, 1));
|
||||
auto o =
|
||||
flatbuffers::Offset<ListBreakpointsResponse>(fbb_.EndTable(start_, 1));
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<ListBreakpointsResponse> CreateListBreakpointsResponse(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
flatbuffers::Offset<flatbuffers::Vector<const Breakpoint *>> breakpoints = 0) {
|
||||
inline flatbuffers::Offset<ListBreakpointsResponse>
|
||||
CreateListBreakpointsResponse(
|
||||
flatbuffers::FlatBufferBuilder &_fbb,
|
||||
flatbuffers::Offset<flatbuffers::Vector<const Breakpoint *>> breakpoints =
|
||||
0) {
|
||||
ListBreakpointsResponseBuilder builder_(_fbb);
|
||||
builder_.add_breakpoints(breakpoints);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct AddBreakpointsRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
const flatbuffers::Vector<const Breakpoint *> *breakpoints() const { return GetPointer<const flatbuffers::Vector<const Breakpoint *> *>(4); }
|
||||
struct AddBreakpointsRequest FLATBUFFERS_FINAL_CLASS
|
||||
: private flatbuffers::Table {
|
||||
const flatbuffers::Vector<const Breakpoint *> *breakpoints() const {
|
||||
return GetPointer<const flatbuffers::Vector<const Breakpoint *> *>(4);
|
||||
}
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* breakpoints */) &&
|
||||
verifier.Verify(breakpoints()) &&
|
||||
verifier.EndTable();
|
||||
verifier.Verify(breakpoints()) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct AddBreakpointsRequestBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_breakpoints(flatbuffers::Offset<flatbuffers::Vector<const Breakpoint *>> breakpoints) { fbb_.AddOffset(4, breakpoints); }
|
||||
AddBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
void add_breakpoints(flatbuffers::Offset<
|
||||
flatbuffers::Vector<const Breakpoint *>> breakpoints) {
|
||||
fbb_.AddOffset(4, breakpoints);
|
||||
}
|
||||
AddBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
AddBreakpointsRequestBuilder &operator=(const AddBreakpointsRequestBuilder &);
|
||||
flatbuffers::Offset<AddBreakpointsRequest> Finish() {
|
||||
auto o = flatbuffers::Offset<AddBreakpointsRequest>(fbb_.EndTable(start_, 1));
|
||||
auto o =
|
||||
flatbuffers::Offset<AddBreakpointsRequest>(fbb_.EndTable(start_, 1));
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<AddBreakpointsRequest> CreateAddBreakpointsRequest(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
flatbuffers::Offset<flatbuffers::Vector<const Breakpoint *>> breakpoints = 0) {
|
||||
inline flatbuffers::Offset<AddBreakpointsRequest> CreateAddBreakpointsRequest(
|
||||
flatbuffers::FlatBufferBuilder &_fbb,
|
||||
flatbuffers::Offset<flatbuffers::Vector<const Breakpoint *>> breakpoints =
|
||||
0) {
|
||||
AddBreakpointsRequestBuilder builder_(_fbb);
|
||||
builder_.add_breakpoints(breakpoints);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct AddBreakpointsResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
struct AddBreakpointsResponse FLATBUFFERS_FINAL_CLASS
|
||||
: private flatbuffers::Table {
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
verifier.EndTable();
|
||||
return VerifyTableStart(verifier) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct AddBreakpointsResponseBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
AddBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
AddBreakpointsResponseBuilder &operator=(const AddBreakpointsResponseBuilder &);
|
||||
AddBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
AddBreakpointsResponseBuilder &operator=(
|
||||
const AddBreakpointsResponseBuilder &);
|
||||
flatbuffers::Offset<AddBreakpointsResponse> Finish() {
|
||||
auto o = flatbuffers::Offset<AddBreakpointsResponse>(fbb_.EndTable(start_, 0));
|
||||
auto o =
|
||||
flatbuffers::Offset<AddBreakpointsResponse>(fbb_.EndTable(start_, 0));
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<AddBreakpointsResponse> CreateAddBreakpointsResponse(flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
inline flatbuffers::Offset<AddBreakpointsResponse> CreateAddBreakpointsResponse(
|
||||
flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
AddBreakpointsResponseBuilder builder_(_fbb);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct UpdateBreakpointsRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
const flatbuffers::Vector<const Breakpoint *> *breakpoints() const { return GetPointer<const flatbuffers::Vector<const Breakpoint *> *>(4); }
|
||||
struct UpdateBreakpointsRequest FLATBUFFERS_FINAL_CLASS
|
||||
: private flatbuffers::Table {
|
||||
const flatbuffers::Vector<const Breakpoint *> *breakpoints() const {
|
||||
return GetPointer<const flatbuffers::Vector<const Breakpoint *> *>(4);
|
||||
}
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* breakpoints */) &&
|
||||
verifier.Verify(breakpoints()) &&
|
||||
verifier.EndTable();
|
||||
verifier.Verify(breakpoints()) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct UpdateBreakpointsRequestBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_breakpoints(flatbuffers::Offset<flatbuffers::Vector<const Breakpoint *>> breakpoints) { fbb_.AddOffset(4, breakpoints); }
|
||||
UpdateBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
UpdateBreakpointsRequestBuilder &operator=(const UpdateBreakpointsRequestBuilder &);
|
||||
void add_breakpoints(flatbuffers::Offset<
|
||||
flatbuffers::Vector<const Breakpoint *>> breakpoints) {
|
||||
fbb_.AddOffset(4, breakpoints);
|
||||
}
|
||||
UpdateBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
UpdateBreakpointsRequestBuilder &operator=(
|
||||
const UpdateBreakpointsRequestBuilder &);
|
||||
flatbuffers::Offset<UpdateBreakpointsRequest> Finish() {
|
||||
auto o = flatbuffers::Offset<UpdateBreakpointsRequest>(fbb_.EndTable(start_, 1));
|
||||
auto o =
|
||||
flatbuffers::Offset<UpdateBreakpointsRequest>(fbb_.EndTable(start_, 1));
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<UpdateBreakpointsRequest> CreateUpdateBreakpointsRequest(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
flatbuffers::Offset<flatbuffers::Vector<const Breakpoint *>> breakpoints = 0) {
|
||||
inline flatbuffers::Offset<UpdateBreakpointsRequest>
|
||||
CreateUpdateBreakpointsRequest(
|
||||
flatbuffers::FlatBufferBuilder &_fbb,
|
||||
flatbuffers::Offset<flatbuffers::Vector<const Breakpoint *>> breakpoints =
|
||||
0) {
|
||||
UpdateBreakpointsRequestBuilder builder_(_fbb);
|
||||
builder_.add_breakpoints(breakpoints);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct UpdateBreakpointsResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
struct UpdateBreakpointsResponse FLATBUFFERS_FINAL_CLASS
|
||||
: private flatbuffers::Table {
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
verifier.EndTable();
|
||||
return VerifyTableStart(verifier) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct UpdateBreakpointsResponseBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
UpdateBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
UpdateBreakpointsResponseBuilder &operator=(const UpdateBreakpointsResponseBuilder &);
|
||||
UpdateBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
UpdateBreakpointsResponseBuilder &operator=(
|
||||
const UpdateBreakpointsResponseBuilder &);
|
||||
flatbuffers::Offset<UpdateBreakpointsResponse> Finish() {
|
||||
auto o = flatbuffers::Offset<UpdateBreakpointsResponse>(fbb_.EndTable(start_, 0));
|
||||
auto o = flatbuffers::Offset<UpdateBreakpointsResponse>(
|
||||
fbb_.EndTable(start_, 0));
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<UpdateBreakpointsResponse> CreateUpdateBreakpointsResponse(flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
inline flatbuffers::Offset<UpdateBreakpointsResponse>
|
||||
CreateUpdateBreakpointsResponse(flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
UpdateBreakpointsResponseBuilder builder_(_fbb);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct RemoveBreakpointsRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
const flatbuffers::Vector<const Breakpoint *> *breakpoints() const { return GetPointer<const flatbuffers::Vector<const Breakpoint *> *>(4); }
|
||||
struct RemoveBreakpointsRequest FLATBUFFERS_FINAL_CLASS
|
||||
: private flatbuffers::Table {
|
||||
const flatbuffers::Vector<const Breakpoint *> *breakpoints() const {
|
||||
return GetPointer<const flatbuffers::Vector<const Breakpoint *> *>(4);
|
||||
}
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* breakpoints */) &&
|
||||
verifier.Verify(breakpoints()) &&
|
||||
verifier.EndTable();
|
||||
verifier.Verify(breakpoints()) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct RemoveBreakpointsRequestBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_breakpoints(flatbuffers::Offset<flatbuffers::Vector<const Breakpoint *>> breakpoints) { fbb_.AddOffset(4, breakpoints); }
|
||||
RemoveBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
RemoveBreakpointsRequestBuilder &operator=(const RemoveBreakpointsRequestBuilder &);
|
||||
void add_breakpoints(flatbuffers::Offset<
|
||||
flatbuffers::Vector<const Breakpoint *>> breakpoints) {
|
||||
fbb_.AddOffset(4, breakpoints);
|
||||
}
|
||||
RemoveBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
RemoveBreakpointsRequestBuilder &operator=(
|
||||
const RemoveBreakpointsRequestBuilder &);
|
||||
flatbuffers::Offset<RemoveBreakpointsRequest> Finish() {
|
||||
auto o = flatbuffers::Offset<RemoveBreakpointsRequest>(fbb_.EndTable(start_, 1));
|
||||
auto o =
|
||||
flatbuffers::Offset<RemoveBreakpointsRequest>(fbb_.EndTable(start_, 1));
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<RemoveBreakpointsRequest> CreateRemoveBreakpointsRequest(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
flatbuffers::Offset<flatbuffers::Vector<const Breakpoint *>> breakpoints = 0) {
|
||||
inline flatbuffers::Offset<RemoveBreakpointsRequest>
|
||||
CreateRemoveBreakpointsRequest(
|
||||
flatbuffers::FlatBufferBuilder &_fbb,
|
||||
flatbuffers::Offset<flatbuffers::Vector<const Breakpoint *>> breakpoints =
|
||||
0) {
|
||||
RemoveBreakpointsRequestBuilder builder_(_fbb);
|
||||
builder_.add_breakpoints(breakpoints);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct RemoveBreakpointsResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
struct RemoveBreakpointsResponse FLATBUFFERS_FINAL_CLASS
|
||||
: private flatbuffers::Table {
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
verifier.EndTable();
|
||||
return VerifyTableStart(verifier) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct RemoveBreakpointsResponseBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
RemoveBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
RemoveBreakpointsResponseBuilder &operator=(const RemoveBreakpointsResponseBuilder &);
|
||||
RemoveBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
RemoveBreakpointsResponseBuilder &operator=(
|
||||
const RemoveBreakpointsResponseBuilder &);
|
||||
flatbuffers::Offset<RemoveBreakpointsResponse> Finish() {
|
||||
auto o = flatbuffers::Offset<RemoveBreakpointsResponse>(fbb_.EndTable(start_, 0));
|
||||
auto o = flatbuffers::Offset<RemoveBreakpointsResponse>(
|
||||
fbb_.EndTable(start_, 0));
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<RemoveBreakpointsResponse> CreateRemoveBreakpointsResponse(flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
inline flatbuffers::Offset<RemoveBreakpointsResponse>
|
||||
CreateRemoveBreakpointsResponse(flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
RemoveBreakpointsResponseBuilder builder_(_fbb);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#include "flatbuffers/flatbuffers.h"
|
||||
|
||||
|
||||
namespace xe {
|
||||
namespace debug {
|
||||
namespace proto {
|
||||
|
@ -17,8 +16,7 @@ MANUALLY_ALIGNED_STRUCT(4) XObject FLATBUFFERS_FINAL_CLASS {
|
|||
uint32_t handle_;
|
||||
|
||||
public:
|
||||
XObject(uint32_t handle)
|
||||
: handle_(flatbuffers::EndianScalar(handle)) { }
|
||||
XObject(uint32_t handle) : handle_(flatbuffers::EndianScalar(handle)) {}
|
||||
|
||||
uint32_t handle() const { return flatbuffers::EndianScalar(handle_); }
|
||||
};
|
||||
|
|
|
@ -34,11 +34,13 @@ enum ContinueAction {
|
|||
};
|
||||
|
||||
inline const char **EnumNamesContinueAction() {
|
||||
static const char *names[] = { "Continue", "ContinueTo", nullptr };
|
||||
static const char *names[] = {"Continue", "ContinueTo", nullptr};
|
||||
return names;
|
||||
}
|
||||
|
||||
inline const char *EnumNameContinueAction(ContinueAction e) { return EnumNamesContinueAction()[e]; }
|
||||
inline const char *EnumNameContinueAction(ContinueAction e) {
|
||||
return EnumNamesContinueAction()[e];
|
||||
}
|
||||
|
||||
enum StepAction {
|
||||
StepAction_StepIn = 0,
|
||||
|
@ -47,23 +49,26 @@ enum StepAction {
|
|||
};
|
||||
|
||||
inline const char **EnumNamesStepAction() {
|
||||
static const char *names[] = { "StepIn", "StepOver", "StepOut", nullptr };
|
||||
static const char *names[] = {"StepIn", "StepOver", "StepOut", nullptr};
|
||||
return names;
|
||||
}
|
||||
|
||||
inline const char *EnumNameStepAction(StepAction e) { return EnumNamesStepAction()[e]; }
|
||||
inline const char *EnumNameStepAction(StepAction e) {
|
||||
return EnumNamesStepAction()[e];
|
||||
}
|
||||
|
||||
struct StopRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
verifier.EndTable();
|
||||
return VerifyTableStart(verifier) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct StopRequestBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
StopRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
StopRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
StopRequestBuilder &operator=(const StopRequestBuilder &);
|
||||
flatbuffers::Offset<StopRequest> Finish() {
|
||||
auto o = flatbuffers::Offset<StopRequest>(fbb_.EndTable(start_, 0));
|
||||
|
@ -71,22 +76,24 @@ struct StopRequestBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<StopRequest> CreateStopRequest(flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
inline flatbuffers::Offset<StopRequest> CreateStopRequest(
|
||||
flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
StopRequestBuilder builder_(_fbb);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct StopResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
verifier.EndTable();
|
||||
return VerifyTableStart(verifier) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct StopResponseBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
StopResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
StopResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
StopResponseBuilder &operator=(const StopResponseBuilder &);
|
||||
flatbuffers::Offset<StopResponse> Finish() {
|
||||
auto o = flatbuffers::Offset<StopResponse>(fbb_.EndTable(start_, 0));
|
||||
|
@ -94,22 +101,24 @@ struct StopResponseBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<StopResponse> CreateStopResponse(flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
inline flatbuffers::Offset<StopResponse> CreateStopResponse(
|
||||
flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
StopResponseBuilder builder_(_fbb);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct BreakRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
verifier.EndTable();
|
||||
return VerifyTableStart(verifier) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct BreakRequestBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
BreakRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
BreakRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
BreakRequestBuilder &operator=(const BreakRequestBuilder &);
|
||||
flatbuffers::Offset<BreakRequest> Finish() {
|
||||
auto o = flatbuffers::Offset<BreakRequest>(fbb_.EndTable(start_, 0));
|
||||
|
@ -117,22 +126,24 @@ struct BreakRequestBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<BreakRequest> CreateBreakRequest(flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
inline flatbuffers::Offset<BreakRequest> CreateBreakRequest(
|
||||
flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
BreakRequestBuilder builder_(_fbb);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct BreakResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
verifier.EndTable();
|
||||
return VerifyTableStart(verifier) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct BreakResponseBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
BreakResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
BreakResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
BreakResponseBuilder &operator=(const BreakResponseBuilder &);
|
||||
flatbuffers::Offset<BreakResponse> Finish() {
|
||||
auto o = flatbuffers::Offset<BreakResponse>(fbb_.EndTable(start_, 0));
|
||||
|
@ -140,13 +151,16 @@ struct BreakResponseBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<BreakResponse> CreateBreakResponse(flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
inline flatbuffers::Offset<BreakResponse> CreateBreakResponse(
|
||||
flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
BreakResponseBuilder builder_(_fbb);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct ContinueRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
ContinueAction action() const { return static_cast<ContinueAction>(GetField<int8_t>(4, 0)); }
|
||||
ContinueAction action() const {
|
||||
return static_cast<ContinueAction>(GetField<int8_t>(4, 0));
|
||||
}
|
||||
uint32_t target_address() const { return GetField<uint32_t>(6, 0); }
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
|
@ -159,9 +173,15 @@ struct ContinueRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
|||
struct ContinueRequestBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_action(ContinueAction action) { fbb_.AddElement<int8_t>(4, static_cast<int8_t>(action), 0); }
|
||||
void add_target_address(uint32_t target_address) { fbb_.AddElement<uint32_t>(6, target_address, 0); }
|
||||
ContinueRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
void add_action(ContinueAction action) {
|
||||
fbb_.AddElement<int8_t>(4, static_cast<int8_t>(action), 0);
|
||||
}
|
||||
void add_target_address(uint32_t target_address) {
|
||||
fbb_.AddElement<uint32_t>(6, target_address, 0);
|
||||
}
|
||||
ContinueRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
ContinueRequestBuilder &operator=(const ContinueRequestBuilder &);
|
||||
flatbuffers::Offset<ContinueRequest> Finish() {
|
||||
auto o = flatbuffers::Offset<ContinueRequest>(fbb_.EndTable(start_, 2));
|
||||
|
@ -169,7 +189,8 @@ struct ContinueRequestBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<ContinueRequest> CreateContinueRequest(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
inline flatbuffers::Offset<ContinueRequest> CreateContinueRequest(
|
||||
flatbuffers::FlatBufferBuilder &_fbb,
|
||||
ContinueAction action = ContinueAction_Continue,
|
||||
uint32_t target_address = 0) {
|
||||
ContinueRequestBuilder builder_(_fbb);
|
||||
|
@ -180,15 +201,16 @@ inline flatbuffers::Offset<ContinueRequest> CreateContinueRequest(flatbuffers::F
|
|||
|
||||
struct ContinueResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
verifier.EndTable();
|
||||
return VerifyTableStart(verifier) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct ContinueResponseBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
ContinueResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
ContinueResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
ContinueResponseBuilder &operator=(const ContinueResponseBuilder &);
|
||||
flatbuffers::Offset<ContinueResponse> Finish() {
|
||||
auto o = flatbuffers::Offset<ContinueResponse>(fbb_.EndTable(start_, 0));
|
||||
|
@ -196,13 +218,16 @@ struct ContinueResponseBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<ContinueResponse> CreateContinueResponse(flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
inline flatbuffers::Offset<ContinueResponse> CreateContinueResponse(
|
||||
flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
ContinueResponseBuilder builder_(_fbb);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct StepRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
StepAction action() const { return static_cast<StepAction>(GetField<int8_t>(4, 0)); }
|
||||
StepAction action() const {
|
||||
return static_cast<StepAction>(GetField<int8_t>(4, 0));
|
||||
}
|
||||
uint32_t thread_id() const { return GetField<uint32_t>(6, 0); }
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
|
@ -215,9 +240,15 @@ struct StepRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
|||
struct StepRequestBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_action(StepAction action) { fbb_.AddElement<int8_t>(4, static_cast<int8_t>(action), 0); }
|
||||
void add_thread_id(uint32_t thread_id) { fbb_.AddElement<uint32_t>(6, thread_id, 0); }
|
||||
StepRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
void add_action(StepAction action) {
|
||||
fbb_.AddElement<int8_t>(4, static_cast<int8_t>(action), 0);
|
||||
}
|
||||
void add_thread_id(uint32_t thread_id) {
|
||||
fbb_.AddElement<uint32_t>(6, thread_id, 0);
|
||||
}
|
||||
StepRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
StepRequestBuilder &operator=(const StepRequestBuilder &);
|
||||
flatbuffers::Offset<StepRequest> Finish() {
|
||||
auto o = flatbuffers::Offset<StepRequest>(fbb_.EndTable(start_, 2));
|
||||
|
@ -225,8 +256,8 @@ struct StepRequestBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<StepRequest> CreateStepRequest(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
StepAction action = StepAction_StepIn,
|
||||
inline flatbuffers::Offset<StepRequest> CreateStepRequest(
|
||||
flatbuffers::FlatBufferBuilder &_fbb, StepAction action = StepAction_StepIn,
|
||||
uint32_t thread_id = 0) {
|
||||
StepRequestBuilder builder_(_fbb);
|
||||
builder_.add_thread_id(thread_id);
|
||||
|
@ -236,15 +267,16 @@ inline flatbuffers::Offset<StepRequest> CreateStepRequest(flatbuffers::FlatBuffe
|
|||
|
||||
struct StepResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
verifier.EndTable();
|
||||
return VerifyTableStart(verifier) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct StepResponseBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
StepResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
StepResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
StepResponseBuilder &operator=(const StepResponseBuilder &);
|
||||
flatbuffers::Offset<StepResponse> Finish() {
|
||||
auto o = flatbuffers::Offset<StepResponse>(fbb_.EndTable(start_, 0));
|
||||
|
@ -252,7 +284,8 @@ struct StepResponseBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<StepResponse> CreateStepResponse(flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
inline flatbuffers::Offset<StepResponse> CreateStepResponse(
|
||||
flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
StepResponseBuilder builder_(_fbb);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
@ -271,9 +304,15 @@ struct BreakpointEvent FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
|||
struct BreakpointEventBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_thread_id(uint32_t thread_id) { fbb_.AddElement<uint32_t>(4, thread_id, 0); }
|
||||
void add_breakpoint_id(uint32_t breakpoint_id) { fbb_.AddElement<uint32_t>(6, breakpoint_id, 0); }
|
||||
BreakpointEventBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
void add_thread_id(uint32_t thread_id) {
|
||||
fbb_.AddElement<uint32_t>(4, thread_id, 0);
|
||||
}
|
||||
void add_breakpoint_id(uint32_t breakpoint_id) {
|
||||
fbb_.AddElement<uint32_t>(6, breakpoint_id, 0);
|
||||
}
|
||||
BreakpointEventBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
BreakpointEventBuilder &operator=(const BreakpointEventBuilder &);
|
||||
flatbuffers::Offset<BreakpointEvent> Finish() {
|
||||
auto o = flatbuffers::Offset<BreakpointEvent>(fbb_.EndTable(start_, 2));
|
||||
|
@ -281,8 +320,8 @@ struct BreakpointEventBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<BreakpointEvent> CreateBreakpointEvent(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
uint32_t thread_id = 0,
|
||||
inline flatbuffers::Offset<BreakpointEvent> CreateBreakpointEvent(
|
||||
flatbuffers::FlatBufferBuilder &_fbb, uint32_t thread_id = 0,
|
||||
uint32_t breakpoint_id = 0) {
|
||||
BreakpointEventBuilder builder_(_fbb);
|
||||
builder_.add_breakpoint_id(breakpoint_id);
|
||||
|
@ -290,7 +329,8 @@ inline flatbuffers::Offset<BreakpointEvent> CreateBreakpointEvent(flatbuffers::F
|
|||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct AccessViolationEvent FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
struct AccessViolationEvent FLATBUFFERS_FINAL_CLASS
|
||||
: private flatbuffers::Table {
|
||||
uint32_t thread_id() const { return GetField<uint32_t>(4, 0); }
|
||||
uint32_t target_address() const { return GetField<uint32_t>(6, 0); }
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
|
@ -304,18 +344,26 @@ struct AccessViolationEvent FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table
|
|||
struct AccessViolationEventBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_thread_id(uint32_t thread_id) { fbb_.AddElement<uint32_t>(4, thread_id, 0); }
|
||||
void add_target_address(uint32_t target_address) { fbb_.AddElement<uint32_t>(6, target_address, 0); }
|
||||
AccessViolationEventBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
void add_thread_id(uint32_t thread_id) {
|
||||
fbb_.AddElement<uint32_t>(4, thread_id, 0);
|
||||
}
|
||||
void add_target_address(uint32_t target_address) {
|
||||
fbb_.AddElement<uint32_t>(6, target_address, 0);
|
||||
}
|
||||
AccessViolationEventBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
AccessViolationEventBuilder &operator=(const AccessViolationEventBuilder &);
|
||||
flatbuffers::Offset<AccessViolationEvent> Finish() {
|
||||
auto o = flatbuffers::Offset<AccessViolationEvent>(fbb_.EndTable(start_, 2));
|
||||
auto o =
|
||||
flatbuffers::Offset<AccessViolationEvent>(fbb_.EndTable(start_, 2));
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<AccessViolationEvent> CreateAccessViolationEvent(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
uint32_t thread_id = 0,
|
||||
inline flatbuffers::Offset<AccessViolationEvent> CreateAccessViolationEvent(
|
||||
flatbuffers::FlatBufferBuilder &_fbb, uint32_t thread_id = 0,
|
||||
uint32_t target_address = 0) {
|
||||
AccessViolationEventBuilder builder_(_fbb);
|
||||
builder_.add_target_address(target_address);
|
||||
|
|
|
@ -100,20 +100,20 @@ enum RequestData {
|
|||
|
||||
inline const char **EnumNamesRequestData() {
|
||||
static const char *names[] = {
|
||||
"NONE", "AttachRequest",
|
||||
"ListBreakpointsRequest", "AddBreakpointsRequest",
|
||||
"UpdateBreakpointsRequest", "RemoveBreakpointsRequest",
|
||||
"ListModulesRequest", "GetModuleRequest",
|
||||
"ListFunctionsRequest", "GetFunctionRequest",
|
||||
"ListThreadsRequest", "StopRequest",
|
||||
"BreakRequest", "ContinueRequest",
|
||||
"StepRequest", nullptr};
|
||||
"NONE", "AttachRequest", "ListBreakpointsRequest",
|
||||
"AddBreakpointsRequest", "UpdateBreakpointsRequest",
|
||||
"RemoveBreakpointsRequest", "ListModulesRequest", "GetModuleRequest",
|
||||
"ListFunctionsRequest", "GetFunctionRequest", "ListThreadsRequest",
|
||||
"StopRequest", "BreakRequest", "ContinueRequest", "StepRequest", nullptr};
|
||||
return names;
|
||||
}
|
||||
|
||||
inline const char *EnumNameRequestData(RequestData e) { return EnumNamesRequestData()[e]; }
|
||||
inline const char *EnumNameRequestData(RequestData e) {
|
||||
return EnumNamesRequestData()[e];
|
||||
}
|
||||
|
||||
inline bool VerifyRequestData(flatbuffers::Verifier &verifier, const void *union_obj, RequestData type);
|
||||
inline bool VerifyRequestData(flatbuffers::Verifier &verifier,
|
||||
const void *union_obj, RequestData type);
|
||||
|
||||
enum ResponseData {
|
||||
ResponseData_NONE = 0,
|
||||
|
@ -137,33 +137,34 @@ enum ResponseData {
|
|||
|
||||
inline const char **EnumNamesResponseData() {
|
||||
static const char *names[] = {
|
||||
"NONE", "AttachResponse",
|
||||
"ListBreakpointsResponse", "AddBreakpointsResponse",
|
||||
"UpdateBreakpointsResponse", "RemoveBreakpointsResponse",
|
||||
"ListModulesResponse", "GetModuleResponse",
|
||||
"ListFunctionsResponse", "GetFunctionResponse",
|
||||
"ListThreadsResponse", "StopResponse",
|
||||
"BreakResponse", "ContinueResponse",
|
||||
"StepResponse", "BreakpointEvent",
|
||||
"AccessViolationEvent", nullptr};
|
||||
"NONE", "AttachResponse", "ListBreakpointsResponse",
|
||||
"AddBreakpointsResponse", "UpdateBreakpointsResponse",
|
||||
"RemoveBreakpointsResponse", "ListModulesResponse", "GetModuleResponse",
|
||||
"ListFunctionsResponse", "GetFunctionResponse", "ListThreadsResponse",
|
||||
"StopResponse", "BreakResponse", "ContinueResponse", "StepResponse",
|
||||
"BreakpointEvent", "AccessViolationEvent", nullptr};
|
||||
return names;
|
||||
}
|
||||
|
||||
inline const char *EnumNameResponseData(ResponseData e) { return EnumNamesResponseData()[e]; }
|
||||
inline const char *EnumNameResponseData(ResponseData e) {
|
||||
return EnumNamesResponseData()[e];
|
||||
}
|
||||
|
||||
inline bool VerifyResponseData(flatbuffers::Verifier &verifier, const void *union_obj, ResponseData type);
|
||||
inline bool VerifyResponseData(flatbuffers::Verifier &verifier,
|
||||
const void *union_obj, ResponseData type);
|
||||
|
||||
struct AttachRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
verifier.EndTable();
|
||||
return VerifyTableStart(verifier) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct AttachRequestBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
AttachRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
AttachRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
AttachRequestBuilder &operator=(const AttachRequestBuilder &);
|
||||
flatbuffers::Offset<AttachRequest> Finish() {
|
||||
auto o = flatbuffers::Offset<AttachRequest>(fbb_.EndTable(start_, 0));
|
||||
|
@ -171,44 +172,72 @@ struct AttachRequestBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<AttachRequest> CreateAttachRequest(flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
inline flatbuffers::Offset<AttachRequest> CreateAttachRequest(
|
||||
flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
AttachRequestBuilder builder_(_fbb);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct AttachResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
const flatbuffers::String *memory_file() const { return GetPointer<const flatbuffers::String *>(4); }
|
||||
const flatbuffers::String *code_cache_file() const { return GetPointer<const flatbuffers::String *>(6); }
|
||||
const flatbuffers::String *memory_file() const {
|
||||
return GetPointer<const flatbuffers::String *>(4);
|
||||
}
|
||||
const flatbuffers::String *code_cache_file() const {
|
||||
return GetPointer<const flatbuffers::String *>(6);
|
||||
}
|
||||
uint32_t code_cache_base() const { return GetField<uint32_t>(8, 0); }
|
||||
uint32_t code_cache_size() const { return GetField<uint32_t>(10, 0); }
|
||||
const flatbuffers::String *functions_file() const { return GetPointer<const flatbuffers::String *>(12); }
|
||||
const flatbuffers::String *functions_trace_file() const { return GetPointer<const flatbuffers::String *>(14); }
|
||||
const flatbuffers::String *functions_file() const {
|
||||
return GetPointer<const flatbuffers::String *>(12);
|
||||
}
|
||||
const flatbuffers::String *functions_trace_file() const {
|
||||
return GetPointer<const flatbuffers::String *>(14);
|
||||
}
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* memory_file */) &&
|
||||
verifier.Verify(memory_file()) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 6 /* code_cache_file */) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier,
|
||||
6 /* code_cache_file */) &&
|
||||
verifier.Verify(code_cache_file()) &&
|
||||
VerifyField<uint32_t>(verifier, 8 /* code_cache_base */) &&
|
||||
VerifyField<uint32_t>(verifier, 10 /* code_cache_size */) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 12 /* functions_file */) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier,
|
||||
12 /* functions_file */) &&
|
||||
verifier.Verify(functions_file()) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 14 /* functions_trace_file */) &&
|
||||
verifier.Verify(functions_trace_file()) &&
|
||||
verifier.EndTable();
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier,
|
||||
14 /* functions_trace_file */) &&
|
||||
verifier.Verify(functions_trace_file()) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct AttachResponseBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_memory_file(flatbuffers::Offset<flatbuffers::String> memory_file) { fbb_.AddOffset(4, memory_file); }
|
||||
void add_code_cache_file(flatbuffers::Offset<flatbuffers::String> code_cache_file) { fbb_.AddOffset(6, code_cache_file); }
|
||||
void add_code_cache_base(uint32_t code_cache_base) { fbb_.AddElement<uint32_t>(8, code_cache_base, 0); }
|
||||
void add_code_cache_size(uint32_t code_cache_size) { fbb_.AddElement<uint32_t>(10, code_cache_size, 0); }
|
||||
void add_functions_file(flatbuffers::Offset<flatbuffers::String> functions_file) { fbb_.AddOffset(12, functions_file); }
|
||||
void add_functions_trace_file(flatbuffers::Offset<flatbuffers::String> functions_trace_file) { fbb_.AddOffset(14, functions_trace_file); }
|
||||
AttachResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
void add_memory_file(flatbuffers::Offset<flatbuffers::String> memory_file) {
|
||||
fbb_.AddOffset(4, memory_file);
|
||||
}
|
||||
void add_code_cache_file(
|
||||
flatbuffers::Offset<flatbuffers::String> code_cache_file) {
|
||||
fbb_.AddOffset(6, code_cache_file);
|
||||
}
|
||||
void add_code_cache_base(uint32_t code_cache_base) {
|
||||
fbb_.AddElement<uint32_t>(8, code_cache_base, 0);
|
||||
}
|
||||
void add_code_cache_size(uint32_t code_cache_size) {
|
||||
fbb_.AddElement<uint32_t>(10, code_cache_size, 0);
|
||||
}
|
||||
void add_functions_file(
|
||||
flatbuffers::Offset<flatbuffers::String> functions_file) {
|
||||
fbb_.AddOffset(12, functions_file);
|
||||
}
|
||||
void add_functions_trace_file(
|
||||
flatbuffers::Offset<flatbuffers::String> functions_trace_file) {
|
||||
fbb_.AddOffset(14, functions_trace_file);
|
||||
}
|
||||
AttachResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
AttachResponseBuilder &operator=(const AttachResponseBuilder &);
|
||||
flatbuffers::Offset<AttachResponse> Finish() {
|
||||
auto o = flatbuffers::Offset<AttachResponse>(fbb_.EndTable(start_, 6));
|
||||
|
@ -216,11 +245,11 @@ struct AttachResponseBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<AttachResponse> CreateAttachResponse(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
inline flatbuffers::Offset<AttachResponse> CreateAttachResponse(
|
||||
flatbuffers::FlatBufferBuilder &_fbb,
|
||||
flatbuffers::Offset<flatbuffers::String> memory_file = 0,
|
||||
flatbuffers::Offset<flatbuffers::String> code_cache_file = 0,
|
||||
uint32_t code_cache_base = 0,
|
||||
uint32_t code_cache_size = 0,
|
||||
uint32_t code_cache_base = 0, uint32_t code_cache_size = 0,
|
||||
flatbuffers::Offset<flatbuffers::String> functions_file = 0,
|
||||
flatbuffers::Offset<flatbuffers::String> functions_trace_file = 0) {
|
||||
AttachResponseBuilder builder_(_fbb);
|
||||
|
@ -235,13 +264,16 @@ inline flatbuffers::Offset<AttachResponse> CreateAttachResponse(flatbuffers::Fla
|
|||
|
||||
struct Request FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
uint32_t id() const { return GetField<uint32_t>(4, 0); }
|
||||
RequestData request_data_type() const { return static_cast<RequestData>(GetField<uint8_t>(6, 0)); }
|
||||
RequestData request_data_type() const {
|
||||
return static_cast<RequestData>(GetField<uint8_t>(6, 0));
|
||||
}
|
||||
const void *request_data() const { return GetPointer<const void *>(8); }
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<uint32_t>(verifier, 4 /* id */) &&
|
||||
VerifyField<uint8_t>(verifier, 6 /* request_data_type */) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 8 /* request_data */) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier,
|
||||
8 /* request_data */) &&
|
||||
VerifyRequestData(verifier, request_data(), request_data_type()) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
|
@ -251,9 +283,15 @@ struct RequestBuilder {
|
|||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_id(uint32_t id) { fbb_.AddElement<uint32_t>(4, id, 0); }
|
||||
void add_request_data_type(RequestData request_data_type) { fbb_.AddElement<uint8_t>(6, static_cast<uint8_t>(request_data_type), 0); }
|
||||
void add_request_data(flatbuffers::Offset<void> request_data) { fbb_.AddOffset(8, request_data); }
|
||||
RequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
void add_request_data_type(RequestData request_data_type) {
|
||||
fbb_.AddElement<uint8_t>(6, static_cast<uint8_t>(request_data_type), 0);
|
||||
}
|
||||
void add_request_data(flatbuffers::Offset<void> request_data) {
|
||||
fbb_.AddOffset(8, request_data);
|
||||
}
|
||||
RequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
RequestBuilder &operator=(const RequestBuilder &);
|
||||
flatbuffers::Offset<Request> Finish() {
|
||||
auto o = flatbuffers::Offset<Request>(fbb_.EndTable(start_, 3));
|
||||
|
@ -261,8 +299,8 @@ struct RequestBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<Request> CreateRequest(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
uint32_t id = 0,
|
||||
inline flatbuffers::Offset<Request> CreateRequest(
|
||||
flatbuffers::FlatBufferBuilder &_fbb, uint32_t id = 0,
|
||||
RequestData request_data_type = RequestData_NONE,
|
||||
flatbuffers::Offset<void> request_data = 0) {
|
||||
RequestBuilder builder_(_fbb);
|
||||
|
@ -274,14 +312,18 @@ inline flatbuffers::Offset<Request> CreateRequest(flatbuffers::FlatBufferBuilder
|
|||
|
||||
struct Response FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
uint32_t id() const { return GetField<uint32_t>(4, 0); }
|
||||
ResponseData response_data_type() const { return static_cast<ResponseData>(GetField<uint8_t>(6, 0)); }
|
||||
ResponseData response_data_type() const {
|
||||
return static_cast<ResponseData>(GetField<uint8_t>(6, 0));
|
||||
}
|
||||
const void *response_data() const { return GetPointer<const void *>(8); }
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<uint32_t>(verifier, 4 /* id */) &&
|
||||
VerifyField<uint8_t>(verifier, 6 /* response_data_type */) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 8 /* response_data */) &&
|
||||
VerifyResponseData(verifier, response_data(), response_data_type()) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier,
|
||||
8 /* response_data */) &&
|
||||
VerifyResponseData(verifier, response_data(),
|
||||
response_data_type()) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
@ -290,9 +332,15 @@ struct ResponseBuilder {
|
|||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_id(uint32_t id) { fbb_.AddElement<uint32_t>(4, id, 0); }
|
||||
void add_response_data_type(ResponseData response_data_type) { fbb_.AddElement<uint8_t>(6, static_cast<uint8_t>(response_data_type), 0); }
|
||||
void add_response_data(flatbuffers::Offset<void> response_data) { fbb_.AddOffset(8, response_data); }
|
||||
ResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
void add_response_data_type(ResponseData response_data_type) {
|
||||
fbb_.AddElement<uint8_t>(6, static_cast<uint8_t>(response_data_type), 0);
|
||||
}
|
||||
void add_response_data(flatbuffers::Offset<void> response_data) {
|
||||
fbb_.AddOffset(8, response_data);
|
||||
}
|
||||
ResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
ResponseBuilder &operator=(const ResponseBuilder &);
|
||||
flatbuffers::Offset<Response> Finish() {
|
||||
auto o = flatbuffers::Offset<Response>(fbb_.EndTable(start_, 3));
|
||||
|
@ -300,8 +348,8 @@ struct ResponseBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<Response> CreateResponse(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
uint32_t id = 0,
|
||||
inline flatbuffers::Offset<Response> CreateResponse(
|
||||
flatbuffers::FlatBufferBuilder &_fbb, uint32_t id = 0,
|
||||
ResponseData response_data_type = ResponseData_NONE,
|
||||
flatbuffers::Offset<void> response_data = 0) {
|
||||
ResponseBuilder builder_(_fbb);
|
||||
|
@ -311,53 +359,135 @@ inline flatbuffers::Offset<Response> CreateResponse(flatbuffers::FlatBufferBuild
|
|||
return builder_.Finish();
|
||||
}
|
||||
|
||||
inline bool VerifyRequestData(flatbuffers::Verifier &verifier, const void *union_obj, RequestData type) {
|
||||
inline bool VerifyRequestData(flatbuffers::Verifier &verifier,
|
||||
const void *union_obj, RequestData type) {
|
||||
switch (type) {
|
||||
case RequestData_NONE: return true;
|
||||
case RequestData_AttachRequest: return verifier.VerifyTable(reinterpret_cast<const AttachRequest *>(union_obj));
|
||||
case RequestData_ListBreakpointsRequest: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::ListBreakpointsRequest *>(union_obj));
|
||||
case RequestData_AddBreakpointsRequest: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::AddBreakpointsRequest *>(union_obj));
|
||||
case RequestData_UpdateBreakpointsRequest: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::UpdateBreakpointsRequest *>(union_obj));
|
||||
case RequestData_RemoveBreakpointsRequest: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::RemoveBreakpointsRequest *>(union_obj));
|
||||
case RequestData_ListModulesRequest: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::ListModulesRequest *>(union_obj));
|
||||
case RequestData_GetModuleRequest: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::GetModuleRequest *>(union_obj));
|
||||
case RequestData_ListFunctionsRequest: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::ListFunctionsRequest *>(union_obj));
|
||||
case RequestData_GetFunctionRequest: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::GetFunctionRequest *>(union_obj));
|
||||
case RequestData_NONE:
|
||||
return true;
|
||||
case RequestData_AttachRequest:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const AttachRequest *>(union_obj));
|
||||
case RequestData_ListBreakpointsRequest:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::ListBreakpointsRequest *>(
|
||||
union_obj));
|
||||
case RequestData_AddBreakpointsRequest:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::AddBreakpointsRequest *>(
|
||||
union_obj));
|
||||
case RequestData_UpdateBreakpointsRequest:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::UpdateBreakpointsRequest *>(
|
||||
union_obj));
|
||||
case RequestData_RemoveBreakpointsRequest:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::RemoveBreakpointsRequest *>(
|
||||
union_obj));
|
||||
case RequestData_ListModulesRequest:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::ListModulesRequest *>(
|
||||
union_obj));
|
||||
case RequestData_GetModuleRequest:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::GetModuleRequest *>(
|
||||
union_obj));
|
||||
case RequestData_ListFunctionsRequest:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::ListFunctionsRequest *>(
|
||||
union_obj));
|
||||
case RequestData_GetFunctionRequest:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::GetFunctionRequest *>(
|
||||
union_obj));
|
||||
case RequestData_ListThreadsRequest:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::ListThreadsRequest *>(
|
||||
union_obj));
|
||||
case RequestData_StopRequest: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::StopRequest *>(union_obj));
|
||||
case RequestData_BreakRequest: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::BreakRequest *>(union_obj));
|
||||
case RequestData_ContinueRequest: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::ContinueRequest *>(union_obj));
|
||||
case RequestData_StepRequest: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::StepRequest *>(union_obj));
|
||||
default: return false;
|
||||
case RequestData_StopRequest:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::StopRequest *>(union_obj));
|
||||
case RequestData_BreakRequest:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::BreakRequest *>(union_obj));
|
||||
case RequestData_ContinueRequest:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::ContinueRequest *>(
|
||||
union_obj));
|
||||
case RequestData_StepRequest:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::StepRequest *>(union_obj));
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
inline bool VerifyResponseData(flatbuffers::Verifier &verifier, const void *union_obj, ResponseData type) {
|
||||
inline bool VerifyResponseData(flatbuffers::Verifier &verifier,
|
||||
const void *union_obj, ResponseData type) {
|
||||
switch (type) {
|
||||
case ResponseData_NONE: return true;
|
||||
case ResponseData_AttachResponse: return verifier.VerifyTable(reinterpret_cast<const AttachResponse *>(union_obj));
|
||||
case ResponseData_ListBreakpointsResponse: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::ListBreakpointsResponse *>(union_obj));
|
||||
case ResponseData_AddBreakpointsResponse: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::AddBreakpointsResponse *>(union_obj));
|
||||
case ResponseData_UpdateBreakpointsResponse: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::UpdateBreakpointsResponse *>(union_obj));
|
||||
case ResponseData_RemoveBreakpointsResponse: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::RemoveBreakpointsResponse *>(union_obj));
|
||||
case ResponseData_ListModulesResponse: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::ListModulesResponse *>(union_obj));
|
||||
case ResponseData_GetModuleResponse: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::GetModuleResponse *>(union_obj));
|
||||
case ResponseData_ListFunctionsResponse: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::ListFunctionsResponse *>(union_obj));
|
||||
case ResponseData_GetFunctionResponse: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::GetFunctionResponse *>(union_obj));
|
||||
case ResponseData_NONE:
|
||||
return true;
|
||||
case ResponseData_AttachResponse:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const AttachResponse *>(union_obj));
|
||||
case ResponseData_ListBreakpointsResponse:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::ListBreakpointsResponse *>(
|
||||
union_obj));
|
||||
case ResponseData_AddBreakpointsResponse:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::AddBreakpointsResponse *>(
|
||||
union_obj));
|
||||
case ResponseData_UpdateBreakpointsResponse:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::UpdateBreakpointsResponse *>(
|
||||
union_obj));
|
||||
case ResponseData_RemoveBreakpointsResponse:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::RemoveBreakpointsResponse *>(
|
||||
union_obj));
|
||||
case ResponseData_ListModulesResponse:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::ListModulesResponse *>(
|
||||
union_obj));
|
||||
case ResponseData_GetModuleResponse:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::GetModuleResponse *>(
|
||||
union_obj));
|
||||
case ResponseData_ListFunctionsResponse:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::ListFunctionsResponse *>(
|
||||
union_obj));
|
||||
case ResponseData_GetFunctionResponse:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::GetFunctionResponse *>(
|
||||
union_obj));
|
||||
case ResponseData_ListThreadsResponse:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::ListThreadsResponse *>(
|
||||
union_obj));
|
||||
case ResponseData_StopResponse: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::StopResponse *>(union_obj));
|
||||
case ResponseData_BreakResponse: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::BreakResponse *>(union_obj));
|
||||
case ResponseData_ContinueResponse: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::ContinueResponse *>(union_obj));
|
||||
case ResponseData_StepResponse: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::StepResponse *>(union_obj));
|
||||
case ResponseData_BreakpointEvent: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::BreakpointEvent *>(union_obj));
|
||||
case ResponseData_AccessViolationEvent: return verifier.VerifyTable(reinterpret_cast<const xe::debug::proto::AccessViolationEvent *>(union_obj));
|
||||
default: return false;
|
||||
case ResponseData_StopResponse:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::StopResponse *>(union_obj));
|
||||
case ResponseData_BreakResponse:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::BreakResponse *>(union_obj));
|
||||
case ResponseData_ContinueResponse:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::ContinueResponse *>(
|
||||
union_obj));
|
||||
case ResponseData_StepResponse:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::StepResponse *>(union_obj));
|
||||
case ResponseData_BreakpointEvent:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::BreakpointEvent *>(
|
||||
union_obj));
|
||||
case ResponseData_AccessViolationEvent:
|
||||
return verifier.VerifyTable(
|
||||
reinterpret_cast<const xe::debug::proto::AccessViolationEvent *>(
|
||||
union_obj));
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,17 +30,16 @@ struct ListFunctionsResponse;
|
|||
struct GetFunctionRequest;
|
||||
struct GetFunctionResponse;
|
||||
|
||||
enum ModuleType {
|
||||
ModuleType_Kernel = 0,
|
||||
ModuleType_User = 1
|
||||
};
|
||||
enum ModuleType { ModuleType_Kernel = 0, ModuleType_User = 1 };
|
||||
|
||||
inline const char **EnumNamesModuleType() {
|
||||
static const char *names[] = { "Kernel", "User", nullptr };
|
||||
static const char *names[] = {"Kernel", "User", nullptr};
|
||||
return names;
|
||||
}
|
||||
|
||||
inline const char *EnumNameModuleType(ModuleType e) { return EnumNamesModuleType()[e]; }
|
||||
inline const char *EnumNameModuleType(ModuleType e) {
|
||||
return EnumNamesModuleType()[e];
|
||||
}
|
||||
|
||||
MANUALLY_ALIGNED_STRUCT(4) ListModuleEntry FLATBUFFERS_FINAL_CLASS {
|
||||
private:
|
||||
|
@ -49,18 +48,29 @@ MANUALLY_ALIGNED_STRUCT(4) ListModuleEntry FLATBUFFERS_FINAL_CLASS {
|
|||
|
||||
public:
|
||||
ListModuleEntry(uint32_t handle, uint32_t function_count)
|
||||
: handle_(flatbuffers::EndianScalar(handle)), function_count_(flatbuffers::EndianScalar(function_count)) { }
|
||||
: handle_(flatbuffers::EndianScalar(handle)),
|
||||
function_count_(flatbuffers::EndianScalar(function_count)) {}
|
||||
|
||||
uint32_t handle() const { return flatbuffers::EndianScalar(handle_); }
|
||||
uint32_t function_count() const { return flatbuffers::EndianScalar(function_count_); }
|
||||
uint32_t function_count() const {
|
||||
return flatbuffers::EndianScalar(function_count_);
|
||||
}
|
||||
};
|
||||
STRUCT_END(ListModuleEntry, 8);
|
||||
|
||||
struct Module FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
const xe::debug::proto::XObject *object() const { return GetStruct<const xe::debug::proto::XObject *>(4); }
|
||||
ModuleType type() const { return static_cast<ModuleType>(GetField<int8_t>(6, 0)); }
|
||||
const flatbuffers::String *name() const { return GetPointer<const flatbuffers::String *>(8); }
|
||||
const flatbuffers::String *path() const { return GetPointer<const flatbuffers::String *>(10); }
|
||||
const xe::debug::proto::XObject *object() const {
|
||||
return GetStruct<const xe::debug::proto::XObject *>(4);
|
||||
}
|
||||
ModuleType type() const {
|
||||
return static_cast<ModuleType>(GetField<int8_t>(6, 0));
|
||||
}
|
||||
const flatbuffers::String *name() const {
|
||||
return GetPointer<const flatbuffers::String *>(8);
|
||||
}
|
||||
const flatbuffers::String *path() const {
|
||||
return GetPointer<const flatbuffers::String *>(10);
|
||||
}
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<xe::debug::proto::XObject>(verifier, 4 /* object */) &&
|
||||
|
@ -68,19 +78,28 @@ struct Module FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
|||
VerifyField<flatbuffers::uoffset_t>(verifier, 8 /* name */) &&
|
||||
verifier.Verify(name()) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 10 /* path */) &&
|
||||
verifier.Verify(path()) &&
|
||||
verifier.EndTable();
|
||||
verifier.Verify(path()) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct ModuleBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_object(const xe::debug::proto::XObject *object) { fbb_.AddStruct(4, object); }
|
||||
void add_type(ModuleType type) { fbb_.AddElement<int8_t>(6, static_cast<int8_t>(type), 0); }
|
||||
void add_name(flatbuffers::Offset<flatbuffers::String> name) { fbb_.AddOffset(8, name); }
|
||||
void add_path(flatbuffers::Offset<flatbuffers::String> path) { fbb_.AddOffset(10, path); }
|
||||
ModuleBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
void add_object(const xe::debug::proto::XObject *object) {
|
||||
fbb_.AddStruct(4, object);
|
||||
}
|
||||
void add_type(ModuleType type) {
|
||||
fbb_.AddElement<int8_t>(6, static_cast<int8_t>(type), 0);
|
||||
}
|
||||
void add_name(flatbuffers::Offset<flatbuffers::String> name) {
|
||||
fbb_.AddOffset(8, name);
|
||||
}
|
||||
void add_path(flatbuffers::Offset<flatbuffers::String> path) {
|
||||
fbb_.AddOffset(10, path);
|
||||
}
|
||||
ModuleBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
ModuleBuilder &operator=(const ModuleBuilder &);
|
||||
flatbuffers::Offset<Module> Finish() {
|
||||
auto o = flatbuffers::Offset<Module>(fbb_.EndTable(start_, 4));
|
||||
|
@ -88,7 +107,8 @@ struct ModuleBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<Module> CreateModule(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
inline flatbuffers::Offset<Module> CreateModule(
|
||||
flatbuffers::FlatBufferBuilder &_fbb,
|
||||
const xe::debug::proto::XObject *object = 0,
|
||||
ModuleType type = ModuleType_Kernel,
|
||||
flatbuffers::Offset<flatbuffers::String> name = 0,
|
||||
|
@ -103,15 +123,16 @@ inline flatbuffers::Offset<Module> CreateModule(flatbuffers::FlatBufferBuilder &
|
|||
|
||||
struct ListModulesRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
verifier.EndTable();
|
||||
return VerifyTableStart(verifier) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct ListModulesRequestBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
ListModulesRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
ListModulesRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
ListModulesRequestBuilder &operator=(const ListModulesRequestBuilder &);
|
||||
flatbuffers::Offset<ListModulesRequest> Finish() {
|
||||
auto o = flatbuffers::Offset<ListModulesRequest>(fbb_.EndTable(start_, 0));
|
||||
|
@ -119,26 +140,35 @@ struct ListModulesRequestBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<ListModulesRequest> CreateListModulesRequest(flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
inline flatbuffers::Offset<ListModulesRequest> CreateListModulesRequest(
|
||||
flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
ListModulesRequestBuilder builder_(_fbb);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct ListModulesResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
const flatbuffers::Vector<const ListModuleEntry *> *entry() const { return GetPointer<const flatbuffers::Vector<const ListModuleEntry *> *>(4); }
|
||||
struct ListModulesResponse FLATBUFFERS_FINAL_CLASS
|
||||
: private flatbuffers::Table {
|
||||
const flatbuffers::Vector<const ListModuleEntry *> *entry() const {
|
||||
return GetPointer<const flatbuffers::Vector<const ListModuleEntry *> *>(4);
|
||||
}
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* entry */) &&
|
||||
verifier.Verify(entry()) &&
|
||||
verifier.EndTable();
|
||||
verifier.Verify(entry()) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct ListModulesResponseBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_entry(flatbuffers::Offset<flatbuffers::Vector<const ListModuleEntry *>> entry) { fbb_.AddOffset(4, entry); }
|
||||
ListModulesResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
void add_entry(
|
||||
flatbuffers::Offset<flatbuffers::Vector<const ListModuleEntry *>> entry) {
|
||||
fbb_.AddOffset(4, entry);
|
||||
}
|
||||
ListModulesResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
ListModulesResponseBuilder &operator=(const ListModulesResponseBuilder &);
|
||||
flatbuffers::Offset<ListModulesResponse> Finish() {
|
||||
auto o = flatbuffers::Offset<ListModulesResponse>(fbb_.EndTable(start_, 1));
|
||||
|
@ -146,8 +176,10 @@ struct ListModulesResponseBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<ListModulesResponse> CreateListModulesResponse(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
flatbuffers::Offset<flatbuffers::Vector<const ListModuleEntry *>> entry = 0) {
|
||||
inline flatbuffers::Offset<ListModulesResponse> CreateListModulesResponse(
|
||||
flatbuffers::FlatBufferBuilder &_fbb,
|
||||
flatbuffers::Offset<flatbuffers::Vector<const ListModuleEntry *>> entry =
|
||||
0) {
|
||||
ListModulesResponseBuilder builder_(_fbb);
|
||||
builder_.add_entry(entry);
|
||||
return builder_.Finish();
|
||||
|
@ -165,8 +197,12 @@ struct GetModuleRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
|||
struct GetModuleRequestBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_module_id(uint32_t module_id) { fbb_.AddElement<uint32_t>(4, module_id, 0); }
|
||||
GetModuleRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
void add_module_id(uint32_t module_id) {
|
||||
fbb_.AddElement<uint32_t>(4, module_id, 0);
|
||||
}
|
||||
GetModuleRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
GetModuleRequestBuilder &operator=(const GetModuleRequestBuilder &);
|
||||
flatbuffers::Offset<GetModuleRequest> Finish() {
|
||||
auto o = flatbuffers::Offset<GetModuleRequest>(fbb_.EndTable(start_, 1));
|
||||
|
@ -174,8 +210,8 @@ struct GetModuleRequestBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<GetModuleRequest> CreateGetModuleRequest(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
uint32_t module_id = 0) {
|
||||
inline flatbuffers::Offset<GetModuleRequest> CreateGetModuleRequest(
|
||||
flatbuffers::FlatBufferBuilder &_fbb, uint32_t module_id = 0) {
|
||||
GetModuleRequestBuilder builder_(_fbb);
|
||||
builder_.add_module_id(module_id);
|
||||
return builder_.Finish();
|
||||
|
@ -186,16 +222,19 @@ struct GetModuleResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
|||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* module */) &&
|
||||
verifier.VerifyTable(module()) &&
|
||||
verifier.EndTable();
|
||||
verifier.VerifyTable(module()) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct GetModuleResponseBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_module(flatbuffers::Offset<Module> module) { fbb_.AddOffset(4, module); }
|
||||
GetModuleResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
void add_module(flatbuffers::Offset<Module> module) {
|
||||
fbb_.AddOffset(4, module);
|
||||
}
|
||||
GetModuleResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
GetModuleResponseBuilder &operator=(const GetModuleResponseBuilder &);
|
||||
flatbuffers::Offset<GetModuleResponse> Finish() {
|
||||
auto o = flatbuffers::Offset<GetModuleResponse>(fbb_.EndTable(start_, 1));
|
||||
|
@ -203,7 +242,8 @@ struct GetModuleResponseBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<GetModuleResponse> CreateGetModuleResponse(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
inline flatbuffers::Offset<GetModuleResponse> CreateGetModuleResponse(
|
||||
flatbuffers::FlatBufferBuilder &_fbb,
|
||||
flatbuffers::Offset<Module> module = 0) {
|
||||
GetModuleResponseBuilder builder_(_fbb);
|
||||
builder_.add_module(module);
|
||||
|
@ -214,26 +254,37 @@ struct FunctionEntry FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
|||
uint64_t identifier() const { return GetField<uint64_t>(4, 0); }
|
||||
uint32_t address_start() const { return GetField<uint32_t>(6, 0); }
|
||||
uint32_t address_end() const { return GetField<uint32_t>(8, 0); }
|
||||
const flatbuffers::String *name() const { return GetPointer<const flatbuffers::String *>(10); }
|
||||
const flatbuffers::String *name() const {
|
||||
return GetPointer<const flatbuffers::String *>(10);
|
||||
}
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<uint64_t>(verifier, 4 /* identifier */) &&
|
||||
VerifyField<uint32_t>(verifier, 6 /* address_start */) &&
|
||||
VerifyField<uint32_t>(verifier, 8 /* address_end */) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 10 /* name */) &&
|
||||
verifier.Verify(name()) &&
|
||||
verifier.EndTable();
|
||||
verifier.Verify(name()) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct FunctionEntryBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_identifier(uint64_t identifier) { fbb_.AddElement<uint64_t>(4, identifier, 0); }
|
||||
void add_address_start(uint32_t address_start) { fbb_.AddElement<uint32_t>(6, address_start, 0); }
|
||||
void add_address_end(uint32_t address_end) { fbb_.AddElement<uint32_t>(8, address_end, 0); }
|
||||
void add_name(flatbuffers::Offset<flatbuffers::String> name) { fbb_.AddOffset(10, name); }
|
||||
FunctionEntryBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
void add_identifier(uint64_t identifier) {
|
||||
fbb_.AddElement<uint64_t>(4, identifier, 0);
|
||||
}
|
||||
void add_address_start(uint32_t address_start) {
|
||||
fbb_.AddElement<uint32_t>(6, address_start, 0);
|
||||
}
|
||||
void add_address_end(uint32_t address_end) {
|
||||
fbb_.AddElement<uint32_t>(8, address_end, 0);
|
||||
}
|
||||
void add_name(flatbuffers::Offset<flatbuffers::String> name) {
|
||||
fbb_.AddOffset(10, name);
|
||||
}
|
||||
FunctionEntryBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
FunctionEntryBuilder &operator=(const FunctionEntryBuilder &);
|
||||
flatbuffers::Offset<FunctionEntry> Finish() {
|
||||
auto o = flatbuffers::Offset<FunctionEntry>(fbb_.EndTable(start_, 4));
|
||||
|
@ -241,10 +292,9 @@ struct FunctionEntryBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<FunctionEntry> CreateFunctionEntry(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
uint64_t identifier = 0,
|
||||
uint32_t address_start = 0,
|
||||
uint32_t address_end = 0,
|
||||
inline flatbuffers::Offset<FunctionEntry> CreateFunctionEntry(
|
||||
flatbuffers::FlatBufferBuilder &_fbb, uint64_t identifier = 0,
|
||||
uint32_t address_start = 0, uint32_t address_end = 0,
|
||||
flatbuffers::Offset<flatbuffers::String> name = 0) {
|
||||
FunctionEntryBuilder builder_(_fbb);
|
||||
builder_.add_identifier(identifier);
|
||||
|
@ -258,11 +308,17 @@ struct Function FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
|||
uint64_t identifier() const { return GetField<uint64_t>(4, 0); }
|
||||
uint32_t address_start() const { return GetField<uint32_t>(6, 0); }
|
||||
uint32_t address_end() const { return GetField<uint32_t>(8, 0); }
|
||||
const flatbuffers::String *name() const { return GetPointer<const flatbuffers::String *>(10); }
|
||||
const flatbuffers::String *name() const {
|
||||
return GetPointer<const flatbuffers::String *>(10);
|
||||
}
|
||||
uint32_t machine_code_start() const { return GetField<uint32_t>(12, 0); }
|
||||
uint32_t machine_code_end() const { return GetField<uint32_t>(14, 0); }
|
||||
const flatbuffers::String *disasm_hir_raw() const { return GetPointer<const flatbuffers::String *>(16); }
|
||||
const flatbuffers::String *disasm_hir_opt() const { return GetPointer<const flatbuffers::String *>(18); }
|
||||
const flatbuffers::String *disasm_hir_raw() const {
|
||||
return GetPointer<const flatbuffers::String *>(16);
|
||||
}
|
||||
const flatbuffers::String *disasm_hir_opt() const {
|
||||
return GetPointer<const flatbuffers::String *>(18);
|
||||
}
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<uint64_t>(verifier, 4 /* identifier */) &&
|
||||
|
@ -272,26 +328,47 @@ struct Function FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
|||
verifier.Verify(name()) &&
|
||||
VerifyField<uint32_t>(verifier, 12 /* machine_code_start */) &&
|
||||
VerifyField<uint32_t>(verifier, 14 /* machine_code_end */) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 16 /* disasm_hir_raw */) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier,
|
||||
16 /* disasm_hir_raw */) &&
|
||||
verifier.Verify(disasm_hir_raw()) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 18 /* disasm_hir_opt */) &&
|
||||
verifier.Verify(disasm_hir_opt()) &&
|
||||
verifier.EndTable();
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier,
|
||||
18 /* disasm_hir_opt */) &&
|
||||
verifier.Verify(disasm_hir_opt()) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct FunctionBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_identifier(uint64_t identifier) { fbb_.AddElement<uint64_t>(4, identifier, 0); }
|
||||
void add_address_start(uint32_t address_start) { fbb_.AddElement<uint32_t>(6, address_start, 0); }
|
||||
void add_address_end(uint32_t address_end) { fbb_.AddElement<uint32_t>(8, address_end, 0); }
|
||||
void add_name(flatbuffers::Offset<flatbuffers::String> name) { fbb_.AddOffset(10, name); }
|
||||
void add_machine_code_start(uint32_t machine_code_start) { fbb_.AddElement<uint32_t>(12, machine_code_start, 0); }
|
||||
void add_machine_code_end(uint32_t machine_code_end) { fbb_.AddElement<uint32_t>(14, machine_code_end, 0); }
|
||||
void add_disasm_hir_raw(flatbuffers::Offset<flatbuffers::String> disasm_hir_raw) { fbb_.AddOffset(16, disasm_hir_raw); }
|
||||
void add_disasm_hir_opt(flatbuffers::Offset<flatbuffers::String> disasm_hir_opt) { fbb_.AddOffset(18, disasm_hir_opt); }
|
||||
FunctionBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
void add_identifier(uint64_t identifier) {
|
||||
fbb_.AddElement<uint64_t>(4, identifier, 0);
|
||||
}
|
||||
void add_address_start(uint32_t address_start) {
|
||||
fbb_.AddElement<uint32_t>(6, address_start, 0);
|
||||
}
|
||||
void add_address_end(uint32_t address_end) {
|
||||
fbb_.AddElement<uint32_t>(8, address_end, 0);
|
||||
}
|
||||
void add_name(flatbuffers::Offset<flatbuffers::String> name) {
|
||||
fbb_.AddOffset(10, name);
|
||||
}
|
||||
void add_machine_code_start(uint32_t machine_code_start) {
|
||||
fbb_.AddElement<uint32_t>(12, machine_code_start, 0);
|
||||
}
|
||||
void add_machine_code_end(uint32_t machine_code_end) {
|
||||
fbb_.AddElement<uint32_t>(14, machine_code_end, 0);
|
||||
}
|
||||
void add_disasm_hir_raw(
|
||||
flatbuffers::Offset<flatbuffers::String> disasm_hir_raw) {
|
||||
fbb_.AddOffset(16, disasm_hir_raw);
|
||||
}
|
||||
void add_disasm_hir_opt(
|
||||
flatbuffers::Offset<flatbuffers::String> disasm_hir_opt) {
|
||||
fbb_.AddOffset(18, disasm_hir_opt);
|
||||
}
|
||||
FunctionBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
FunctionBuilder &operator=(const FunctionBuilder &);
|
||||
flatbuffers::Offset<Function> Finish() {
|
||||
auto o = flatbuffers::Offset<Function>(fbb_.EndTable(start_, 8));
|
||||
|
@ -299,13 +376,11 @@ struct FunctionBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<Function> CreateFunction(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
uint64_t identifier = 0,
|
||||
uint32_t address_start = 0,
|
||||
uint32_t address_end = 0,
|
||||
inline flatbuffers::Offset<Function> CreateFunction(
|
||||
flatbuffers::FlatBufferBuilder &_fbb, uint64_t identifier = 0,
|
||||
uint32_t address_start = 0, uint32_t address_end = 0,
|
||||
flatbuffers::Offset<flatbuffers::String> name = 0,
|
||||
uint32_t machine_code_start = 0,
|
||||
uint32_t machine_code_end = 0,
|
||||
uint32_t machine_code_start = 0, uint32_t machine_code_end = 0,
|
||||
flatbuffers::Offset<flatbuffers::String> disasm_hir_raw = 0,
|
||||
flatbuffers::Offset<flatbuffers::String> disasm_hir_opt = 0) {
|
||||
FunctionBuilder builder_(_fbb);
|
||||
|
@ -320,7 +395,8 @@ inline flatbuffers::Offset<Function> CreateFunction(flatbuffers::FlatBufferBuild
|
|||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct ListFunctionsRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
struct ListFunctionsRequest FLATBUFFERS_FINAL_CLASS
|
||||
: private flatbuffers::Table {
|
||||
uint32_t module_id() const { return GetField<uint32_t>(4, 0); }
|
||||
uint32_t function_index_start() const { return GetField<uint32_t>(6, 0); }
|
||||
uint32_t function_index_end() const { return GetField<uint32_t>(8, 0); }
|
||||
|
@ -336,21 +412,30 @@ struct ListFunctionsRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table
|
|||
struct ListFunctionsRequestBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_module_id(uint32_t module_id) { fbb_.AddElement<uint32_t>(4, module_id, 0); }
|
||||
void add_function_index_start(uint32_t function_index_start) { fbb_.AddElement<uint32_t>(6, function_index_start, 0); }
|
||||
void add_function_index_end(uint32_t function_index_end) { fbb_.AddElement<uint32_t>(8, function_index_end, 0); }
|
||||
ListFunctionsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
void add_module_id(uint32_t module_id) {
|
||||
fbb_.AddElement<uint32_t>(4, module_id, 0);
|
||||
}
|
||||
void add_function_index_start(uint32_t function_index_start) {
|
||||
fbb_.AddElement<uint32_t>(6, function_index_start, 0);
|
||||
}
|
||||
void add_function_index_end(uint32_t function_index_end) {
|
||||
fbb_.AddElement<uint32_t>(8, function_index_end, 0);
|
||||
}
|
||||
ListFunctionsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
ListFunctionsRequestBuilder &operator=(const ListFunctionsRequestBuilder &);
|
||||
flatbuffers::Offset<ListFunctionsRequest> Finish() {
|
||||
auto o = flatbuffers::Offset<ListFunctionsRequest>(fbb_.EndTable(start_, 3));
|
||||
auto o =
|
||||
flatbuffers::Offset<ListFunctionsRequest>(fbb_.EndTable(start_, 3));
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<ListFunctionsRequest> CreateListFunctionsRequest(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
uint32_t module_id = 0,
|
||||
uint32_t function_index_start = 0,
|
||||
uint32_t function_index_end = 0) {
|
||||
inline flatbuffers::Offset<ListFunctionsRequest> CreateListFunctionsRequest(
|
||||
flatbuffers::FlatBufferBuilder &_fbb, uint32_t module_id = 0,
|
||||
uint32_t function_index_start = 0, uint32_t function_index_end = 0) {
|
||||
ListFunctionsRequestBuilder builder_(_fbb);
|
||||
builder_.add_function_index_end(function_index_end);
|
||||
builder_.add_function_index_start(function_index_start);
|
||||
|
@ -358,13 +443,16 @@ inline flatbuffers::Offset<ListFunctionsRequest> CreateListFunctionsRequest(flat
|
|||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct ListFunctionsResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
const flatbuffers::Vector<flatbuffers::Offset<FunctionEntry>> *entry() const { return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<FunctionEntry>> *>(4); }
|
||||
struct ListFunctionsResponse FLATBUFFERS_FINAL_CLASS
|
||||
: private flatbuffers::Table {
|
||||
const flatbuffers::Vector<flatbuffers::Offset<FunctionEntry>> *entry() const {
|
||||
return GetPointer<
|
||||
const flatbuffers::Vector<flatbuffers::Offset<FunctionEntry>> *>(4);
|
||||
}
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* entry */) &&
|
||||
verifier.Verify(entry()) &&
|
||||
verifier.VerifyVectorOfTables(entry()) &&
|
||||
verifier.Verify(entry()) && verifier.VerifyVectorOfTables(entry()) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
@ -372,17 +460,26 @@ struct ListFunctionsResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Tabl
|
|||
struct ListFunctionsResponseBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_entry(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<FunctionEntry>>> entry) { fbb_.AddOffset(4, entry); }
|
||||
ListFunctionsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
void add_entry(flatbuffers::Offset<
|
||||
flatbuffers::Vector<flatbuffers::Offset<FunctionEntry>>> entry) {
|
||||
fbb_.AddOffset(4, entry);
|
||||
}
|
||||
ListFunctionsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
ListFunctionsResponseBuilder &operator=(const ListFunctionsResponseBuilder &);
|
||||
flatbuffers::Offset<ListFunctionsResponse> Finish() {
|
||||
auto o = flatbuffers::Offset<ListFunctionsResponse>(fbb_.EndTable(start_, 1));
|
||||
auto o =
|
||||
flatbuffers::Offset<ListFunctionsResponse>(fbb_.EndTable(start_, 1));
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<ListFunctionsResponse> CreateListFunctionsResponse(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<FunctionEntry>>> entry = 0) {
|
||||
inline flatbuffers::Offset<ListFunctionsResponse> CreateListFunctionsResponse(
|
||||
flatbuffers::FlatBufferBuilder &_fbb,
|
||||
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<FunctionEntry>>>
|
||||
entry = 0) {
|
||||
ListFunctionsResponseBuilder builder_(_fbb);
|
||||
builder_.add_entry(entry);
|
||||
return builder_.Finish();
|
||||
|
@ -400,8 +497,12 @@ struct GetFunctionRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
|||
struct GetFunctionRequestBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_identifier(uint64_t identifier) { fbb_.AddElement<uint64_t>(4, identifier, 0); }
|
||||
GetFunctionRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
void add_identifier(uint64_t identifier) {
|
||||
fbb_.AddElement<uint64_t>(4, identifier, 0);
|
||||
}
|
||||
GetFunctionRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
GetFunctionRequestBuilder &operator=(const GetFunctionRequestBuilder &);
|
||||
flatbuffers::Offset<GetFunctionRequest> Finish() {
|
||||
auto o = flatbuffers::Offset<GetFunctionRequest>(fbb_.EndTable(start_, 1));
|
||||
|
@ -409,28 +510,33 @@ struct GetFunctionRequestBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<GetFunctionRequest> CreateGetFunctionRequest(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
uint64_t identifier = 0) {
|
||||
inline flatbuffers::Offset<GetFunctionRequest> CreateGetFunctionRequest(
|
||||
flatbuffers::FlatBufferBuilder &_fbb, uint64_t identifier = 0) {
|
||||
GetFunctionRequestBuilder builder_(_fbb);
|
||||
builder_.add_identifier(identifier);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct GetFunctionResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
struct GetFunctionResponse FLATBUFFERS_FINAL_CLASS
|
||||
: private flatbuffers::Table {
|
||||
const Function *function() const { return GetPointer<const Function *>(4); }
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* function */) &&
|
||||
verifier.VerifyTable(function()) &&
|
||||
verifier.EndTable();
|
||||
verifier.VerifyTable(function()) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct GetFunctionResponseBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_function(flatbuffers::Offset<Function> function) { fbb_.AddOffset(4, function); }
|
||||
GetFunctionResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
void add_function(flatbuffers::Offset<Function> function) {
|
||||
fbb_.AddOffset(4, function);
|
||||
}
|
||||
GetFunctionResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
GetFunctionResponseBuilder &operator=(const GetFunctionResponseBuilder &);
|
||||
flatbuffers::Offset<GetFunctionResponse> Finish() {
|
||||
auto o = flatbuffers::Offset<GetFunctionResponse>(fbb_.EndTable(start_, 1));
|
||||
|
@ -438,7 +544,8 @@ struct GetFunctionResponseBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<GetFunctionResponse> CreateGetFunctionResponse(flatbuffers::FlatBufferBuilder &_fbb,
|
||||
inline flatbuffers::Offset<GetFunctionResponse> CreateGetFunctionResponse(
|
||||
flatbuffers::FlatBufferBuilder &_fbb,
|
||||
flatbuffers::Offset<Function> function = 0) {
|
||||
GetFunctionResponseBuilder builder_(_fbb);
|
||||
builder_.add_function(function);
|
||||
|
|
|
@ -21,21 +21,24 @@ struct Thread;
|
|||
struct ListThreadsRequest;
|
||||
struct ListThreadsResponse;
|
||||
|
||||
enum ThreadType {
|
||||
ThreadType_Kernel = 0,
|
||||
ThreadType_User = 1
|
||||
};
|
||||
enum ThreadType { ThreadType_Kernel = 0, ThreadType_User = 1 };
|
||||
|
||||
inline const char **EnumNamesThreadType() {
|
||||
static const char *names[] = { "Kernel", "User", nullptr };
|
||||
static const char *names[] = {"Kernel", "User", nullptr};
|
||||
return names;
|
||||
}
|
||||
|
||||
inline const char *EnumNameThreadType(ThreadType e) { return EnumNamesThreadType()[e]; }
|
||||
inline const char *EnumNameThreadType(ThreadType e) {
|
||||
return EnumNamesThreadType()[e];
|
||||
}
|
||||
|
||||
struct Thread FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
const xe::debug::proto::XObject *object() const { return GetStruct<const xe::debug::proto::XObject *>(4); }
|
||||
ThreadType type() const { return static_cast<ThreadType>(GetField<int8_t>(6, 0)); }
|
||||
const xe::debug::proto::XObject *object() const {
|
||||
return GetStruct<const xe::debug::proto::XObject *>(4);
|
||||
}
|
||||
ThreadType type() const {
|
||||
return static_cast<ThreadType>(GetField<int8_t>(6, 0));
|
||||
}
|
||||
uint32_t stack_size() const { return GetField<uint32_t>(8, 0); }
|
||||
uint32_t xapi_thread_startup() const { return GetField<uint32_t>(10, 0); }
|
||||
uint32_t start_address() const { return GetField<uint32_t>(12, 0); }
|
||||
|
@ -76,8 +79,12 @@ struct Thread FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
|||
struct ThreadBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_object(const xe::debug::proto::XObject *object) { fbb_.AddStruct(4, object); }
|
||||
void add_type(ThreadType type) { fbb_.AddElement<int8_t>(6, static_cast<int8_t>(type), 0); }
|
||||
void add_object(const xe::debug::proto::XObject *object) {
|
||||
fbb_.AddStruct(4, object);
|
||||
}
|
||||
void add_type(ThreadType type) {
|
||||
fbb_.AddElement<int8_t>(6, static_cast<int8_t>(type), 0);
|
||||
}
|
||||
void add_stack_size(uint32_t stack_size) {
|
||||
fbb_.AddElement<uint32_t>(8, stack_size, 0);
|
||||
}
|
||||
|
@ -115,7 +122,9 @@ struct ThreadBuilder {
|
|||
fbb_.AddElement<uint32_t>(30, affinity, 0);
|
||||
}
|
||||
void add_state(uint32_t state) { fbb_.AddElement<uint32_t>(32, state, 0); }
|
||||
ThreadBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
ThreadBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
ThreadBuilder &operator=(const ThreadBuilder &);
|
||||
flatbuffers::Offset<Thread> Finish() {
|
||||
auto o = flatbuffers::Offset<Thread>(fbb_.EndTable(start_, 15));
|
||||
|
@ -154,15 +163,16 @@ inline flatbuffers::Offset<Thread> CreateThread(
|
|||
|
||||
struct ListThreadsRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
verifier.EndTable();
|
||||
return VerifyTableStart(verifier) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct ListThreadsRequestBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
ListThreadsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
ListThreadsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
ListThreadsRequestBuilder &operator=(const ListThreadsRequestBuilder &);
|
||||
flatbuffers::Offset<ListThreadsRequest> Finish() {
|
||||
auto o = flatbuffers::Offset<ListThreadsRequest>(fbb_.EndTable(start_, 0));
|
||||
|
@ -170,12 +180,14 @@ struct ListThreadsRequestBuilder {
|
|||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<ListThreadsRequest> CreateListThreadsRequest(flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
inline flatbuffers::Offset<ListThreadsRequest> CreateListThreadsRequest(
|
||||
flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
ListThreadsRequestBuilder builder_(_fbb);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct ListThreadsResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
struct ListThreadsResponse FLATBUFFERS_FINAL_CLASS
|
||||
: private flatbuffers::Table {
|
||||
const flatbuffers::Vector<flatbuffers::Offset<Thread>> *thread() const {
|
||||
return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<Thread>> *>(
|
||||
4);
|
||||
|
@ -195,7 +207,10 @@ struct ListThreadsResponseBuilder {
|
|||
flatbuffers::Vector<flatbuffers::Offset<Thread>>> thread) {
|
||||
fbb_.AddOffset(4, thread);
|
||||
}
|
||||
ListThreadsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
ListThreadsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
ListThreadsResponseBuilder &operator=(const ListThreadsResponseBuilder &);
|
||||
flatbuffers::Offset<ListThreadsResponse> Finish() {
|
||||
auto o = flatbuffers::Offset<ListThreadsResponse>(fbb_.EndTable(start_, 1));
|
||||
|
|
|
@ -2881,10 +2881,10 @@ bool CommandProcessor::IssueCopy() {
|
|||
/* glClearNamedFramebufferfi(source_framebuffer->framebuffer,
|
||||
GL_DEPTH_STENCIL,
|
||||
depth, stencil);*/
|
||||
glClearNamedFramebufferfv(source_framebuffer->framebuffer, GL_DEPTH,
|
||||
0, &depth);
|
||||
glClearNamedFramebufferiv(source_framebuffer->framebuffer, GL_STENCIL,
|
||||
0, &stencil);
|
||||
glClearNamedFramebufferfv(source_framebuffer->framebuffer, GL_DEPTH, 0,
|
||||
&depth);
|
||||
glClearNamedFramebufferiv(source_framebuffer->framebuffer, GL_STENCIL, 0,
|
||||
&stencil);
|
||||
glDepthMask(old_depth_mask);
|
||||
glStencilMask(old_stencil_mask);
|
||||
}
|
||||
|
|
|
@ -209,7 +209,8 @@ void GL4ShaderTranslator::AppendSrcReg(const instr_alu_t& op, uint32_t num,
|
|||
}
|
||||
Append("state.float_consts[");
|
||||
#if FLOW_CONTROL
|
||||
// NOTE(dariosamo): Some games don't seem to take into account the relative a0
|
||||
// NOTE(dariosamo): Some games don't seem to take into account the relative
|
||||
// a0
|
||||
// offset even when they should due to const_slot being a different value.
|
||||
if (op.const_0_rel_abs || op.const_1_rel_abs) {
|
||||
#else
|
||||
|
@ -1528,21 +1529,21 @@ static const struct {
|
|||
} cf_instructions[] = {
|
||||
#define INSTR(opc, fxn) \
|
||||
{ #opc }
|
||||
INSTR(NOP, print_cf_nop),
|
||||
INSTR(EXEC, print_cf_exec),
|
||||
INSTR(EXEC_END, print_cf_exec),
|
||||
INSTR(COND_EXEC, print_cf_exec),
|
||||
INSTR(COND_EXEC_END, print_cf_exec),
|
||||
INSTR(COND_PRED_EXEC, print_cf_exec),
|
||||
INSTR(COND_PRED_EXEC_END, print_cf_exec),
|
||||
INSTR(LOOP_START, print_cf_loop),
|
||||
INSTR(LOOP_END, print_cf_loop),
|
||||
INSTR(COND_CALL, print_cf_jmp_call),
|
||||
INSTR(RETURN, print_cf_jmp_call),
|
||||
INSTR(COND_JMP, print_cf_jmp_call),
|
||||
INSTR(ALLOC, print_cf_alloc),
|
||||
INSTR(COND_EXEC_PRED_CLEAN, print_cf_exec),
|
||||
INSTR(COND_EXEC_PRED_CLEAN_END, print_cf_exec),
|
||||
INSTR(NOP, print_cf_nop), //
|
||||
INSTR(EXEC, print_cf_exec), //
|
||||
INSTR(EXEC_END, print_cf_exec), //
|
||||
INSTR(COND_EXEC, print_cf_exec), //
|
||||
INSTR(COND_EXEC_END, print_cf_exec), //
|
||||
INSTR(COND_PRED_EXEC, print_cf_exec), //
|
||||
INSTR(COND_PRED_EXEC_END, print_cf_exec), //
|
||||
INSTR(LOOP_START, print_cf_loop), //
|
||||
INSTR(LOOP_END, print_cf_loop), //
|
||||
INSTR(COND_CALL, print_cf_jmp_call), //
|
||||
INSTR(RETURN, print_cf_jmp_call), //
|
||||
INSTR(COND_JMP, print_cf_jmp_call), //
|
||||
INSTR(ALLOC, print_cf_alloc), //
|
||||
INSTR(COND_EXEC_PRED_CLEAN, print_cf_exec), //
|
||||
INSTR(COND_EXEC_PRED_CLEAN_END, print_cf_exec), //
|
||||
INSTR(MARK_VS_FETCH_DONE, print_cf_nop), // ??
|
||||
#undef INSTR
|
||||
};
|
||||
|
@ -1699,7 +1700,8 @@ bool GL4ShaderTranslator::TranslateLoopEnd(const ucode::instr_cf_loop_t& cf) {
|
|||
Append(" // %s", cf_instructions[cf.opc].name);
|
||||
Append(" ADDR(0x%x) LOOP ID(%d)\n", cf.address, cf.loop_id);
|
||||
Append(" i%d_cnt = i%d_cnt + 1;\n", cf.loop_id, cf.loop_id);
|
||||
Append(" pc = (i%d_cnt < state.loop_consts[%d]) ? i%d_addr : pc;\n", cf.loop_id, cf.loop_id, cf.loop_id);
|
||||
Append(" pc = (i%d_cnt < state.loop_consts[%d]) ? i%d_addr : pc;\n",
|
||||
cf.loop_id, cf.loop_id, cf.loop_id);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -97,6 +97,7 @@ bool GLContext::Initialize(HWND hwnd) {
|
|||
#if DEBUG
|
||||
context_flags |= WGL_CONTEXT_DEBUG_BIT_ARB;
|
||||
#endif // DEBUG
|
||||
|
||||
int attrib_list[] = {WGL_CONTEXT_MAJOR_VERSION_ARB, 4, //
|
||||
WGL_CONTEXT_MINOR_VERSION_ARB, 5, //
|
||||
WGL_CONTEXT_FLAGS_ARB, context_flags, //
|
||||
|
@ -152,6 +153,7 @@ std::unique_ptr<GLContext> GLContext::CreateShared() {
|
|||
#if DEBUG
|
||||
context_flags |= WGL_CONTEXT_DEBUG_BIT_ARB;
|
||||
#endif // DEBUG
|
||||
|
||||
int attrib_list[] = {WGL_CONTEXT_MAJOR_VERSION_ARB, 4, //
|
||||
WGL_CONTEXT_MINOR_VERSION_ARB, 5, //
|
||||
WGL_CONTEXT_FLAGS_ARB, context_flags, //
|
||||
|
@ -280,7 +282,7 @@ void GLContext::DebugMessage(GLenum source, GLenum type, GLuint id,
|
|||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
GLContext::DebugMessageThunk(GLenum source, GLenum type, GLuint id,
|
||||
GLContext::DebugMessageThunk(GLenum source, GLenum type, GLuint id,
|
||||
GLenum severity, GLsizei length,
|
||||
const GLchar* message, GLvoid* user_param) {
|
||||
reinterpret_cast<GLContext*>(user_param)
|
||||
|
|
|
@ -44,8 +44,7 @@ class GLContext {
|
|||
GLsizei length, const GLchar* message);
|
||||
static void GLAPIENTRY
|
||||
DebugMessageThunk(GLenum source, GLenum type, GLuint id, GLenum severity,
|
||||
GLsizei length, const GLchar* message,
|
||||
GLvoid* user_param);
|
||||
GLsizei length, const GLchar* message, GLvoid* user_param);
|
||||
|
||||
HWND hwnd_;
|
||||
HDC dc_;
|
||||
|
|
|
@ -666,14 +666,21 @@ struct {
|
|||
} cf_instructions[] = {
|
||||
#define INSTR(opc, fxn) \
|
||||
{ #opc, fxn }
|
||||
INSTR(NOP, print_cf_nop), INSTR(EXEC, print_cf_exec),
|
||||
INSTR(EXEC_END, print_cf_exec), INSTR(COND_EXEC, print_cf_exec),
|
||||
INSTR(COND_EXEC_END, print_cf_exec), INSTR(COND_PRED_EXEC, print_cf_exec),
|
||||
INSTR(COND_PRED_EXEC_END, print_cf_exec), INSTR(LOOP_START, print_cf_loop),
|
||||
INSTR(LOOP_END, print_cf_loop), INSTR(COND_CALL, print_cf_jmp_call),
|
||||
INSTR(RETURN, print_cf_jmp_call), INSTR(COND_JMP, print_cf_jmp_call),
|
||||
INSTR(ALLOC, print_cf_alloc), INSTR(COND_EXEC_PRED_CLEAN, print_cf_exec),
|
||||
INSTR(COND_EXEC_PRED_CLEAN_END, print_cf_exec),
|
||||
INSTR(NOP, print_cf_nop), //
|
||||
INSTR(EXEC, print_cf_exec), //
|
||||
INSTR(EXEC_END, print_cf_exec), //
|
||||
INSTR(COND_EXEC, print_cf_exec), //
|
||||
INSTR(COND_EXEC_END, print_cf_exec), //
|
||||
INSTR(COND_PRED_EXEC, print_cf_exec), //
|
||||
INSTR(COND_PRED_EXEC_END, print_cf_exec), //
|
||||
INSTR(LOOP_START, print_cf_loop), //
|
||||
INSTR(LOOP_END, print_cf_loop), //
|
||||
INSTR(COND_CALL, print_cf_jmp_call), //
|
||||
INSTR(RETURN, print_cf_jmp_call), //
|
||||
INSTR(COND_JMP, print_cf_jmp_call), //
|
||||
INSTR(ALLOC, print_cf_alloc), //
|
||||
INSTR(COND_EXEC_PRED_CLEAN, print_cf_exec), //
|
||||
INSTR(COND_EXEC_PRED_CLEAN_END, print_cf_exec), //
|
||||
INSTR(MARK_VS_FETCH_DONE, print_cf_nop), // ??
|
||||
#undef INSTR
|
||||
};
|
||||
|
|
|
@ -1072,7 +1072,8 @@ void DrawShaderUI(xe::ui::MainWindow* window, TracePlayer& player,
|
|||
// glBlendFuncSeparatei(i, src_blend, dest_blend, src_blend_alpha,
|
||||
// dest_blend_alpha);
|
||||
void DrawBlendMode(uint32_t src_blend, uint32_t dest_blend, uint32_t blend_op) {
|
||||
static const char* kBlendNames[] = {/* 0 */ "ZERO",
|
||||
static const char* kBlendNames[] = {
|
||||
/* 0 */ "ZERO",
|
||||
/* 1 */ "ONE",
|
||||
/* 2 */ "UNK2", // ?
|
||||
/* 3 */ "UNK3", // ?
|
||||
|
@ -2406,7 +2407,7 @@ void ImImpl_Setup() {
|
|||
pixels);
|
||||
|
||||
// Store our identifier
|
||||
io.Fonts->TexID = (void*)(intptr_t) tex_id;
|
||||
io.Fonts->TexID = (void*)(intptr_t)tex_id;
|
||||
|
||||
io.DeltaTime = 1.0f / 60.0f;
|
||||
io.RenderDrawListsFn = ImImpl_RenderDrawLists;
|
||||
|
@ -2548,7 +2549,7 @@ void ImImpl_RenderDrawLists(ImDrawList** const cmd_lists, int cmd_lists_count) {
|
|||
for (const ImDrawCmd* pcmd = cmd_list->commands.begin(); pcmd != pcmd_end;
|
||||
pcmd++) {
|
||||
if (pcmd->texture_id != prev_texture_id) {
|
||||
glBindTexture(GL_TEXTURE_2D, (GLuint)(intptr_t) pcmd->texture_id);
|
||||
glBindTexture(GL_TEXTURE_2D, (GLuint)(intptr_t)pcmd->texture_id);
|
||||
prev_texture_id = pcmd->texture_id;
|
||||
}
|
||||
glScissor((int)pcmd->clip_rect.x, (int)(height - pcmd->clip_rect.w),
|
||||
|
|
|
@ -266,9 +266,9 @@ inline uint32_t CpuToGpu(uint32_t p) { return p & 0x1FFFFFFF; }
|
|||
typedef union {
|
||||
XEPACKEDSTRUCTANONYMOUS({
|
||||
uint32_t vs_regs : 6;
|
||||
uint32_t : 2;
|
||||
uint32_t unk_0 : 2;
|
||||
uint32_t ps_regs : 6;
|
||||
uint32_t : 2;
|
||||
uint32_t unk_1 : 2;
|
||||
uint32_t vs_resource : 1;
|
||||
uint32_t ps_resource : 1;
|
||||
uint32_t param_gen : 1;
|
||||
|
@ -279,9 +279,7 @@ typedef union {
|
|||
uint32_t ps_export_count : 3;
|
||||
uint32_t gen_index_vtx : 1;
|
||||
});
|
||||
XEPACKEDSTRUCTANONYMOUS({
|
||||
uint32_t dword_0;
|
||||
});
|
||||
XEPACKEDSTRUCTANONYMOUS({ uint32_t dword_0; });
|
||||
} xe_gpu_program_cntl_t;
|
||||
|
||||
// XE_GPU_REG_SHADER_CONSTANT_FETCH_*
|
||||
|
@ -382,20 +380,21 @@ XEPACKEDUNION(xe_gpu_fetch_group_t, {
|
|||
});
|
||||
XEPACKEDSTRUCTANONYMOUS({
|
||||
uint32_t type_0 : 2;
|
||||
uint32_t : 30;
|
||||
uint32_t : 32;
|
||||
uint32_t data_0_a : 30;
|
||||
uint32_t data_0_b : 32;
|
||||
uint32_t type_1 : 2;
|
||||
uint32_t : 30;
|
||||
uint32_t : 32;
|
||||
uint32_t data_1_a : 30;
|
||||
uint32_t data_1_b : 32;
|
||||
uint32_t type_2 : 2;
|
||||
uint32_t : 30;
|
||||
uint32_t : 32;
|
||||
uint32_t data_2_a : 30;
|
||||
uint32_t data_2_b : 32;
|
||||
});
|
||||
});
|
||||
|
||||
// Opcodes (IT_OPCODE) for Type-3 commands in the ringbuffer.
|
||||
// https://github.com/freedreno/amd-gpu/blob/master/include/api/gsl_pm4types.h
|
||||
// Not sure if all of these are used.
|
||||
// clang-format off
|
||||
enum Type3Opcode {
|
||||
PM4_ME_INIT = 0x48, // initialize CP's micro-engine
|
||||
|
||||
|
@ -459,16 +458,18 @@ enum Type3Opcode {
|
|||
PM4_SET_BIN_SELECT_LO = 0x62,
|
||||
PM4_SET_BIN_SELECT_HI = 0x63,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
template<uint16_t index, uint16_t count, bool one_reg = false>
|
||||
template <uint16_t index, uint16_t count, bool one_reg = false>
|
||||
constexpr inline uint32_t MakePacketType0() {
|
||||
// ttcccccc cccccccc oiiiiiii iiiiiiii
|
||||
static_assert(index <= 0x7FFF, "index must be <= 0x7FFF");
|
||||
static_assert(count >= 1 && count <= 0x4000, "count must be >= 1 and <= 0x4000");
|
||||
static_assert(count >= 1 && count <= 0x4000,
|
||||
"count must be >= 1 and <= 0x4000");
|
||||
return (0u << 30) | (((count - 1) & 0x3FFF) << 16) | (index & 0x7FFF);
|
||||
}
|
||||
|
||||
template<uint16_t index_1, uint16_t index_2>
|
||||
template <uint16_t index_1, uint16_t index_2>
|
||||
constexpr inline uint32_t MakePacketType1() {
|
||||
// tt?????? ??222222 22222111 11111111
|
||||
static_assert(index_1 <= 0x7FF, "index_1 must be <= 0x7FF");
|
||||
|
@ -481,12 +482,14 @@ constexpr inline uint32_t MakePacketType2() {
|
|||
return (2u << 30);
|
||||
}
|
||||
|
||||
template<Type3Opcode opcode, uint16_t count, bool predicate = false>
|
||||
template <Type3Opcode opcode, uint16_t count, bool predicate = false>
|
||||
constexpr inline uint32_t MakePacketType3() {
|
||||
// ttcccccc cccccccc ?ooooooo ???????p
|
||||
static_assert(opcode <= 0x7F, "opcode must be <= 0x7F");
|
||||
static_assert(count >= 1 && count <= 0x4000, "count must be >= 1 and <= 0x4000");
|
||||
return (3u << 30) | (((count - 1) & 0x3FFF) << 16) | ((opcode & 0x7F) << 8) | (predicate ? 1 : 0);
|
||||
static_assert(count >= 1 && count <= 0x4000,
|
||||
"count must be >= 1 and <= 0x4000");
|
||||
return (3u << 30) | (((count - 1) & 0x3FFF) << 16) | ((opcode & 0x7F) << 8) |
|
||||
(predicate ? 1 : 0);
|
||||
}
|
||||
|
||||
} // namespace xenos
|
||||
|
|
|
@ -20,7 +20,8 @@ Device::Device(const std::string& path) : path_(path) {}
|
|||
Device::~Device() = default;
|
||||
|
||||
// TODO(gibbed): make virtual + move implementation into HostPathDevice/etc.
|
||||
X_STATUS Device::QueryVolumeInfo(X_FILE_FS_VOLUME_INFORMATION* out_info, size_t length) {
|
||||
X_STATUS Device::QueryVolumeInfo(X_FILE_FS_VOLUME_INFORMATION* out_info,
|
||||
size_t length) {
|
||||
assert_not_null(out_info);
|
||||
const char* name = "test"; // TODO(gibbed): actual value
|
||||
|
||||
|
@ -39,7 +40,8 @@ X_STATUS Device::QueryVolumeInfo(X_FILE_FS_VOLUME_INFORMATION* out_info, size_t
|
|||
}
|
||||
|
||||
// TODO(gibbed): make virtual + move implementation into HostPathDevice/etc.
|
||||
X_STATUS Device::QuerySizeInfo(X_FILE_FS_SIZE_INFORMATION* out_info, size_t length) {
|
||||
X_STATUS Device::QuerySizeInfo(X_FILE_FS_SIZE_INFORMATION* out_info,
|
||||
size_t length) {
|
||||
assert_not_null(out_info);
|
||||
out_info->total_allocation_units = 1234; // TODO(gibbed): actual value
|
||||
out_info->available_allocation_units = 0; // TODO(gibbed): actual value
|
||||
|
@ -49,7 +51,8 @@ X_STATUS Device::QuerySizeInfo(X_FILE_FS_SIZE_INFORMATION* out_info, size_t leng
|
|||
}
|
||||
|
||||
// TODO(gibbed): make virtual + move implementation into HostPathDevice/etc.
|
||||
X_STATUS Device::QueryAttributeInfo(X_FILE_FS_ATTRIBUTE_INFORMATION* out_info, size_t length) {
|
||||
X_STATUS Device::QueryAttributeInfo(X_FILE_FS_ATTRIBUTE_INFORMATION* out_info,
|
||||
size_t length) {
|
||||
assert_not_null(out_info);
|
||||
const char* name = "test"; // TODO(gibbed): actual value
|
||||
|
||||
|
|
|
@ -30,9 +30,12 @@ class Device {
|
|||
|
||||
virtual std::unique_ptr<Entry> ResolvePath(const char* path) = 0;
|
||||
|
||||
virtual X_STATUS QueryVolumeInfo(X_FILE_FS_VOLUME_INFORMATION* out_info, size_t length);
|
||||
virtual X_STATUS QuerySizeInfo(X_FILE_FS_SIZE_INFORMATION* out_info, size_t length);
|
||||
virtual X_STATUS QueryAttributeInfo(X_FILE_FS_ATTRIBUTE_INFORMATION* out_info, size_t length);
|
||||
virtual X_STATUS QueryVolumeInfo(X_FILE_FS_VOLUME_INFORMATION* out_info,
|
||||
size_t length);
|
||||
virtual X_STATUS QuerySizeInfo(X_FILE_FS_SIZE_INFORMATION* out_info,
|
||||
size_t length);
|
||||
virtual X_STATUS QueryAttributeInfo(X_FILE_FS_ATTRIBUTE_INFORMATION* out_info,
|
||||
size_t length);
|
||||
|
||||
protected:
|
||||
std::string path_;
|
||||
|
|
|
@ -47,8 +47,9 @@ X_STATUS DiscImageEntry::QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) {
|
|||
return X_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
X_STATUS DiscImageEntry::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||
const char* file_name, bool restart) {
|
||||
X_STATUS DiscImageEntry::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info,
|
||||
size_t length, const char* file_name,
|
||||
bool restart) {
|
||||
assert_not_null(out_info);
|
||||
|
||||
GDFXEntry* entry(nullptr);
|
||||
|
|
|
@ -35,8 +35,9 @@ X_STATUS DiscImageFile::QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) {
|
|||
return entry_->QueryInfo(out_info);
|
||||
}
|
||||
|
||||
X_STATUS DiscImageFile::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||
const char* file_name, bool restart) {
|
||||
X_STATUS DiscImageFile::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info,
|
||||
size_t length, const char* file_name,
|
||||
bool restart) {
|
||||
return entry_->QueryDirectory(out_info, length, file_name, restart);
|
||||
}
|
||||
|
||||
|
|
|
@ -61,8 +61,9 @@ X_STATUS HostPathEntry::QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) {
|
|||
return X_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
X_STATUS HostPathEntry::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||
const char* file_name, bool restart) {
|
||||
X_STATUS HostPathEntry::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info,
|
||||
size_t length, const char* file_name,
|
||||
bool restart) {
|
||||
assert_not_null(out_info);
|
||||
|
||||
WIN32_FIND_DATA ffd;
|
||||
|
|
|
@ -35,8 +35,9 @@ X_STATUS HostPathFile::QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) {
|
|||
return entry_->QueryInfo(out_info);
|
||||
}
|
||||
|
||||
X_STATUS HostPathFile::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||
const char* file_name, bool restart) {
|
||||
X_STATUS HostPathFile::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info,
|
||||
size_t length, const char* file_name,
|
||||
bool restart) {
|
||||
return entry_->QueryDirectory(out_info, length, file_name, restart);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,8 @@ STFSContainerEntry::STFSContainerEntry(Device* device, const char* path,
|
|||
|
||||
STFSContainerEntry::~STFSContainerEntry() = default;
|
||||
|
||||
X_STATUS STFSContainerEntry::QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) {
|
||||
X_STATUS STFSContainerEntry::QueryInfo(
|
||||
X_FILE_NETWORK_OPEN_INFORMATION* out_info) {
|
||||
assert_not_null(out_info);
|
||||
out_info->creation_time = stfs_entry_->update_timestamp;
|
||||
out_info->last_access_time = stfs_entry_->access_timestamp;
|
||||
|
@ -38,10 +39,9 @@ X_STATUS STFSContainerEntry::QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info
|
|||
return X_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
X_STATUS STFSContainerEntry::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info,
|
||||
size_t length,
|
||||
const char* file_name,
|
||||
bool restart) {
|
||||
X_STATUS STFSContainerEntry::QueryDirectory(
|
||||
X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||
const char* file_name, bool restart) {
|
||||
assert_not_null(out_info);
|
||||
|
||||
STFSEntry* entry(nullptr);
|
||||
|
|
|
@ -31,13 +31,14 @@ const std::string& STFSContainerFile::name() const { return entry_->name(); }
|
|||
|
||||
Device* STFSContainerFile::device() const { return entry_->device(); }
|
||||
|
||||
X_STATUS STFSContainerFile::QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) {
|
||||
X_STATUS STFSContainerFile::QueryInfo(
|
||||
X_FILE_NETWORK_OPEN_INFORMATION* out_info) {
|
||||
return entry_->QueryInfo(out_info);
|
||||
}
|
||||
|
||||
X_STATUS STFSContainerFile::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info,
|
||||
size_t length, const char* file_name,
|
||||
bool restart) {
|
||||
X_STATUS STFSContainerFile::QueryDirectory(
|
||||
X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||
const char* file_name, bool restart) {
|
||||
return entry_->QueryDirectory(out_info, length, file_name, restart);
|
||||
}
|
||||
|
||||
|
|
|
@ -65,8 +65,9 @@ class Entry {
|
|||
bool is_read_only() const;
|
||||
|
||||
virtual X_STATUS QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) = 0;
|
||||
virtual X_STATUS QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||
const char* file_name, bool restart) = 0;
|
||||
virtual X_STATUS QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info,
|
||||
size_t length, const char* file_name,
|
||||
bool restart) = 0;
|
||||
|
||||
virtual bool can_map() { return false; }
|
||||
|
||||
|
|
|
@ -187,7 +187,8 @@ std::unique_ptr<Entry> FileSystem::ResolvePath(const std::string& path) {
|
|||
}
|
||||
}
|
||||
|
||||
XELOGE("ResolvePath(%s) failed - device not found (%s)", path.c_str(), device_path.c_str());
|
||||
XELOGE("ResolvePath(%s) failed - device not found (%s)", path.c_str(),
|
||||
device_path.c_str());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,13 +20,13 @@ namespace kernel {
|
|||
namespace fs {
|
||||
|
||||
#define XEGETUINT24BE(p) \
|
||||
(((uint32_t)xe::load_and_swap<uint8_t>((p)+0) << 16) | \
|
||||
((uint32_t)xe::load_and_swap<uint8_t>((p)+1) << 8) | \
|
||||
(uint32_t)xe::load_and_swap<uint8_t>((p)+2))
|
||||
(((uint32_t)xe::load_and_swap<uint8_t>((p) + 0) << 16) | \
|
||||
((uint32_t)xe::load_and_swap<uint8_t>((p) + 1) << 8) | \
|
||||
(uint32_t)xe::load_and_swap<uint8_t>((p) + 2))
|
||||
#define XEGETUINT24LE(p) \
|
||||
(((uint32_t)xe::load<uint8_t>((p)+2) << 16) | \
|
||||
((uint32_t)xe::load<uint8_t>((p)+1) << 8) | \
|
||||
(uint32_t)xe::load<uint8_t>((p)+0))
|
||||
(((uint32_t)xe::load<uint8_t>((p) + 2) << 16) | \
|
||||
((uint32_t)xe::load<uint8_t>((p) + 1) << 8) | \
|
||||
(uint32_t)xe::load<uint8_t>((p) + 0))
|
||||
|
||||
bool STFSVolumeDescriptor::Read(const uint8_t* p) {
|
||||
descriptor_size = xe::load_and_swap<uint8_t>(p + 0x00);
|
||||
|
|
|
@ -145,8 +145,9 @@ class XFile : public XObject {
|
|||
void set_position(size_t value) { position_ = value; }
|
||||
|
||||
virtual X_STATUS QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) = 0;
|
||||
virtual X_STATUS QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||
const char* file_name, bool restart) = 0;
|
||||
virtual X_STATUS QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info,
|
||||
size_t length, const char* file_name,
|
||||
bool restart) = 0;
|
||||
|
||||
X_STATUS Read(void* buffer, size_t buffer_length, size_t byte_offset,
|
||||
size_t* out_bytes_read);
|
||||
|
|
|
@ -169,7 +169,8 @@ X_STATUS XThread::Create() {
|
|||
uint32_t tls_extended_size = 0;
|
||||
if (module && module->xex_header()) {
|
||||
const xe_xex2_header_t* header = module->xex_header();
|
||||
tls_slots = header->tls_info.slot_count ? header->tls_info.slot_count : kDefaultTlsSlotCount;
|
||||
tls_slots = header->tls_info.slot_count ? header->tls_info.slot_count
|
||||
: kDefaultTlsSlotCount;
|
||||
tls_extended_size = header->tls_info.data_size;
|
||||
} else {
|
||||
tls_slots = kDefaultTlsSlotCount;
|
||||
|
@ -193,8 +194,7 @@ X_STATUS XThread::Create() {
|
|||
// If game has extended data, copy in the default values.
|
||||
const xe_xex2_header_t* header = module->xex_header();
|
||||
assert_not_zero(header->tls_info.raw_data_address);
|
||||
memory()->Copy(tls_address_,
|
||||
header->tls_info.raw_data_address,
|
||||
memory()->Copy(tls_address_, header->tls_info.raw_data_address,
|
||||
header->tls_info.raw_data_size);
|
||||
}
|
||||
|
||||
|
@ -374,10 +374,9 @@ X_STATUS XThread::PlatformCreate() {
|
|||
Retain();
|
||||
bool suspended = creation_params_.creation_flags & 0x1;
|
||||
const size_t kStackSize = 16 * 1024 * 1024; // let's do the stupid thing
|
||||
thread_handle_ =
|
||||
CreateThread(NULL, kStackSize,
|
||||
(LPTHREAD_START_ROUTINE)XThreadStartCallbackWin32,
|
||||
this, suspended ? CREATE_SUSPENDED : 0, NULL);
|
||||
thread_handle_ = CreateThread(
|
||||
NULL, kStackSize, (LPTHREAD_START_ROUTINE)XThreadStartCallbackWin32, this,
|
||||
suspended ? CREATE_SUSPENDED : 0, NULL);
|
||||
if (!thread_handle_) {
|
||||
uint32_t last_error = GetLastError();
|
||||
// TODO(benvanik): translate?
|
||||
|
|
|
@ -66,9 +66,10 @@ class UserProfile {
|
|||
Int32Setting(uint32_t setting_id, int32_t value)
|
||||
: Setting(setting_id, Type::INT32, 4), value(value) {}
|
||||
int32_t value;
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer,
|
||||
uint32_t buffer_ptr, size_t buffer_offset) override {
|
||||
buffer_offset = Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer, uint32_t buffer_ptr,
|
||||
size_t buffer_offset) override {
|
||||
buffer_offset =
|
||||
Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
xe::store_and_swap<int32_t>(user_data + kValueOffset, value);
|
||||
return buffer_offset;
|
||||
}
|
||||
|
@ -77,9 +78,10 @@ class UserProfile {
|
|||
Int64Setting(uint32_t setting_id, int64_t value)
|
||||
: Setting(setting_id, Type::INT64, 8), value(value) {}
|
||||
int64_t value;
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer,
|
||||
uint32_t buffer_ptr, size_t buffer_offset) override {
|
||||
buffer_offset = Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer, uint32_t buffer_ptr,
|
||||
size_t buffer_offset) override {
|
||||
buffer_offset =
|
||||
Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
xe::store_and_swap<int64_t>(user_data + kValueOffset, value);
|
||||
return buffer_offset;
|
||||
}
|
||||
|
@ -88,9 +90,10 @@ class UserProfile {
|
|||
DoubleSetting(uint32_t setting_id, double value)
|
||||
: Setting(setting_id, Type::DOUBLE, 8), value(value) {}
|
||||
double value;
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer,
|
||||
uint32_t buffer_ptr, size_t buffer_offset) override {
|
||||
buffer_offset = Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer, uint32_t buffer_ptr,
|
||||
size_t buffer_offset) override {
|
||||
buffer_offset =
|
||||
Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
xe::store_and_swap<double>(user_data + kValueOffset, value);
|
||||
return buffer_offset;
|
||||
}
|
||||
|
@ -102,9 +105,10 @@ class UserProfile {
|
|||
size_t extra_size() const override {
|
||||
return value.empty() ? 0 : 2 * (static_cast<int32_t>(value.size()) + 1);
|
||||
}
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer,
|
||||
uint32_t buffer_ptr, size_t buffer_offset) override {
|
||||
buffer_offset = Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer, uint32_t buffer_ptr,
|
||||
size_t buffer_offset) override {
|
||||
buffer_offset =
|
||||
Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
int32_t length;
|
||||
if (value.empty()) {
|
||||
length = 0;
|
||||
|
@ -113,7 +117,8 @@ class UserProfile {
|
|||
} else {
|
||||
length = 2 * (static_cast<int32_t>(value.size()) + 1);
|
||||
xe::store_and_swap<int32_t>(user_data + kValueOffset, length);
|
||||
xe::store_and_swap<uint32_t>(user_data + kPointerOffset,
|
||||
xe::store_and_swap<uint32_t>(
|
||||
user_data + kPointerOffset,
|
||||
buffer_ptr + static_cast<uint32_t>(buffer_offset));
|
||||
memcpy(buffer + buffer_offset, value.data(), length);
|
||||
}
|
||||
|
@ -124,9 +129,10 @@ class UserProfile {
|
|||
FloatSetting(uint32_t setting_id, float value)
|
||||
: Setting(setting_id, Type::FLOAT, 4), value(value) {}
|
||||
float value;
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer,
|
||||
uint32_t buffer_ptr, size_t buffer_offset) override {
|
||||
buffer_offset = Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer, uint32_t buffer_ptr,
|
||||
size_t buffer_offset) override {
|
||||
buffer_offset =
|
||||
Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
xe::store_and_swap<float>(user_data + kValueOffset, value);
|
||||
return buffer_offset;
|
||||
}
|
||||
|
@ -138,9 +144,10 @@ class UserProfile {
|
|||
size_t extra_size() const override {
|
||||
return static_cast<int32_t>(value.size());
|
||||
}
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer,
|
||||
uint32_t buffer_ptr, size_t buffer_offset) override {
|
||||
buffer_offset = Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer, uint32_t buffer_ptr,
|
||||
size_t buffer_offset) override {
|
||||
buffer_offset =
|
||||
Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
int32_t length;
|
||||
if (value.empty()) {
|
||||
length = 0;
|
||||
|
@ -149,7 +156,8 @@ class UserProfile {
|
|||
} else {
|
||||
length = static_cast<int32_t>(value.size());
|
||||
xe::store_and_swap<int32_t>(user_data + kValueOffset, length);
|
||||
xe::store_and_swap<uint32_t>(user_data + kPointerOffset,
|
||||
xe::store_and_swap<uint32_t>(
|
||||
user_data + kPointerOffset,
|
||||
buffer_ptr + static_cast<uint32_t>(buffer_offset));
|
||||
memcpy(buffer + buffer_offset, value.data(), length);
|
||||
}
|
||||
|
@ -160,9 +168,10 @@ class UserProfile {
|
|||
DateTimeSetting(uint32_t setting_id, int64_t value)
|
||||
: Setting(setting_id, Type::DATETIME, 8), value(value) {}
|
||||
int64_t value;
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer,
|
||||
uint32_t buffer_ptr, size_t buffer_offset) override {
|
||||
buffer_offset = Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer, uint32_t buffer_ptr,
|
||||
size_t buffer_offset) override {
|
||||
buffer_offset =
|
||||
Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
xe::store_and_swap<int64_t>(user_data + kValueOffset, value);
|
||||
return buffer_offset;
|
||||
}
|
||||
|
|
|
@ -276,7 +276,7 @@ typedef struct {
|
|||
xe_xex2_version_t version;
|
||||
xe_xex2_version_t min_version;
|
||||
size_t record_count;
|
||||
uint32_t *records;
|
||||
uint32_t* records;
|
||||
} xe_xex2_import_library_t;
|
||||
|
||||
typedef enum {
|
||||
|
@ -303,7 +303,8 @@ typedef struct {
|
|||
uint32_t imagebaseaddr; // must be <<16 to be accurate
|
||||
uint32_t count;
|
||||
uint32_t base;
|
||||
uint32_t ordOffset[1]; // ordOffset[0] + (imagebaseaddr << 16) = function offset of ordinal 1
|
||||
uint32_t ordOffset[1]; // ordOffset[0] + (imagebaseaddr << 16) = function
|
||||
// offset of ordinal 1
|
||||
} xe_xex2_export_table;
|
||||
|
||||
typedef enum {
|
||||
|
@ -325,7 +326,7 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
uint32_t block_count;
|
||||
xe_xex2_file_basic_compression_block_t *blocks;
|
||||
xe_xex2_file_basic_compression_block_t* blocks;
|
||||
} xe_xex2_file_basic_compression_info_t;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -563,8 +563,8 @@ SHIM_CALL NetDll_sendto_shim(PPCContext* ppc_context,
|
|||
uint32_t to_ptr = SHIM_GET_ARG_32(5);
|
||||
uint32_t tolen = SHIM_GET_ARG_32(6);
|
||||
|
||||
XELOGD("NetDll_sendto(%d, %.8X, %.8X, %d, %d, %.8X, %d)", caller, socket_handle,
|
||||
buf_ptr, len, flags, to_ptr, tolen);
|
||||
XELOGD("NetDll_sendto(%d, %.8X, %.8X, %d, %d, %.8X, %d)", caller,
|
||||
socket_handle, buf_ptr, len, flags, to_ptr, tolen);
|
||||
|
||||
sockaddr to;
|
||||
LoadSockaddr(SHIM_MEM_ADDR(to_ptr), &to);
|
||||
|
|
|
@ -214,7 +214,8 @@ SHIM_CALL XamUserReadProfileSettings_shim(PPCContext* ppc_context,
|
|||
out_header->setting_count = setting_count;
|
||||
out_header->settings_ptr = buffer_ptr + 8;
|
||||
|
||||
auto out_setting = (X_USER_READ_PROFILE_SETTING*)SHIM_MEM_ADDR(out_header->settings_ptr);
|
||||
auto out_setting =
|
||||
(X_USER_READ_PROFILE_SETTING*)SHIM_MEM_ADDR(out_header->settings_ptr);
|
||||
|
||||
size_t buffer_offset = base_size_needed;
|
||||
for (uint32_t n = 0; n < setting_count; ++n) {
|
||||
|
@ -227,10 +228,12 @@ SHIM_CALL XamUserReadProfileSettings_shim(PPCContext* ppc_context,
|
|||
out_setting->setting_id = setting_id;
|
||||
|
||||
if (setting) {
|
||||
buffer_offset = setting->Append(&out_setting->setting_data[0],
|
||||
buffer_offset =
|
||||
setting->Append(&out_setting->setting_data[0],
|
||||
SHIM_MEM_ADDR(buffer_ptr), buffer_ptr, buffer_offset);
|
||||
} /*else {
|
||||
std::memset(&out_setting->setting_data[0], 0, sizeof(out_setting->setting_data));
|
||||
std::memset(&out_setting->setting_data[0], 0,
|
||||
sizeof(out_setting->setting_data));
|
||||
}*/
|
||||
++out_setting;
|
||||
}
|
||||
|
|
|
@ -132,9 +132,11 @@ SHIM_CALL XMAInitializeContext_shim(PPCContext* ppc_context,
|
|||
auto context_init = (XMA_CONTEXT_INIT*)SHIM_MEM_ADDR(context_init_ptr);
|
||||
|
||||
context.input_buffer_0_ptr = context_init->input_buffer_0_ptr;
|
||||
context.input_buffer_0_packet_count = context_init->input_buffer_0_packet_count;
|
||||
context.input_buffer_0_packet_count =
|
||||
context_init->input_buffer_0_packet_count;
|
||||
context.input_buffer_1_ptr = context_init->input_buffer_1_ptr;
|
||||
context.input_buffer_1_packet_count = context_init->input_buffer_1_packet_count;
|
||||
context.input_buffer_1_packet_count =
|
||||
context_init->input_buffer_1_packet_count;
|
||||
context.input_buffer_read_offset = context_init->input_buffer_read_offset;
|
||||
context.output_buffer_ptr = context_init->output_buffer_ptr;
|
||||
context.output_buffer_block_count = context_init->output_buffer_block_count;
|
||||
|
|
|
@ -27,16 +27,12 @@ void XeCryptShaInit(pointer_t<XECRYPT_SHA_STATE> sha_state) {
|
|||
}
|
||||
DECLARE_XBOXKRNL_EXPORT(XeCryptShaInit, ExportTag::kStub);
|
||||
|
||||
void XeCryptShaUpdate(pointer_t<XECRYPT_SHA_STATE> sha_state,
|
||||
lpvoid_t input, dword_t input_size) {
|
||||
|
||||
}
|
||||
void XeCryptShaUpdate(pointer_t<XECRYPT_SHA_STATE> sha_state, lpvoid_t input,
|
||||
dword_t input_size) {}
|
||||
DECLARE_XBOXKRNL_EXPORT(XeCryptShaUpdate, ExportTag::kStub);
|
||||
|
||||
void XeCryptShaFinal(pointer_t<XECRYPT_SHA_STATE> sha_state, lpvoid_t out,
|
||||
dword_t out_size) {
|
||||
|
||||
}
|
||||
dword_t out_size) {}
|
||||
DECLARE_XBOXKRNL_EXPORT(XeCryptShaFinal, ExportTag::kStub);
|
||||
|
||||
void xe::kernel::xboxkrnl::RegisterCryptExports(
|
||||
|
|
|
@ -477,11 +477,9 @@ struct X_IO_STATUS_BLOCK {
|
|||
xe::be<uint32_t> information;
|
||||
};
|
||||
|
||||
dword_result_t NtQueryInformationFile(dword_t file_handle,
|
||||
pointer_t<X_IO_STATUS_BLOCK>
|
||||
io_status_block_ptr,
|
||||
lpvoid_t file_info_ptr, dword_t length,
|
||||
dword_t file_info_class) {
|
||||
dword_result_t NtQueryInformationFile(
|
||||
dword_t file_handle, pointer_t<X_IO_STATUS_BLOCK> io_status_block_ptr,
|
||||
lpvoid_t file_info_ptr, dword_t length, dword_t file_info_class) {
|
||||
X_STATUS result = X_STATUS_SUCCESS;
|
||||
uint32_t info = 0;
|
||||
|
||||
|
@ -572,8 +570,8 @@ dword_result_t NtQueryInformationFile(dword_t file_handle,
|
|||
|
||||
return result;
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT(NtQueryInformationFile, ExportTag::kImplemented |
|
||||
ExportTag::kFileSystem);
|
||||
DECLARE_XBOXKRNL_EXPORT(NtQueryInformationFile,
|
||||
ExportTag::kImplemented | ExportTag::kFileSystem);
|
||||
|
||||
SHIM_CALL NtQueryFullAttributesFile_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
|
|
|
@ -549,7 +549,8 @@ SHIM_CALL KeUnlockL2_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
|||
XELOGD("KeUnlockL2(?)");
|
||||
}
|
||||
|
||||
SHIM_CALL MmCreateKernelStack_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
SHIM_CALL MmCreateKernelStack_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
auto stack_size = SHIM_GET_ARG_32(0);
|
||||
auto unk1 = SHIM_GET_ARG_32(1);
|
||||
|
||||
|
@ -568,7 +569,8 @@ SHIM_CALL MmCreateKernelStack_shim(PPCContext* ppc_context, KernelState* kernel_
|
|||
SHIM_SET_RETURN_32(stack_address + stack_size);
|
||||
}
|
||||
|
||||
SHIM_CALL MmDeleteKernelStack_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
SHIM_CALL MmDeleteKernelStack_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
auto unk0 = SHIM_GET_ARG_32(0);
|
||||
auto unk1 = SHIM_GET_ARG_32(1);
|
||||
|
||||
|
|
|
@ -486,12 +486,14 @@ SHIM_CALL NtCreateEvent_shim(PPCContext* ppc_context,
|
|||
SHIM_SET_RETURN_32(X_STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
SHIM_CALL KeInitializeEvent_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
SHIM_CALL KeInitializeEvent_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t handle_ptr = SHIM_GET_ARG_32(0);
|
||||
uint32_t event_type = SHIM_GET_ARG_32(1);
|
||||
uint32_t initial_state = SHIM_GET_ARG_32(2);
|
||||
|
||||
XELOGD("KeInitializeEvent(%.8X, %.8X, %.8X)", handle_ptr, event_type, initial_state);
|
||||
XELOGD("KeInitializeEvent(%.8X, %.8X, %.8X)", handle_ptr, event_type,
|
||||
initial_state);
|
||||
|
||||
XEvent* ev = new XEvent(kernel_state);
|
||||
ev->Initialize(!event_type, !!initial_state);
|
||||
|
@ -881,8 +883,7 @@ SHIM_CALL KeWaitForSingleObject_shim(PPCContext* ppc_context,
|
|||
|
||||
// Log it in case this is the source of any problems in the future
|
||||
XELOGD("KeWaitForSingleObject - Interpreting object ptr as handle!");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
object = XObject::GetNativeObject<XObject>(kernel_state,
|
||||
SHIM_MEM_ADDR(object_ptr));
|
||||
}
|
||||
|
|
|
@ -93,8 +93,10 @@ void VdGetCurrentDisplayInformation(pointer_t<X_DISPLAY_INFO> display_info) {
|
|||
display_info->unk42 = 180; // display_height / 4?
|
||||
display_info->unk44 = 320;
|
||||
display_info->unk46 = 180;
|
||||
display_info->unk48 = (xe::be<uint16_t>)mode.display_width; // actual display size?
|
||||
display_info->unk4A = (xe::be<uint16_t>)mode.display_height; // actual display size?
|
||||
display_info->unk48 =
|
||||
(xe::be<uint16_t>)mode.display_width; // actual display size?
|
||||
display_info->unk4A =
|
||||
(xe::be<uint16_t>)mode.display_height; // actual display size?
|
||||
display_info->unk4C = mode.refresh_rate;
|
||||
display_info->unk56 = (xe::be<uint16_t>)mode.display_width; // display width
|
||||
}
|
||||
|
@ -324,10 +326,8 @@ void VdSwap(lpvoid_t buffer_ptr, // ptr into primary ringbuffer
|
|||
lpunknown_t unk3, // buffer from VdGetSystemCommandBuffer
|
||||
lpunknown_t unk4, // from VdGetSystemCommandBuffer (0xBEEF0001)
|
||||
lpdword_t frontbuffer_ptr, // ptr to frontbuffer address
|
||||
lpdword_t color_format_ptr,
|
||||
lpdword_t color_space_ptr,
|
||||
lpunknown_t unk8,
|
||||
unknown_t unk9) {
|
||||
lpdword_t color_format_ptr, lpdword_t color_space_ptr,
|
||||
lpunknown_t unk8, unknown_t unk9) {
|
||||
gpu::xenos::xe_gpu_texture_fetch_t fetch;
|
||||
xe::copy_and_swap_32_unaligned(
|
||||
reinterpret_cast<uint32_t*>(&fetch),
|
||||
|
|
|
@ -182,7 +182,8 @@ int Memory::Initialize() {
|
|||
heaps_.v00000000.AllocFixed(
|
||||
0x00000000, 4096, 4096,
|
||||
kMemoryAllocationReserve | kMemoryAllocationCommit,
|
||||
!FLAGS_protect_zero ? kMemoryProtectRead | kMemoryProtectWrite : kMemoryProtectNoAccess);
|
||||
!FLAGS_protect_zero ? kMemoryProtectRead | kMemoryProtectWrite
|
||||
: kMemoryProtectNoAccess);
|
||||
|
||||
// GPU writeback.
|
||||
// 0xC... is physical, 0x7F... is virtual. We may need to overlay these.
|
||||
|
@ -771,7 +772,7 @@ bool BaseHeap::AllocRange(uint32_t low_address, uint32_t high_address,
|
|||
page_entry.state = kMemoryAllocationReserve | allocation_type;
|
||||
}
|
||||
|
||||
*out_address = heap_base_ + start_page_number * page_size_;
|
||||
*out_address = heap_base_ + start_page_number* page_size_;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -818,7 +819,7 @@ bool BaseHeap::Release(uint32_t base_address, uint32_t* out_region_size) {
|
|||
}
|
||||
|
||||
if (out_region_size) {
|
||||
*out_region_size = base_page_entry.region_page_count * page_size_;
|
||||
*out_region_size = base_page_entry.region_page_count* page_size_;
|
||||
}
|
||||
|
||||
// Release from host not needed as mapping reserves the range for us.
|
||||
|
@ -968,7 +969,7 @@ bool BaseHeap::QuerySize(uint32_t address, uint32_t* out_size) {
|
|||
}
|
||||
std::lock_guard<xe::recursive_mutex> lock(heap_mutex_);
|
||||
auto page_entry = page_table_[page_number];
|
||||
*out_size = page_entry.region_page_count * page_size_;
|
||||
*out_size = page_entry.region_page_count* page_size_;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
|
||||
#include "xenia/base/memory.h"
|
||||
|
||||
// TODO(benvanik): split this header, cleanup, etc.
|
||||
// clang-format off
|
||||
|
||||
namespace xe {
|
||||
|
||||
#pragma pack(push, 4)
|
||||
|
@ -138,20 +141,16 @@ typedef uint32_t X_HRESULT;
|
|||
#define X_PROCTYPE_USER 1
|
||||
#define X_PROCTYPE_SYSTEM 2
|
||||
|
||||
|
||||
// Sockets/networking.
|
||||
#define X_INVALID_SOCKET (uint32_t)(~0)
|
||||
#define X_SOCKET_ERROR (uint32_t)(-1)
|
||||
|
||||
|
||||
// Thread enums.
|
||||
#define X_CREATE_SUSPENDED 0x00000004
|
||||
|
||||
|
||||
// TLS specials.
|
||||
#define X_TLS_OUT_OF_INDEXES UINT32_MAX // (-1)
|
||||
|
||||
|
||||
// Languages.
|
||||
#define X_LANGUAGE_ENGLISH 1
|
||||
#define X_LANGUAGE_JAPANESE 2
|
||||
|
@ -384,4 +383,6 @@ static_assert_size(X_LIST_ENTRY, 8);
|
|||
|
||||
} // namespace xe
|
||||
|
||||
// clang-format on
|
||||
|
||||
#endif // XENIA_XBOX_H_
|
||||
|
|
Loading…
Reference in New Issue