From 15938b667ba2523904a2b6ba132367b6f28526e3 Mon Sep 17 00:00:00 2001 From: ramenrrami Date: Tue, 14 Oct 2025 20:15:52 +0200 Subject: [PATCH 1/2] jit: add detailed logging for ARM32 instruction registration --- src/jit/decoder/arm32.cpp | 16 ++++++++++++++++ src/jit/decoder/arm32.h | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/jit/decoder/arm32.cpp b/src/jit/decoder/arm32.cpp index 2434a59..1cf9c0d 100644 --- a/src/jit/decoder/arm32.cpp +++ b/src/jit/decoder/arm32.cpp @@ -85,6 +85,7 @@ void arm32_add_instruction(arm32_decoder_t* decoder, const char* name, const cha } ++decoder->instruction_count; + arm32_log_instruction_info(info); /* TODO(GloriousTacoo:jit): Add instruction to lookup table. */ } @@ -131,4 +132,19 @@ void arm32_parse_bitstring(const char* bitstring, uint32_t* mask, uint32_t* expe } } } +void arm32_log_instruction_info(const arm32_instruction_info_t* info) +{ + if (info == nullptr) + { + LOG_TRACE("Attempted to log a null instruction info pointer!"); + return; + } + + LOG_TRACE("========================================"); + LOG_TRACE("Instruction Registered: %s", info->name); + LOG_TRACE("Mask: 0x%08X", info->mask); + LOG_TRACE("Expected: 0x%08X", info->expected); + LOG_TRACE("Priority: %d", info->priority); + LOG_TRACE("========================================"); +} } // namespace pound::jit::decoder diff --git a/src/jit/decoder/arm32.h b/src/jit/decoder/arm32.h index 7b2f79d..6308899 100644 --- a/src/jit/decoder/arm32.h +++ b/src/jit/decoder/arm32.h @@ -48,5 +48,7 @@ void arm32_add_instruction(arm32_decoder_t* decoder, const char* name, arm32_opc arm32_handler_fn handler); void arm32_ADD_imm_handler(arm32_decoder_t* decoder, arm32_instruction_t instruction); +void arm32_log_instruction_info(const arm32_instruction_info_t* info); + } // namespace pound::jit::decoder -#endif // POUND_JIT_DECODER_ARM32_H +#endif // POUND_JIT_DECODER_ARM32_H \ No newline at end of file From aff8491a190d05219b1651296cee1e9b968299e2 Mon Sep 17 00:00:00 2001 From: ramenrrami Date: Wed, 15 Oct 2025 10:54:53 +0200 Subject: [PATCH 2/2] jit: inline ARM32 instruction logging and remove redundant traces --- src/jit/decoder/arm32.cpp | 26 +++++++------------------- src/jit/decoder/arm32.h | 1 - 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/jit/decoder/arm32.cpp b/src/jit/decoder/arm32.cpp index 1cf9c0d..460eb12 100644 --- a/src/jit/decoder/arm32.cpp +++ b/src/jit/decoder/arm32.cpp @@ -60,14 +60,10 @@ void arm32_add_instruction(arm32_decoder_t* decoder, const char* name, const cha PVM_ASSERT(nullptr != bitstring); PVM_ASSERT(decoder->instruction_count < decoder->instruction_capacity); - LOG_TRACE("Adding '%s' instruction to lookup table.", name); arm32_opcode_t mask = 0; arm32_opcode_t expected = 0; arm32_parse_bitstring(bitstring, &mask, &expected); - LOG_TRACE("Mask: %x", mask); - LOG_TRACE("Expected: %x", expected); - arm32_instruction_info_t* info = &decoder->instructions[decoder->instruction_count]; info->name = name; info->mask = mask; @@ -85,7 +81,13 @@ void arm32_add_instruction(arm32_decoder_t* decoder, const char* name, const cha } ++decoder->instruction_count; - arm32_log_instruction_info(info); + LOG_TRACE("========================================"); + LOG_TRACE("Instruction Registered: %s", info->name); + LOG_TRACE("Mask: 0x%08X", info->mask); + LOG_TRACE("Expected: 0x%08X", info->expected); + LOG_TRACE("Priority: %d", info->priority); + LOG_TRACE("========================================"); + /* TODO(GloriousTacoo:jit): Add instruction to lookup table. */ } @@ -132,19 +134,5 @@ void arm32_parse_bitstring(const char* bitstring, uint32_t* mask, uint32_t* expe } } } -void arm32_log_instruction_info(const arm32_instruction_info_t* info) -{ - if (info == nullptr) - { - LOG_TRACE("Attempted to log a null instruction info pointer!"); - return; - } - LOG_TRACE("========================================"); - LOG_TRACE("Instruction Registered: %s", info->name); - LOG_TRACE("Mask: 0x%08X", info->mask); - LOG_TRACE("Expected: 0x%08X", info->expected); - LOG_TRACE("Priority: %d", info->priority); - LOG_TRACE("========================================"); -} } // namespace pound::jit::decoder diff --git a/src/jit/decoder/arm32.h b/src/jit/decoder/arm32.h index 6308899..c984d45 100644 --- a/src/jit/decoder/arm32.h +++ b/src/jit/decoder/arm32.h @@ -48,7 +48,6 @@ void arm32_add_instruction(arm32_decoder_t* decoder, const char* name, arm32_opc arm32_handler_fn handler); void arm32_ADD_imm_handler(arm32_decoder_t* decoder, arm32_instruction_t instruction); -void arm32_log_instruction_info(const arm32_instruction_info_t* info); } // namespace pound::jit::decoder #endif // POUND_JIT_DECODER_ARM32_H \ No newline at end of file