/* Default endian is little endian. */
static enum aice_target_endian data_endian;
+/* Constants for AICE command format length */
+static const int32_t AICE_FORMAT_HTDA = 3;
+static const int32_t AICE_FORMAT_HTDB = 6;
+static const int32_t AICE_FORMAT_HTDC = 7;
+static const int32_t AICE_FORMAT_HTDD = 10;
+static const int32_t AICE_FORMAT_HTDMA = 4;
+static const int32_t AICE_FORMAT_HTDMB = 8;
+static const int32_t AICE_FORMAT_HTDMC = 8;
+static const int32_t AICE_FORMAT_HTDMD = 12;
+static const int32_t AICE_FORMAT_DTHA = 6;
+static const int32_t AICE_FORMAT_DTHB = 2;
+static const int32_t AICE_FORMAT_DTHMA = 8;
+static const int32_t AICE_FORMAT_DTHMB = 4;
+
+/* Constants for AICE command */
+static const uint8_t AICE_CMD_SCAN_CHAIN = 0x00;
+static const uint8_t AICE_CMD_SELECT_TARGET = 0x01;
+static const uint8_t AICE_CMD_READ_DIM = 0x02;
+static const uint8_t AICE_CMD_READ_EDMSR = 0x03;
+static const uint8_t AICE_CMD_READ_DTR = 0x04;
+static const uint8_t AICE_CMD_READ_MEM = 0x05;
+static const uint8_t AICE_CMD_READ_MISC = 0x06;
+static const uint8_t AICE_CMD_FASTREAD_MEM = 0x07;
+static const uint8_t AICE_CMD_WRITE_DIM = 0x08;
+static const uint8_t AICE_CMD_WRITE_EDMSR = 0x09;
+static const uint8_t AICE_CMD_WRITE_DTR = 0x0A;
+static const uint8_t AICE_CMD_WRITE_MEM = 0x0B;
+static const uint8_t AICE_CMD_WRITE_MISC = 0x0C;
+static const uint8_t AICE_CMD_FASTWRITE_MEM = 0x0D;
+static const uint8_t AICE_CMD_EXECUTE = 0x0E;
+static const uint8_t AICE_CMD_READ_MEM_B = 0x14;
+static const uint8_t AICE_CMD_READ_MEM_H = 0x15;
+static const uint8_t AICE_CMD_T_READ_MISC = 0x20;
+static const uint8_t AICE_CMD_T_READ_EDMSR = 0x21;
+static const uint8_t AICE_CMD_T_READ_DTR = 0x22;
+static const uint8_t AICE_CMD_T_READ_DIM = 0x23;
+static const uint8_t AICE_CMD_T_READ_MEM_B = 0x24;
+static const uint8_t AICE_CMD_T_READ_MEM_H = 0x25;
+static const uint8_t AICE_CMD_T_READ_MEM = 0x26;
+static const uint8_t AICE_CMD_T_FASTREAD_MEM = 0x27;
+static const uint8_t AICE_CMD_T_WRITE_MISC = 0x28;
+static const uint8_t AICE_CMD_T_WRITE_EDMSR = 0x29;
+static const uint8_t AICE_CMD_T_WRITE_DTR = 0x2A;
+static const uint8_t AICE_CMD_T_WRITE_DIM = 0x2B;
+static const uint8_t AICE_CMD_T_WRITE_MEM_B = 0x2C;
+static const uint8_t AICE_CMD_T_WRITE_MEM_H = 0x2D;
+static const uint8_t AICE_CMD_T_WRITE_MEM = 0x2E;
+static const uint8_t AICE_CMD_T_FASTWRITE_MEM = 0x2F;
+static const uint8_t AICE_CMD_T_GET_TRACE_STATUS = 0x36;
+static const uint8_t AICE_CMD_T_EXECUTE = 0x3E;
+static const uint8_t AICE_CMD_AICE_PROGRAM_READ = 0x40;
+static const uint8_t AICE_CMD_AICE_PROGRAM_WRITE = 0x41;
+static const uint8_t AICE_CMD_AICE_PROGRAM_CONTROL = 0x42;
+static const uint8_t AICE_CMD_READ_CTRL = 0x50;
+static const uint8_t AICE_CMD_WRITE_CTRL = 0x51;
+static const uint8_t AICE_CMD_BATCH_BUFFER_READ = 0x60;
+static const uint8_t AICE_CMD_READ_DTR_TO_BUFFER = 0x61;
+static const uint8_t AICE_CMD_BATCH_BUFFER_WRITE = 0x68;
+static const uint8_t AICE_CMD_WRITE_DTR_FROM_BUFFER = 0x69;
/***************************************************************************/
/* AICE commands' pack/unpack functions */
int result;
if (out_length > AICE_OUT_BUFFER_SIZE) {
- LOG_ERROR("aice_write illegal out_length=%d (max=%d)",
+ LOG_ERROR("aice_write illegal out_length=%i (max=%i)",
out_length, AICE_OUT_BUFFER_SIZE);
return -1;
}
result = usb_bulk_write_ex(aice_handler.usb_handle, aice_handler.usb_write_ep,
(char *)out_buffer, out_length, AICE_USB_TIMEOUT);
- DEBUG_JTAG_IO("aice_usb_write, out_length = %d, result = %d",
+ DEBUG_JTAG_IO("aice_usb_write, out_length = %i, result = %i",
out_length, result);
return result;
/* Read data from USB into in_buffer. */
static int aice_usb_read(uint8_t *in_buffer, int expected_size)
{
- int result = usb_bulk_read_ex(aice_handler.usb_handle, aice_handler.usb_read_ep,
+ int32_t result = usb_bulk_read_ex(aice_handler.usb_handle, aice_handler.usb_read_ep,
(char *)in_buffer, expected_size, AICE_USB_TIMEOUT);
- DEBUG_JTAG_IO("aice_usb_read, result = %d", result);
+ DEBUG_JTAG_IO("aice_usb_read, result = %" PRId32, result);
return result;
}
static int aice_scan_chain(uint32_t *id_codes, uint8_t *num_of_ids)
{
- int result;
+ int32_t result;
int retry_times = 0;
if ((AICE_COMMAND_MODE_PACK == aice_command_mode) ||
/** TODO: modify receive length */
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHA);
if (AICE_FORMAT_DTHA != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)",
+ LOG_ERROR("aice_usb_read failed (requested=%" PRIu32 ", result=%" PRId32 ")",
AICE_FORMAT_DTHA, result);
return ERROR_FAIL;
}
if (cmd_ack_code != AICE_CMD_SCAN_CHAIN) {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_SCAN_CHAIN, cmd_ack_code);
return ERROR_FAIL;
}
continue;
}
- LOG_DEBUG("SCAN_CHAIN response, # of IDs: %d", *num_of_ids);
+ LOG_DEBUG("SCAN_CHAIN response, # of IDs: %" PRIu8, *num_of_ids);
if (*num_of_ids == 0xFF) {
LOG_ERROR("No target connected");
int aice_read_ctrl(uint32_t address, uint32_t *data)
{
- int result;
+ int32_t result;
if ((AICE_COMMAND_MODE_PACK == aice_command_mode) ||
(AICE_COMMAND_MODE_BATCH == aice_command_mode))
aice_usb_write(usb_out_buffer, AICE_FORMAT_HTDA);
- LOG_DEBUG("READ_CTRL, address: 0x%x", address);
+ LOG_DEBUG("READ_CTRL, address: 0x%" PRIx32, address);
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHA);
if (AICE_FORMAT_DTHA != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)",
+ LOG_ERROR("aice_usb_read failed (requested=%" PRIu32 ", result=%" PRId32 ")",
AICE_FORMAT_DTHA, result);
return ERROR_FAIL;
}
uint8_t extra_length;
aice_unpack_dtha(&cmd_ack_code, &extra_length, data, AICE_LITTLE_ENDIAN);
- LOG_DEBUG("READ_CTRL response, data: 0x%x", *data);
+ LOG_DEBUG("READ_CTRL response, data: 0x%" PRIx32, *data);
if (cmd_ack_code != AICE_CMD_READ_CTRL) {
- LOG_ERROR("aice command error (command=0x%x, response=0x%x)",
- AICE_CMD_READ_CTRL, cmd_ack_code);
+ LOG_ERROR("aice command error (command=0x%" PRIx32 ", response=0x%" PRIx8 ")",
+ (uint32_t)AICE_CMD_READ_CTRL, cmd_ack_code);
return ERROR_FAIL;
}
int aice_write_ctrl(uint32_t address, uint32_t data)
{
- int result;
+ int32_t result;
if (AICE_COMMAND_MODE_PACK == aice_command_mode) {
aice_usb_packet_flush();
aice_usb_write(usb_out_buffer, AICE_FORMAT_HTDC);
- LOG_DEBUG("WRITE_CTRL, address: 0x%x, data: 0x%x", address, data);
+ LOG_DEBUG("WRITE_CTRL, address: 0x%" PRIx32 ", data: 0x%" PRIx32, address, data);
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHB);
if (AICE_FORMAT_DTHB != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)",
+ LOG_ERROR("aice_usb_read failed (requested=%" PRIu32 ", result=%" PRId32 ")",
AICE_FORMAT_DTHB, result);
return ERROR_FAIL;
}
LOG_DEBUG("WRITE_CTRL response");
if (cmd_ack_code != AICE_CMD_WRITE_CTRL) {
- LOG_ERROR("aice command error (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command error (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_WRITE_CTRL, cmd_ack_code);
return ERROR_FAIL;
}
int aice_read_dtr(uint8_t target_id, uint32_t *data)
{
- int result;
+ int32_t result;
int retry_times = 0;
if ((AICE_COMMAND_MODE_PACK == aice_command_mode) ||
aice_usb_write(usb_out_buffer, AICE_FORMAT_HTDMA);
- LOG_DEBUG("READ_DTR, COREID: %d", target_id);
+ LOG_DEBUG("READ_DTR, COREID: %" PRIu8, target_id);
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHMA);
if (AICE_FORMAT_DTHMA != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)",
+ LOG_ERROR("aice_usb_read failed (requested=%" PRId32 ", result=%" PRId32 ")",
AICE_FORMAT_DTHMA, result);
return ERROR_FAIL;
}
data, AICE_LITTLE_ENDIAN);
if (cmd_ack_code == AICE_CMD_T_READ_DTR) {
- LOG_DEBUG("READ_DTR response, data: 0x%x", *data);
+ LOG_DEBUG("READ_DTR response, data: 0x%" PRIx32, *data);
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_T_READ_DTR, cmd_ack_code);
return ERROR_FAIL;
}
int aice_read_dtr_to_buffer(uint8_t target_id, uint32_t buffer_idx)
{
- int result;
+ int32_t result;
int retry_times = 0;
if (AICE_COMMAND_MODE_PACK == aice_command_mode) {
aice_usb_write(usb_out_buffer, AICE_FORMAT_HTDMA);
- LOG_DEBUG("READ_DTR_TO_BUFFER, COREID: %d", target_id);
+ LOG_DEBUG("READ_DTR_TO_BUFFER, COREID: %" PRIu8, target_id);
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHMB);
if (AICE_FORMAT_DTHMB != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)", AICE_FORMAT_DTHMB, result);
+ LOG_ERROR("aice_usb_read failed (requested=%" PRId32 ", result=%" PRId32 ")", AICE_FORMAT_DTHMB, result);
return ERROR_FAIL;
}
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_READ_DTR_TO_BUFFER, cmd_ack_code);
return ERROR_FAIL;
int aice_write_dtr(uint8_t target_id, uint32_t data)
{
- int result;
+ int32_t result;
int retry_times = 0;
if (AICE_COMMAND_MODE_PACK == aice_command_mode) {
aice_usb_write(usb_out_buffer, AICE_FORMAT_HTDMC);
- LOG_DEBUG("WRITE_DTR, COREID: %d, data: 0x%x", target_id, data);
+ LOG_DEBUG("WRITE_DTR, COREID: %" PRIu8 ", data: 0x%" PRIx32, target_id, data);
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHMB);
if (AICE_FORMAT_DTHMB != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)", AICE_FORMAT_DTHMB, result);
+ LOG_ERROR("aice_usb_read failed (requested=%" PRId32 ", result=%" PRId32 ")", AICE_FORMAT_DTHMB, result);
return ERROR_FAIL;
}
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_T_WRITE_DTR, cmd_ack_code);
return ERROR_FAIL;
int aice_write_dtr_from_buffer(uint8_t target_id, uint32_t buffer_idx)
{
- int result;
+ int32_t result;
int retry_times = 0;
if (AICE_COMMAND_MODE_PACK == aice_command_mode) {
aice_usb_write(usb_out_buffer, AICE_FORMAT_HTDMA);
- LOG_DEBUG("WRITE_DTR_FROM_BUFFER, COREID: %d", target_id);
+ LOG_DEBUG("WRITE_DTR_FROM_BUFFER, COREID: %" PRIu8 "", target_id);
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHMB);
if (AICE_FORMAT_DTHMB != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)", AICE_FORMAT_DTHMB, result);
+ LOG_ERROR("aice_usb_read failed (requested=%" PRId32 ", result=%" PRId32 ")", AICE_FORMAT_DTHMB, result);
return ERROR_FAIL;
}
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_WRITE_DTR_FROM_BUFFER, cmd_ack_code);
return ERROR_FAIL;
int aice_read_misc(uint8_t target_id, uint32_t address, uint32_t *data)
{
- int result;
+ int32_t result;
int retry_times = 0;
if ((AICE_COMMAND_MODE_PACK == aice_command_mode) ||
aice_usb_write(usb_out_buffer, AICE_FORMAT_HTDMA);
- LOG_DEBUG("READ_MISC, COREID: %d, address: 0x%x", target_id, address);
+ LOG_DEBUG("READ_MISC, COREID: %" PRIu8 ", address: 0x%" PRIx32, target_id, address);
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHMA);
if (AICE_FORMAT_DTHMA != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)",
+ LOG_ERROR("aice_usb_read failed (requested=%" PRId32 ", result=%" PRId32 ")",
AICE_FORMAT_DTHMA, result);
return ERROR_AICE_DISCONNECT;
}
data, AICE_LITTLE_ENDIAN);
if (cmd_ack_code == AICE_CMD_T_READ_MISC) {
- LOG_DEBUG("READ_MISC response, data: 0x%x", *data);
+ LOG_DEBUG("READ_MISC response, data: 0x%" PRIx32, *data);
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_T_READ_MISC, cmd_ack_code);
return ERROR_FAIL;
}
int aice_write_misc(uint8_t target_id, uint32_t address, uint32_t data)
{
- int result;
+ int32_t result;
int retry_times = 0;
if (AICE_COMMAND_MODE_PACK == aice_command_mode) {
aice_usb_write(usb_out_buffer, AICE_FORMAT_HTDMC);
- LOG_DEBUG("WRITE_MISC, COREID: %d, address: 0x%x, data: 0x%x",
+ LOG_DEBUG("WRITE_MISC, COREID: %" PRIu8 ", address: 0x%" PRIx32 ", data: 0x%" PRIx32,
target_id, address, data);
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHMB);
if (AICE_FORMAT_DTHMB != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)",
+ LOG_ERROR("aice_usb_read failed (requested=%" PRId32 ", result=%" PRId32 ")",
AICE_FORMAT_DTHMB, result);
return ERROR_FAIL;
}
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_T_WRITE_MISC, cmd_ack_code);
return ERROR_FAIL;
int aice_read_edmsr(uint8_t target_id, uint32_t address, uint32_t *data)
{
- int result;
+ int32_t result;
int retry_times = 0;
if ((AICE_COMMAND_MODE_PACK == aice_command_mode) ||
aice_usb_write(usb_out_buffer, AICE_FORMAT_HTDMA);
- LOG_DEBUG("READ_EDMSR, COREID: %d, address: 0x%x", target_id, address);
+ LOG_DEBUG("READ_EDMSR, COREID: %" PRIu8 ", address: 0x%" PRIx32, target_id, address);
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHMA);
if (AICE_FORMAT_DTHMA != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)",
+ LOG_ERROR("aice_usb_read failed (requested=%" PRId32 ", result=%" PRId32 ")",
AICE_FORMAT_DTHMA, result);
return ERROR_FAIL;
}
data, AICE_LITTLE_ENDIAN);
if (cmd_ack_code == AICE_CMD_T_READ_EDMSR) {
- LOG_DEBUG("READ_EDMSR response, data: 0x%x", *data);
+ LOG_DEBUG("READ_EDMSR response, data: 0x%" PRIx32, *data);
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_T_READ_EDMSR, cmd_ack_code);
return ERROR_FAIL;
int aice_write_edmsr(uint8_t target_id, uint32_t address, uint32_t data)
{
- int result;
+ int32_t result;
int retry_times = 0;
if (AICE_COMMAND_MODE_PACK == aice_command_mode) {
aice_usb_write(usb_out_buffer, AICE_FORMAT_HTDMC);
- LOG_DEBUG("WRITE_EDMSR, COREID: %d, address: 0x%x, data: 0x%x",
+ LOG_DEBUG("WRITE_EDMSR, COREID: %" PRIu8 ", address: 0x%" PRIx32 ", data: 0x%" PRIx32,
target_id, address, data);
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHMB);
if (AICE_FORMAT_DTHMB != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)",
+ LOG_ERROR("aice_usb_read failed (requested=%" PRId32 ", result=%" PRId32 ")",
AICE_FORMAT_DTHMB, result);
return ERROR_FAIL;
}
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_T_WRITE_EDMSR, cmd_ack_code);
return ERROR_FAIL;
static int aice_write_dim(uint8_t target_id, uint32_t *word, uint8_t num_of_words)
{
- int result;
+ int32_t result;
uint32_t big_endian_word[4];
int retry_times = 0;
aice_usb_write(usb_out_buffer, AICE_FORMAT_HTDMC + (num_of_words - 1) * 4);
- LOG_DEBUG("WRITE_DIM, COREID: %d, data: 0x%08x, 0x%08x, 0x%08x, 0x%08x",
+ LOG_DEBUG("WRITE_DIM, COREID: %" PRIu8
+ ", data: 0x%08" PRIx32 ", 0x%08" PRIx32 ", 0x%08" PRIx32 ", 0x%08" PRIx32,
target_id,
big_endian_word[0],
big_endian_word[1],
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHMB);
if (AICE_FORMAT_DTHMB != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)", AICE_FORMAT_DTHMB, result);
+ LOG_ERROR("aice_usb_read failed (requested=%" PRId32 ", result=%" PRId32 ")", AICE_FORMAT_DTHMB, result);
return ERROR_FAIL;
}
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)", AICE_CMD_T_WRITE_DIM, cmd_ack_code);
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8
+ ", response=0x%" PRIx8 ")",
+ AICE_CMD_T_WRITE_DIM, cmd_ack_code);
return ERROR_FAIL;
}
static int aice_do_execute(uint8_t target_id)
{
- int result;
+ int32_t result;
int retry_times = 0;
if (AICE_COMMAND_MODE_PACK == aice_command_mode) {
aice_usb_write(usb_out_buffer, AICE_FORMAT_HTDMC);
- LOG_DEBUG("EXECUTE, COREID: %d", target_id);
+ LOG_DEBUG("EXECUTE, COREID: %" PRIu8 "", target_id);
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHMB);
if (AICE_FORMAT_DTHMB != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)",
+ LOG_ERROR("aice_usb_read failed (requested=%" PRId32 ", result=%" PRId32 ")",
AICE_FORMAT_DTHMB, result);
return ERROR_FAIL;
}
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_T_EXECUTE, cmd_ack_code);
return ERROR_FAIL;
int aice_write_mem_b(uint8_t target_id, uint32_t address, uint32_t data)
{
- int result;
+ int32_t result;
int retry_times = 0;
- LOG_DEBUG("WRITE_MEM_B, COREID: %d, ADDRESS %08" PRIx32 " VALUE %08" PRIx32,
+ LOG_DEBUG("WRITE_MEM_B, COREID: %" PRIu8 ", ADDRESS %08" PRIx32 " VALUE %08" PRIx32,
target_id,
address,
data);
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHMB);
if (AICE_FORMAT_DTHMB != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)", AICE_FORMAT_DTHMB, result);
+ LOG_ERROR("aice_usb_read failed (requested=%" PRId32
+ ", result=%" PRId32 ")", AICE_FORMAT_DTHMB, result);
return ERROR_FAIL;
}
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_T_WRITE_MEM_B, cmd_ack_code);
return ERROR_FAIL;
int aice_write_mem_h(uint8_t target_id, uint32_t address, uint32_t data)
{
- int result;
+ int32_t result;
int retry_times = 0;
- LOG_DEBUG("WRITE_MEM_H, COREID: %d, ADDRESS %08" PRIx32 " VALUE %08" PRIx32,
+ LOG_DEBUG("WRITE_MEM_H, COREID: %" PRIu8 ", ADDRESS %08" PRIx32 " VALUE %08" PRIx32,
target_id,
address,
data);
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHMB);
if (AICE_FORMAT_DTHMB != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)",
+ LOG_ERROR("aice_usb_read failed (requested=%" PRId32 ", result=%" PRId32 ")",
AICE_FORMAT_DTHMB, result);
return ERROR_FAIL;
}
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_T_WRITE_MEM_H, cmd_ack_code);
return ERROR_FAIL;
int aice_write_mem(uint8_t target_id, uint32_t address, uint32_t data)
{
- int result;
+ int32_t result;
int retry_times = 0;
- LOG_DEBUG("WRITE_MEM, COREID: %d, ADDRESS %08" PRIx32 " VALUE %08" PRIx32,
+ LOG_DEBUG("WRITE_MEM, COREID: %" PRIu8 ", ADDRESS %08" PRIx32 " VALUE %08" PRIx32,
target_id,
address,
data);
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHMB);
if (AICE_FORMAT_DTHMB != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)",
+ LOG_ERROR("aice_usb_read failed (requested=%" PRId32 ", result=%" PRId32 ")",
AICE_FORMAT_DTHMB, result);
return ERROR_FAIL;
}
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_T_WRITE_MEM, cmd_ack_code);
return ERROR_FAIL;
int aice_fastread_mem(uint8_t target_id, uint8_t *word, uint32_t num_of_words)
{
- int result;
+ int32_t result;
int retry_times = 0;
if ((AICE_COMMAND_MODE_PACK == aice_command_mode) ||
aice_usb_write(usb_out_buffer, AICE_FORMAT_HTDMB);
- LOG_DEBUG("FASTREAD_MEM, COREID: %d, # of DATA %08" PRIx32,
+ LOG_DEBUG("FASTREAD_MEM, COREID: %" PRIu8 ", # of DATA %08" PRIx32,
target_id, num_of_words);
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHMA + (num_of_words - 1) * 4);
if (result < 0) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)",
+ LOG_ERROR("aice_usb_read failed (requested=%" PRId32 ", result=%" PRId32 ")",
AICE_FORMAT_DTHMA + (num_of_words - 1) * 4, result);
return ERROR_FAIL;
}
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_T_FASTREAD_MEM, cmd_ack_code);
return ERROR_FAIL;
int aice_fastwrite_mem(uint8_t target_id, const uint8_t *word, uint32_t num_of_words)
{
- int result;
+ int32_t result;
int retry_times = 0;
if (AICE_COMMAND_MODE_PACK == aice_command_mode) {
aice_usb_write(usb_out_buffer, AICE_FORMAT_HTDMD + (num_of_words - 1) * 4);
- LOG_DEBUG("FASTWRITE_MEM, COREID: %d, # of DATA %08" PRIx32,
+ LOG_DEBUG("FASTWRITE_MEM, COREID: %" PRIu8 ", # of DATA %08" PRIx32,
target_id, num_of_words);
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHMB);
if (AICE_FORMAT_DTHMB != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)",
+ LOG_ERROR("aice_usb_read failed (requested=%" PRId32 ", result=%" PRId32 ")",
AICE_FORMAT_DTHMB, result);
return ERROR_FAIL;
}
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_T_FASTWRITE_MEM, cmd_ack_code);
return ERROR_FAIL;
int aice_read_mem_b(uint8_t target_id, uint32_t address, uint32_t *data)
{
- int result;
+ int32_t result;
int retry_times = 0;
if ((AICE_COMMAND_MODE_PACK == aice_command_mode) ||
aice_usb_write(usb_out_buffer, AICE_FORMAT_HTDMB);
- LOG_DEBUG("READ_MEM_B, COREID: %d", target_id);
+ LOG_DEBUG("READ_MEM_B, COREID: %" PRIu8 "", target_id);
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHMA);
if (AICE_FORMAT_DTHMA != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)",
+ LOG_ERROR("aice_usb_read failed (requested=%" PRId32 ", result=%" PRId32 ")",
AICE_FORMAT_DTHMA, result);
return ERROR_FAIL;
}
data, data_endian);
if (cmd_ack_code == AICE_CMD_T_READ_MEM_B) {
- LOG_DEBUG("READ_MEM_B response, data: 0x%02x", *data);
+ LOG_DEBUG("READ_MEM_B response, data: 0x%02" PRIx32, *data);
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_T_READ_MEM_B, cmd_ack_code);
return ERROR_FAIL;
int aice_read_mem_h(uint8_t target_id, uint32_t address, uint32_t *data)
{
- int result;
+ int32_t result;
int retry_times = 0;
if ((AICE_COMMAND_MODE_PACK == aice_command_mode) ||
aice_usb_write(usb_out_buffer, AICE_FORMAT_HTDMB);
- LOG_DEBUG("READ_MEM_H, CORE_ID: %d", target_id);
+ LOG_DEBUG("READ_MEM_H, CORE_ID: %" PRIu8 "", target_id);
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHMA);
if (AICE_FORMAT_DTHMA != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)",
+ LOG_ERROR("aice_usb_read failed (requested=%" PRId32 ", result=%" PRId32 ")",
AICE_FORMAT_DTHMA, result);
return ERROR_FAIL;
}
data, data_endian);
if (cmd_ack_code == AICE_CMD_T_READ_MEM_H) {
- LOG_DEBUG("READ_MEM_H response, data: 0x%x", *data);
+ LOG_DEBUG("READ_MEM_H response, data: 0x%" PRIx32, *data);
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_T_READ_MEM_H, cmd_ack_code);
return ERROR_FAIL;
int aice_read_mem(uint8_t target_id, uint32_t address, uint32_t *data)
{
- int result;
+ int32_t result;
int retry_times = 0;
if ((AICE_COMMAND_MODE_PACK == aice_command_mode) ||
aice_usb_write(usb_out_buffer, AICE_FORMAT_HTDMB);
- LOG_DEBUG("READ_MEM, COREID: %d", target_id);
+ LOG_DEBUG("READ_MEM, COREID: %" PRIu8 "", target_id);
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHMA);
if (AICE_FORMAT_DTHMA != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)",
+ LOG_ERROR("aice_usb_read failed (requested=%" PRId32 ", result=%" PRId32 ")",
AICE_FORMAT_DTHMA, result);
return ERROR_FAIL;
}
data, data_endian);
if (cmd_ack_code == AICE_CMD_T_READ_MEM) {
- LOG_DEBUG("READ_MEM response, data: 0x%x", *data);
+ LOG_DEBUG("READ_MEM response, data: 0x%" PRIx32, *data);
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_T_READ_MEM, cmd_ack_code);
return ERROR_FAIL;
int aice_batch_buffer_read(uint8_t buf_index, uint32_t *word, uint32_t num_of_words)
{
- int result;
+ int32_t result;
int retry_times = 0;
do {
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHMA + (num_of_words - 1) * 4);
if (result < 0) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)",
+ LOG_ERROR("aice_usb_read failed (requested=%" PRId32 ", result=%" PRId32 ")",
AICE_FORMAT_DTHMA + (num_of_words - 1) * 4, result);
return ERROR_FAIL;
}
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_BATCH_BUFFER_READ, cmd_ack_code);
return ERROR_FAIL;
int aice_batch_buffer_write(uint8_t buf_index, const uint8_t *word, uint32_t num_of_words)
{
- int result;
+ int32_t result;
int retry_times = 0;
if (num_of_words == 0)
result = aice_usb_read(usb_in_buffer, AICE_FORMAT_DTHMB);
if (AICE_FORMAT_DTHMB != result) {
- LOG_ERROR("aice_usb_read failed (requested=%d, result=%d)",
+ LOG_ERROR("aice_usb_read failed (requested=%" PRId32 ", result=%" PRId32 ")",
AICE_FORMAT_DTHMB, result);
return ERROR_FAIL;
}
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%x, response=0x%x)",
+ LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
AICE_CMD_BATCH_BUFFER_WRITE, cmd_ack_code);
return ERROR_FAIL;
* | SWID[30:16] | Reserved[15:14] | SUPRS_EXC[13] | IMP_EXC[12]
* | VECTOR[11:5] | INST[4] | Exc Type[3:0] |
*/
- LOG_INFO("EVA: 0x%08x", ir4_value);
- LOG_INFO("ITYPE: 0x%08x", ir6_value);
+ LOG_INFO("EVA: 0x%08" PRIx32, ir4_value);
+ LOG_INFO("ITYPE: 0x%08" PRIx32, ir6_value);
ir6_value = ir6_value & (~0x300); /* for MCU */
ir6_value = ir6_value & (~0x3000); /* for non-MCU */
if (i >= aice_count_to_check_dbger) {
if ((timeval_ms() - then) > 1000) {
LOG_ERROR("Timeout (1000ms) waiting for $DBGER status "
- "being 0x%08x", expect_status);
+ "being 0x%08" PRIx32, expect_status);
return ERROR_FAIL;
}
}
/** read DBGER.DPED */
if (aice_check_dbger(coreid, NDS_DBGER_DPED) != ERROR_OK) {
LOG_ERROR("<-- TARGET ERROR! Debug operations do not finish properly: "
- "0x%08x 0x%08x 0x%08x 0x%08x. -->",
+ "0x%08" PRIx32 "0x%08" PRIx32 "0x%08" PRIx32 "0x%08" PRIx32 ". -->",
insts[0],
insts[1],
insts[2],
static int aice_read_reg(uint32_t coreid, uint32_t num, uint32_t *val)
{
- LOG_DEBUG("aice_read_reg, reg_no: 0x%08x", num);
+ LOG_DEBUG("aice_read_reg, reg_no: 0x%08" PRIx32, num);
uint32_t instructions[4]; /** execute instructions in DIM */
static int aice_write_reg(uint32_t coreid, uint32_t num, uint32_t val)
{
- LOG_DEBUG("aice_write_reg, reg_no: 0x%08x, value: 0x%08x", num, val);
+ LOG_DEBUG("aice_write_reg, reg_no: 0x%08" PRIx32 ", value: 0x%08" PRIx32, num, val);
uint32_t instructions[4]; /** execute instructions in DIM */
uint32_t value_edmsw;
aice_read_reg(coreid, R1, &high_value);
- LOG_DEBUG("low: 0x%08x, high: 0x%08x\n", value, high_value);
+ LOG_DEBUG("low: 0x%08" PRIx32 ", high: 0x%08" PRIx32 "\n", value, high_value);
if (data_endian == AICE_BIG_ENDIAN)
*val = (((uint64_t)high_value) << 32) | value;
value = (val >> 32) & 0xFFFFFFFF;
}
- LOG_DEBUG("aice_usb_write_reg_64, %s, low: 0x%08x, high: 0x%08x\n",
+ LOG_DEBUG("aice_usb_write_reg_64, %s, low: 0x%08" PRIx32 ", high: 0x%08" PRIx32 "\n",
nds32_reg_simple_name(num), value, high_value);
aice_write_reg(coreid, R1, high_value);
if (aice_read_ctrl(AICE_READ_CTRL_GET_FPGA_VERSION, &fpga_version) != ERROR_OK)
return ERROR_FAIL;
- LOG_INFO("AICE version: hw_ver = 0x%x, fw_ver = 0x%x, fpga_ver = 0x%x",
+ LOG_INFO("AICE version: hw_ver = 0x%" PRIx32 ", fw_ver = 0x%" PRIx32 ", fpga_ver = 0x%" PRIx32,
hardware_version, firmware_version, fpga_version);
return ERROR_OK;
* So, clear DEX_USE_PSW by force. */
host_edm_ctl &= ~(0x40000000);
- LOG_DEBUG("aice_init_edm_registers - EDM_CTL: 0x%08x", host_edm_ctl);
+ LOG_DEBUG("aice_init_edm_registers - EDM_CTL: 0x%08" PRIx32, host_edm_ctl);
int result = aice_write_edmsr(coreid, NDS_EDM_SR_EDM_CTL, host_edm_ctl);
else
core_info[coreid].dex_use_psw_on = false;
- LOG_DEBUG("aice_backup_edm_registers - EDM_CTL: 0x%08x, DEX_USE_PSW: %s",
+ LOG_DEBUG("aice_backup_edm_registers - EDM_CTL: 0x%08" PRIx32 ", DEX_USE_PSW: %s",
core_info[coreid].edm_ctl_backup,
core_info[coreid].dex_use_psw_on ? "on" : "off");
aice_read_dtr(coreid, &core_info[coreid].target_dtr_backup);
core_info[coreid].target_dtr_valid = true;
- LOG_DEBUG("Backup target DTR: 0x%08x", core_info[coreid].target_dtr_backup);
+ LOG_DEBUG("Backup target DTR: 0x%08" PRIx32, core_info[coreid].target_dtr_backup);
} else {
core_info[coreid].target_dtr_valid = false;
}
aice_read_dtr(coreid, &core_info[coreid].host_dtr_backup);
core_info[coreid].host_dtr_valid = true;
- LOG_DEBUG("Backup host DTR: 0x%08x", core_info[coreid].host_dtr_backup);
+ LOG_DEBUG("Backup host DTR: 0x%08" PRIx32, core_info[coreid].host_dtr_backup);
} else {
core_info[coreid].host_dtr_valid = false;
}
- LOG_DEBUG("r0: 0x%08x, r1: 0x%08x",
+ LOG_DEBUG("r0: 0x%08" PRIx32 ", r1: 0x%08" PRIx32,
core_info[coreid].r0_backup, core_info[coreid].r1_backup);
return ERROR_OK;
static int aice_restore_tmp_registers(uint32_t coreid)
{
- LOG_DEBUG("restore_tmp_registers - r0: 0x%08x, r1: 0x%08x",
+ LOG_DEBUG("restore_tmp_registers - r0: 0x%08" PRIx32 ", r1: 0x%08" PRIx32,
core_info[coreid].r0_backup, core_info[coreid].r1_backup);
if (core_info[coreid].target_dtr_valid) {
instructions[3] = BEQ_MINUS_12;
aice_execute_dim(coreid, instructions, 4);
- LOG_DEBUG("Restore target DTR: 0x%08x", core_info[coreid].target_dtr_backup);
+ LOG_DEBUG("Restore target DTR: 0x%08" PRIx32, core_info[coreid].target_dtr_backup);
}
aice_write_reg(coreid, R0, core_info[coreid].r0_backup);
if (core_info[coreid].host_dtr_valid) {
aice_write_dtr(coreid, core_info[coreid].host_dtr_backup);
- LOG_DEBUG("Restore host DTR: 0x%08x", core_info[coreid].host_dtr_backup);
+ LOG_DEBUG("Restore host DTR: 0x%08" PRIx32, core_info[coreid].host_dtr_backup);
}
return ERROR_OK;
aice_read_reg(coreid, IR11, &ir11_value);
LOG_ERROR("<-- TARGET ERROR! Reaching the max interrupt stack level; "
- "CPU is stalled at 0x%08x for debugging. -->", ir11_value);
+ "CPU is stalled at 0x%08" PRIx32 " for debugging. -->", ir11_value);
*state = AICE_TARGET_HALTED;
} else if ((dbger_value & NDS_DBGER_CRST) == NDS_DBGER_CRST) {
static int aice_usb_read_memory_unit(uint32_t coreid, uint32_t addr, uint32_t size,
uint32_t count, uint8_t *buffer)
{
- LOG_DEBUG("aice_usb_read_memory_unit, addr: 0x%08x, size: %d, count: %d",
+ LOG_DEBUG("aice_usb_read_memory_unit, addr: 0x%08" PRIx32
+ ", size: %" PRIu32 ", count: %" PRIu32 "",
addr, size, count);
if (NDS_MEMORY_ACC_CPU == core_info[coreid].access_channel)
static int aice_usb_write_memory_unit(uint32_t coreid, uint32_t addr, uint32_t size,
uint32_t count, const uint8_t *buffer)
{
- LOG_DEBUG("aice_usb_write_memory_unit, addr: 0x%08x, size: %d, count: %d",
+ LOG_DEBUG("aice_usb_write_memory_unit, addr: 0x%08" PRIx32
+ ", size: %" PRIu32 ", count: %" PRIu32 "",
addr, size, count);
if (NDS_MEMORY_ACC_CPU == core_info[coreid].access_channel)
static int aice_usb_bulk_read_mem(uint32_t coreid, uint32_t addr,
uint32_t length, uint8_t *buffer)
{
- LOG_DEBUG("aice_usb_bulk_read_mem, addr: 0x%08x, length: 0x%08x", addr, length);
+ LOG_DEBUG("aice_usb_bulk_read_mem, addr: 0x%08" PRIx32 ", length: 0x%08" PRIx32, addr, length);
int retval;
static int aice_usb_bulk_write_mem(uint32_t coreid, uint32_t addr,
uint32_t length, const uint8_t *buffer)
{
- LOG_DEBUG("aice_usb_bulk_write_mem, addr: 0x%08x, length: 0x%08x", addr, length);
+ LOG_DEBUG("aice_usb_bulk_write_mem, addr: 0x%08" PRIx32 ", length: 0x%08" PRIx32, addr, length);
int retval;
static int aice_usb_memory_access(uint32_t coreid, enum nds_memory_access channel)
{
- LOG_DEBUG("aice_usb_memory_access, access channel: %d", channel);
+ LOG_DEBUG("aice_usb_memory_access, access channel: %u", channel);
core_info[coreid].access_channel = channel;
if (core_info[coreid].memory_select == mem_select)
return ERROR_OK;
- LOG_DEBUG("aice_usb_memory_mode, memory select: %d", mem_select);
+ LOG_DEBUG("aice_usb_memory_mode, memory select: %u", mem_select);
core_info[coreid].memory_select = mem_select;
static int aice_usb_read_tlb(uint32_t coreid, uint32_t virtual_address,
uint32_t *physical_address)
{
- LOG_DEBUG("aice_usb_read_tlb, virtual address: 0x%08x", virtual_address);
+ LOG_DEBUG("aice_usb_read_tlb, virtual address: 0x%08" PRIx32, virtual_address);
uint32_t instructions[4];
uint32_t probe_result;
icache->log2_line_size = 0;
}
- LOG_DEBUG("\ticache set: %d, way: %d, line size: %d, "
- "log2(set): %d, log2(line_size): %d",
+ LOG_DEBUG("\ticache set: %" PRIu32 ", way: %" PRIu32 ", line size: %" PRIu32 ", "
+ "log2(set): %" PRIu32 ", log2(line_size): %" PRIu32 "",
icache->set, icache->way, icache->line_size,
icache->log2_set, icache->log2_line_size);
dcache->log2_line_size = 0;
}
- LOG_DEBUG("\tdcache set: %d, way: %d, line size: %d, "
- "log2(set): %d, log2(line_size): %d",
+ LOG_DEBUG("\tdcache set: %" PRIu32 ", way: %" PRIu32 ", line size: %" PRIu32 ", "
+ "log2(set): %" PRIu32 ", log2(line_size): %" PRIu32 "",
dcache->set, dcache->way, dcache->line_size,
dcache->log2_set, dcache->log2_line_size);
if (aice_check_dbger(coreid, NDS_DBGER_DPED) != ERROR_OK) {
LOG_ERROR("<-- TARGET ERROR! Debug operations do not finish properly:"
- "0x%08x 0x%08x 0x%08x 0x%08x. -->",
+ "0x%08" PRIx32 " 0x%08" PRIx32 " 0x%08" PRIx32 " 0x%08" PRIx32 ". -->",
dim_instructions[0],
dim_instructions[1],
dim_instructions[2],
instruction->access_end = instruction->access_start + 1;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLBI\t$r%d,[$r%d+#%d]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLBI\t$r%" PRIu8 ",[$r%" PRIu8 "+#%" PRId32 "]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 2;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLHI\t$r%d,[$r%d+#%d]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLHI\t$r%" PRIu8 ",[$r%" PRIu8 "+#%" PRId32 "]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLWI\t$r%d,[$r%d+#%d]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLWI\t$r%" PRIu8 ",[$r%" PRIu8 "+#%" PRId32 "]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 1;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLBI.bi\t$r%d,[$r%d],#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLBI.bi\t$r%" PRIu8 ",[$r%" PRIu8 "],#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 2;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLHI.bi\t$r%d,[$r%d],#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLHI.bi\t$r%" PRIu8 ",[$r%" PRIu8 "],#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLWI.bi\t$r%d,[$r%d],#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLWI.bi\t$r%" PRIu8 ",[$r%" PRIu8 "],#%" PRId32 "",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 1;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSBI\t$r%d,[$r%d+#%d]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSBI\t$r%" PRIu8 ",[$r%" PRIu8 "+#%" PRId32 "]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 2;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSHI\t$r%d,[$r%d+#%d]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSHI\t$r%" PRIu8 ",[$r%" PRIu8 "+#%" PRId32 "]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSWI\t$r%d,[$r%d+#%d]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSWI\t$r%" PRIu8 ",[$r%" PRIu8 "+#%" PRId32 "]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 1;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSBI.bi\t$r%d,[$r%d],#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSBI.bi\t$r%" PRIu8 ",[$r%" PRIu8 "],#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 2;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSHI.bi\t$r%d,[$r%d],#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSHI.bi\t$r%" PRIu8 ",[$r%" PRIu8 "],#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSWI.bi\t$r%d,[$r%d],#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSWI.bi\t$r%" PRIu8 ",[$r%" PRIu8 "],#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 1;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLBSI\t$r%d,[$r%d+#%d]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLBSI\t$r%" PRIu8 ",[$r%" PRIu8 "+#%" PRId32 "]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 2;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLHSI\t$r%d,[$r%d+#%d]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLHSI\t$r%" PRIu8 ",[$r%" PRIu8 "+#%" PRId32 "]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->info.imm = (instruction->info.imm << 17) >> 14;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tDPREFI.d\t%d,[$r%d+#%d]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tDPREFI.d\t%" PRIu8 ",[$r%" PRIu8 "+#%" PRId32 "]",
address,
opcode, instruction->info.sub_opc,
instruction->info.ra, instruction->info.imm);
instruction->info.imm = (instruction->info.imm << 17) >> 15;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tDPREFI.w\t%d,[$r%d+#%d]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tDPREFI.w\t%" PRIu8 ",[$r%" PRIu8 "+#%" PRId32 "]",
address,
opcode, instruction->info.sub_opc,
instruction->info.ra, instruction->info.imm);
instruction->access_end = instruction->access_start + 1;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLBSI.bi\t$r%d,[$r%d],#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLBSI.bi\t$r%" PRIu8 ",[$r%" PRIu8 "],#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 2;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLHSI.bi\t$r%d,[$r%d],#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLHSI.bi\t$r%" PRIu8 ",[$r%" PRIu8 "],#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 1;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLBSI.gp\t$r%d,[#%d]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLBSI.gp\t$r%" PRIu8 ",[#%" PRId32 "]",
address,
opcode, instruction->info.rt, instruction->info.imm);
} else { /* LBI.gp */
instruction->access_end = instruction->access_start + 1;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLBI.gp\t$r%d,[#%d]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLBI.gp\t$r%" PRIu8 ",[#%" PRId32 "]",
address,
opcode, instruction->info.rt, instruction->info.imm);
}
instruction->access_end = instruction->access_start + 1;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLB\t$r%d,[$r%d+($r%d<<%d)]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLB\t$r%" PRIu8 ",[$r%" PRIu8 "+($r%" PRIu8 "<<%" PRId32 ")]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
instruction->access_end = instruction->access_start + 2;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLH\t$r%d,[$r%d+($r%d<<%d)]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLH\t$r%" PRIu8 ",[$r%" PRIu8 "+($r%" PRIu8 "<<%" PRId32 ")]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLW\t$r%d,[$r%d+($r%d<<%d)]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLW\t$r%" PRIu8 ",[$r%" PRIu8 "+($r%" PRIu8 "<<%" PRId32 ")]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
instruction->access_end = instruction->access_start + 1;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLB.bi\t$r%d,[$r%d],($r%d<<%d)",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLB.bi\t$r%" PRIu8 ",[$r%" PRIu8 "],($r%" PRIu8 "<<%" PRId32 ")",
address,
opcode, instruction->info.rt,
instruction->info.ra, instruction->info.rb,
instruction->access_end = instruction->access_start + 2;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLH.bi\t$r%d,[$r%d],($r%d<<%d)",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLH.bi\t$r%" PRIu8 ",[$r%" PRIu8 "],($r%" PRIu8 "<<%" PRId32 ")",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLW.bi\t$r%d,[$r%d],($r%d<<%d)",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLW.bi\t$r%" PRIu8 ",[$r%" PRIu8 "],($r%" PRIu8 "<<%" PRId32 ")",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
instruction->access_end = instruction->access_start + 1;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSB\t$r%d,[$r%d+($r%d<<%d)]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSB\t$r%" PRIu8 ",[$r%" PRIu8 "+($r%" PRIu8 "<<%" PRId32 ")]",
address,
opcode, instruction->info.rt,
instruction->info.ra, instruction->info.rb,
instruction->access_end = instruction->access_start + 2;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSH\t$r%d,[$r%d+($r%d<<%d)]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSH\t$r%" PRIu8 ",[$r%" PRIu8 "+($r%" PRIu8 "<<%" PRId32 ")]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSW\t$r%d,[$r%d+($r%d<<%d)]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSW\t$r%" PRIu8 ",[$r%" PRIu8 "+($r%" PRIu8 "<<%" PRId32 ")]",
address,
opcode, instruction->info.rt,
instruction->info.ra, instruction->info.rb,
instruction->access_end = instruction->access_start + 1;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSB.bi\t$r%d,[$r%d],($r%d<<%d)",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSB.bi\t$r%" PRIu8 ",[$r%" PRIu8 "],($r%" PRIu8 "<<%" PRId32 ")",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
instruction->access_end = instruction->access_start + 2;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSH.bi\t$r%d,[$r%d],($r%d<<%d)",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSH.bi\t$r%" PRIu8 ",[$r%" PRIu8 "],($r%" PRIu8 "<<%" PRId32 ")",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSW.bi\t$r%d,[$r%d],($r%d<<%d)",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSW.bi\t$r%" PRIu8 ",[$r%" PRIu8 "],($r%" PRIu8 "<<%" PRId32 ")",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
instruction->access_end = instruction->access_start + 1;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLBS\t$r%d,[$r%d+($r%d<<%d)]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLBS\t$r%" PRIu8 ",[$r%" PRIu8 "+($r%" PRIu8 "<<%" PRId32 ")]",
address,
opcode, instruction->info.rt,
instruction->info.ra, instruction->info.rb,
instruction->access_end = instruction->access_start + 2;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLHS\t$r%d,[$r%d+($r%d<<%d)]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLHS\t$r%" PRIu8 ",[$r%" PRIu8 "+($r%" PRIu8 "<<%" PRId32 ")]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
instruction->type = NDS32_INSN_MISC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tDPREF\t#%d,[$r%d+($r%d<<#%d)]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tDPREF\t#%" PRIu8 ",[$r%" PRIu8 "+($r%" PRIu8 "<<#%" PRId32 ")]",
address,
opcode, instruction->info.sub_opc,
instruction->info.ra, instruction->info.rb,
instruction->access_end = instruction->access_start + 1;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLBS.bi\t$r%d,[$r%d],($r%d<<%d)",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLBS.bi\t$r%" PRIu8 ",[$r%" PRIu8 "],($r%" PRIu8 "<<%" PRId32 ")",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
instruction->access_end = instruction->access_start + 2;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLHS.bi\t$r%d,[$r%d],($r%d<<%d)",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLHS.bi\t$r%" PRIu8 ",[$r%" PRIu8 "],($r%" PRIu8 "<<%" PRId32 ")",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLLW\t$r%d,[$r%d+($r%d<<%d)]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLLW\t$r%" PRIu8 ",[$r%" PRIu8 "+($r%" PRIu8 "<<%" PRId32 ")]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSCW\t$r%d,[$r%d+($r%d<<%d)]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSCW\t$r%" PRIu8 ",[$r%" PRIu8 "+($r%" PRIu8 "<<%" PRId32 ")]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
instruction->access_end = instruction->access_start + 1;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLBUP\t$r%d,[$r%d+($r%d<<%d)]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLBUP\t$r%" PRIu8 ",[$r%" PRIu8 "+($r%" PRIu8 "<<%" PRId32 ")]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLWUP\t$r%d,[$r%d+($r%d<<%d)]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLWUP\t$r%" PRIu8 ",[$r%" PRIu8 "+($r%" PRIu8 "<<%" PRId32 ")]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
instruction->access_end = instruction->access_start + 1;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSBUP\t$r%d,[$r%d+($r%d<<%d)]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSBUP\t$r%" PRIu8 ",[$r%" PRIu8 "+($r%" PRIu8 "<<%" PRId32 ")]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSWUP\t$r%d,[$r%d+($r%d<<%d)]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSWUP\t$r%" PRIu8 ",[$r%" PRIu8 "+($r%" PRIu8 "<<%" PRId32 ")]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
nds32_calculate_lsmw_access_range(nds32, instruction);
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSMW\t$r%d,[$r%d],$r%d,%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSMW\t$r%" PRIu8 ",[$r%" PRIu8 "],$r%" PRIu8 ",%" PRId32,
address,
opcode, instruction->info.rb, instruction->info.ra,
instruction->info.rd,
nds32_calculate_lsmw_access_range(nds32, instruction);
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSMWA\t$r%d,[$r%d],$r%d,%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSMWA\t$r%" PRIu8 ",[$r%" PRIu8 "],$r%" PRIu8 ",%" PRId32,
address,
opcode, instruction->info.rb, instruction->info.ra,
instruction->info.rd,
/* TODO: calculate access_start/access_end */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSMWZB\t$r%d,[$r%d],$r%d,%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSMWZB\t$r%" PRIu8 ",[$r%" PRIu8 "],$r%" PRIu8 ",%" PRId32,
address,
opcode, instruction->info.rb, instruction->info.ra,
instruction->info.rd,
nds32_calculate_lsmw_access_range(nds32, instruction);
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLMW\t$r%d,[$r%d],$r%d,%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLMW\t$r%" PRIu8 ",[$r%" PRIu8 "],$r%" PRIu8 ",%" PRId32,
address,
opcode, instruction->info.rb, instruction->info.ra,
instruction->info.rd,
nds32_calculate_lsmw_access_range(nds32, instruction);
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLMWA\t$r%d,[$r%d],$r%d,%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLMWA\t$r%" PRIu8 ",[$r%" PRIu8 "],$r%" PRIu8 ",%" PRId32,
address,
opcode, instruction->info.rb, instruction->info.ra,
instruction->info.rd,
/* TODO: calculate access_start/access_end */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLMWZB\t$r%d,[$r%d],$r%d,%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLMWZB\t$r%" PRIu8 ",[$r%" PRIu8 "],$r%" PRIu8 ",%" PRId32,
address,
opcode, instruction->info.rb, instruction->info.ra,
instruction->info.rd,
instruction->access_end = instruction->access_start + 2;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLHI.gp\t$r%d,[#%d]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLHI.gp\t$r%" PRIu8 ",[#%" PRId32"]",
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
instruction->access_end = instruction->access_start + 2;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLHSI.gp\t$r%d,[#%d]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLHSI.gp\t$r%" PRIu8 ",[#%" PRId32 "]",
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
instruction->access_end = instruction->access_start + 2;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSHI.gp\t$r%d,[#%d]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSHI.gp\t$r%" PRIu8 ",[#%" PRId32 "]",
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSWI.gp\t$r%d,[#%d]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSWI.gp\t$r%" PRIu8 ",[#%" PRId32 "]",
address,
opcode, instruction->info.rt, instruction->info.imm);
} else { /* LWI.gp */
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tLWI.gp\t$r%d,[#%d]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tLWI.gp\t$r%" PRIu8 ",[#%" PRId32 "]",
address,
opcode, instruction->info.rt, instruction->info.imm);
}
instruction->access_end = instruction->access_start + 1;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSBI.gp\t$r%d,[#%d]",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSBI.gp\t$r%" PRIu8 ",[#%" PRId32 "]",
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tADDI.gp\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tADDI.gp\t$r%" PRIu8 ",#%" PRId32 "",
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
if (instruction->info.imm)
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tADD_SLLI\t$r%d,$r%d,$r%d,%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tADD_SLLI\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8 ",%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
else
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tADD\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tADD\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
if (instruction->info.imm)
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSUB_SLLI\t$r%d,$r%d,$r%d,%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSUB_SLLI\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8 ",%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
else
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSUB\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSUB\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8 "",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
if (instruction->info.imm)
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tAND_SLLI\t$r%d,$r%d,$r%d,%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tAND_SLLI\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8 ",%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
else
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tAND\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tAND\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8 "",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
if (instruction->info.imm)
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tXOR_SLLI\t$r%d,$r%d,$r%d,%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tXOR_SLLI\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8 ",%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
else
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tXOR\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tXOR\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
if (instruction->info.imm)
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tOR_SLLI\t$r%d,$r%d,$r%d,%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tOR_SLLI\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8 ",%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
else
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tOR\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tOR\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tNOR\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tNOR\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSLT\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSLT\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSLTS\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSLTS\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSLLI\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSLLI\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSRLI\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSRLI\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSRAI\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSRAI\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tROTRI\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tROTRI\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSLL\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSLL\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSRL\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSRL\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSRA\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSRA\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tROTR\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tROTR\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSEB\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSEB\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
}
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSEH\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSEH\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
}
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tBITC\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tBITC\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tZEH\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tZEH\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
}
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tWSBH\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tWSBH\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
}
if (instruction->info.imm)
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tOR_SRLI\t$r%d,$r%d,$r%d,%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tOR_SRLI\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8 ",%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
else
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tOR\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tOR\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tDIVSR\t$r%d,$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tDIVSR\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tDIVR\t$r%d,$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tDIVR\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSVA\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSVA\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSVS\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSVS\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_MISC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tCMOVZ\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tCMOVZ\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_MISC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tCMOVN\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tCMOVN\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
if (instruction->info.imm)
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tADD_SRLI\t$r%d,$r%d,$r%d,%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tADD_SRLI\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8 ",%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
else
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tADD\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tADD\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
if (instruction->info.imm)
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSUB_SRLI\t$r%d,$r%d,$r%d,%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSUB_SRLI\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8 ",%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
else
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSUB\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSUB\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
if (instruction->info.imm)
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tAND_SRLI\t$r%d,$r%d,$r%d,%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tAND_SRLI\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8 ",%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
else
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tAND\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tAND\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
if (instruction->info.imm)
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tXOR_SRLI\t$r%d,$r%d,$r%d,%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tXOR_SRLI\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8 ",%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb,
else
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tXOR\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tXOR\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tMAX\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tMAX\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tMIN\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tMIN\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tAVE\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tAVE\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tAVE\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tAVE\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
break;
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tCLIPS\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tCLIPS\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tCLIP\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tCLIP\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tCLO\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tCLO\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
break;
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tCLZ\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tCLZ\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
break;
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tBSET\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tBSET\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tBCLR\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tBCLR\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tBTGL\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tBTGL\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tBTST\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tBTST\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tBSE\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tBSE\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tBSP\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tBSP\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tFFB\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tFFB\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tFFMISM\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tFFMISM\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tFFZMISM\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tFFZMISM\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_RESOURCE_ACCESS;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tMFUSR\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tMFUSR\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt,
(instruction->info.imm >> 10) & 0x3FF);
instruction->type = NDS32_INSN_RESOURCE_ACCESS;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tMTUSR\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tMTUSR\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt,
(instruction->info.imm >> 10) & 0x3FF);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tMUL\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tMUL\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tMULTS64\t$D%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tMULTS64\t$D%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, (dt_val >> 1) & 0x1, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tMULT64\t$D%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tMULT64\t$D%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, (dt_val >> 1) & 0x1, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tMADDS64\t$D%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tMADDS64\t$D%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, (dt_val >> 1) & 0x1, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tMADD64\t$D%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tMADD64\t$D%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, (dt_val >> 1) & 0x1, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tMSUBS64\t$D%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tMSUBS64\t$D%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, (dt_val >> 1) & 0x1, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tMSUB64\t$D%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tMSUB64\t$D%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, (dt_val >> 1) & 0x1, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tDIVS\t$D%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tDIVS\t$D%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, (dt_val >> 1) & 0x1, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tDIV\t$D%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tDIV\t$D%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, (dt_val >> 1) & 0x1, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tMULT32\t$D%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tMULT32\t$D%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, (dt_val >> 1) & 0x1, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tMADD32\t$D%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tMADD32\t$D%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, (dt_val >> 1) & 0x1, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tMSUB32\t$D%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tMSUB32\t$D%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, (dt_val >> 1) & 0x1, instruction->info.ra,
instruction->info.rb);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tMOVI\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tMOVI\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSETHI\t$r%d,0x%8.8" PRIx32,
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSETHI\t$r%" PRIu8 ",0x%8.8" PRIx32,
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
if ((instruction->info.imm >> 24) & 0x1) { /* JAL */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tJAL\t#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tJAL\t#%" PRId32,
address,
opcode, instruction->info.imm);
} else { /* J */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tJ\t#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tJ\t#%" PRId32,
address,
opcode, instruction->info.imm);
}
if (imm & 0x20) { /* RET */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tRET\t$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tRET\t$r%" PRIu8,
address,
opcode, instruction->info.rb);
} else { /* JR */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tJR\t$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tJR\t$r%" PRIu8,
address,
opcode, instruction->info.rb);
}
instruction->info.rt = (imm >> 20) & 0x1F;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tJRAL\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tJRAL\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.rb);
break;
case 2: /* JRNEZ */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tJRNEZ\t$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tJRNEZ\t$r%" PRIu8,
address,
opcode, instruction->info.rb);
break;
if (instruction->info.rt == R30)
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tJRALNEZ\t$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tJRALNEZ\t$r%" PRIu8,
address,
opcode, instruction->info.rb);
else
snprintf(instruction->text,
128,
"0x%8.8" PRIx32 "\t0x%8.8" PRIx32
- "\tJRALNEZ\t$r%d,$r%d",
+ "\tJRALNEZ\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode,
instruction->info.rt,
instruction->info.imm = (instruction->info.imm << 18) >> 18;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tBNE\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tBNE\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->info.imm = (instruction->info.imm << 18) >> 18;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tBEQ\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tBEQ\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt,
instruction->info.ra,
instruction->info.imm = (instruction->info.imm << 16) >> 16;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tBEQZ\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tBEQZ\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
instruction->info.imm = (instruction->info.imm << 16) >> 16;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tBNEZ\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tBNEZ\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
instruction->info.imm = (instruction->info.imm << 16) >> 16;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tBGEZ\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tBGEZ\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
instruction->info.imm = (instruction->info.imm << 16) >> 16;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tBLTZ\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tBLTZ\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
instruction->info.imm = (instruction->info.imm << 16) >> 16;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tBGTZ\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tBGTZ\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
instruction->info.imm = (instruction->info.imm << 16) >> 16;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tBLEZ\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tBLEZ\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
instruction->info.imm = (instruction->info.imm << 16) >> 16;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tBGEZAL\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tBGEZAL\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
instruction->info.imm = (instruction->info.imm << 16) >> 16;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tBLTZAL\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tBLTZAL\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tADDI\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tADDI\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSUBRI\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSUBRI\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tANDI\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tANDI\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tXORI\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tXORI\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tORI\t$r%d,$r%d,0x%8.8" PRIx32,
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tORI\t$r%" PRIu8 ",$r%" PRIu8 ",0x%8.8" PRIx32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSLTI\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSLTI\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSLTSI\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSLTSI\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->type = NDS32_INSN_MISC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSTANDBY\t#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSTANDBY\t#%" PRIu32,
address,
opcode, (opcode >> 5) & 0x3);
break;
instruction->type = NDS32_INSN_RESOURCE_ACCESS;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tMFSR\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tMFSR\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt,
(instruction->info.imm >> 10) & 0x3FF);
instruction->type = NDS32_INSN_RESOURCE_ACCESS;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tMTSR\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tMTSR\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.ra,
(instruction->info.imm >> 10) & 0x3FF);
instruction->type = NDS32_INSN_MISC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tTRAP\t#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tTRAP\t#%" PRId32,
address,
opcode, (imm >> 5) & 0x7FFF);
break;
instruction->type = NDS32_INSN_MISC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tTEQZ\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tTEQZ\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.ra,
(instruction->info.imm >> 5) & 0x7FFF);
instruction->type = NDS32_INSN_MISC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tTNEZ\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tTNEZ\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.ra,
(instruction->info.imm >> 5) & 0x7FFF);
instruction->info.imm = (imm >> 5) & 0x7FFF;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tBREAK\t#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tBREAK\t#%" PRId32,
address,
opcode, instruction->info.imm);
break;
instruction->type = NDS32_INSN_MISC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tSYSCALL\t#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tSYSCALL\t#%" PRId32,
address,
opcode, (imm >> 5) & 0x7FFF);
break;
instruction->type = NDS32_INSN_MISC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tMSYNC\t#%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tMSYNC\t#%" PRId32,
address,
opcode, (imm >> 5) & 0x7);
break;
instruction->type = NDS32_INSN_MISC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tISYNC\t$r%d",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "\tISYNC\t$r%" PRIu8,
address,
opcode, instruction->info.ra);
break;
instruction->type = NDS32_INSN_MISC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tMOV55\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tMOV55\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
break;
instruction->type = NDS32_INSN_MISC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tMOVI55\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tMOVI55\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
if (nds32_extract_field_8u(opcode, 9, 1) == 0) { /* ADD45 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tADD45\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tADD45\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.rb);
} else { /* SUB45 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tSUB45\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tSUB45\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.rb);
}
if (nds32_extract_field_8u(opcode, 9, 1) == 0) { /* ADDI45 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tADDI45\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tADDI45\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
} else { /* SUBI45 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tSUBI45\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tSUBI45\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
}
if (nds32_extract_field_8u(opcode, 9, 1) == 0) { /* SRAI45 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tSRAI45\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tSRAI45\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
} else { /* SRLI45 */
if ((instruction->info.rt == 0) && (instruction->info.imm == 0)) {
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tNOP",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16 "\t\tNOP",
address,
opcode);
} else {
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tSRLI45\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tSRLI45\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
}
instruction->info.imm = nds32_extract_field_8u(opcode, 0, 3);
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tSLLI333\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tSLLI333\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
case 0: /* ZEB33 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tZEB33\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tZEB33\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
break;
case 1: /* ZEH33 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tZEH33\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tZEH33\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
break;
case 2: /* SEB33 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tSEB33\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tSEB33\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
break;
case 3: /* SEH33 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tSEH33\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tSEH33\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
break;
case 4: /* XLSB33 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tXLSB33\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tXLSB33\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
break;
case 5: /* XLLB33 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tXLLB33\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tXLLB33\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
break;
instruction->info.imm = nds32_extract_field_8u(opcode, 3, 3);
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tBMSKI33\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tBMSKI33\t$r%" PRIu8 ",$r%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
instruction->info.imm = nds32_extract_field_8u(opcode, 3, 3);
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tFEXTI33\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tFEXTI33\t$r%" PRIu8 ",$r%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
default:
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx16
"\tUNDEFINED INSTRUCTION",
address,
opcode);
if (nds32_extract_field_8u(opcode, 9, 1) == 0) { /* ADD333 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tADD333\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tADD333\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
} else { /* SUB333 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tSUB333\t$r%d,$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tSUB333\t$r%" PRIu8 ",$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.rb);
if (nds32_extract_field_8u(opcode, 9, 1) == 0) { /* ADDI333 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tADDI333\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tADDI333\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
} else { /* SUBI333 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tSUBI333\t$r%d,$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tSUBI333\t$r%" PRIu8 ",$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
default:
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tUNDEFINED INSTRUCTION",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx16 "\tUNDEFINED INSTRUCTION",
address,
opcode);
return ERROR_FAIL;
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tLWI333\t$r%d,[$r%d+(#%d)]",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tLWI333\t$r%" PRIu8 ",[$r%" PRIu8 "+(#%" PRId32 ")]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tLWI333.BI\t$r%d,[$r%d],#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tLWI333.BI\t$r%" PRIu8 ",[$r%" PRIu8 "],#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm << 2);
instruction->access_end = instruction->access_start + 2;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tLHI333\t$r%d,[$r%d+(#%d)]",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tLHI333\t$r%" PRIu8 ",[$r%" PRIu8 "+(#%" PRId32 ")]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 1;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tLBI333\t$r%d,[$r%d+(#%d)]",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tLBI333\t$r%" PRIu8 ",[$r%" PRIu8 "+(#%" PRId32 ")]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tSWI333\t$r%d,[$r%d+(#%d)]",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tSWI333\t$r%" PRIu8 ",[$r%" PRIu8 "+(#%" PRId32 ")]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tSWI333.BI\t$r%d,[$r%d],#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tSWI333.BI\t$r%" PRIu8 ",[$r%" PRIu8 "],#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 2;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tSHI333\t$r%d,[$r%d+(#%d)]",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tSHI333\t$r%" PRIu8 ",[$r%" PRIu8 "+(#%" PRId32 ")]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->access_end = instruction->access_start + 1;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tSHI333\t$r%d,[$r%d+(#%d)]",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tSHI333\t$r%" PRIu8 ",[$r%" PRIu8 "+(#%" PRId32 ")]",
address,
opcode, instruction->info.rt, instruction->info.ra,
instruction->info.imm);
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tADDRI36.SP\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tADDRI36.SP\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tLWI45.FE\t$r%d,[#%d]",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tLWI45.FE\t$r%" PRIu8 ",[#%" PRId32 "]",
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tLWI450\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tLWI450\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
break;
instruction->access_end = instruction->access_start + 4;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tSWI450\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tSWI450\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
break;
if (nds32_extract_field_8u(opcode, 7, 1) == 0) { /* LWI37 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tLWI37\t$r%d,[fp+#%d]",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tLWI37\t$r%" PRIu8 ",[fp+#%" PRId32 "]",
address,
opcode, instruction->info.rt, instruction->info.imm);
} else { /* SWI37 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tSWI37\t$r%d,[fp+#%d]",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tSWI37\t$r%" PRIu8 ",[fp+#%" PRId32 "]",
address,
opcode, instruction->info.rt, instruction->info.imm);
}
default: /* ERROR */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tUNDEFINED INSTRUCTION",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx16 "\tUNDEFINED INSTRUCTION",
address,
opcode);
return ERROR_FAIL;
instruction->type = NDS32_INSN_JUMP_BRANCH;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tBEQZ38\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tBEQZ38\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
instruction->type = NDS32_INSN_JUMP_BRANCH;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tBNEZ38\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tBNEZ38\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
if (instruction->info.rt == 5) { /* J8 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tJ8\t#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tJ8\t#%" PRId32,
address,
opcode, instruction->info.imm);
} else { /* BEQS38 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tBEQS38\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tBEQS38\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
}
case 0: /* JR5 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tJR5\t$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tJR5\t$r%" PRIu8,
address,
opcode, instruction->info.rb);
break;
case 1: /* JRAL5 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tJRAL5\t$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tJRAL5\t$r%" PRIu8,
address,
opcode, instruction->info.rb);
break;
/* TODO: implement real instruction semantics */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tEX9.IT\t#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tEX9.IT\t#%" PRId32,
address,
opcode, instruction->info.imm);
break;
case 4: /* RET5 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tRET5\t$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tRET5\t$r%" PRIu8,
address,
opcode, instruction->info.rb);
break;
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tADD5.PC\t$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tADD5.PC\t$r%" PRIu8,
address,
opcode, instruction->info.rt);
break;
default:
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx16
"\tUNDEFINED INSTRUCTION",
address,
opcode);
} else { /* BNES38 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tBNES38\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tBNES38\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rt, instruction->info.imm);
}
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tSLTS45\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tSLTS45\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.ra, instruction->info.rb);
break;
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tSLT45\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tSLT45\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.ra, instruction->info.rb);
break;
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tSLTSI45\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tSLTSI45\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.ra, instruction->info.imm);
break;
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tSLTI45\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tSLTI45\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.ra, instruction->info.imm);
break;
if (nds32_extract_field_8u(opcode, 8, 1) == 0) { /* BEQZS8 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tBEQZS8\t#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tBEQZS8\t#%" PRId32,
address,
opcode, instruction->info.imm);
} else { /* BNEZS8 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tBNEZS8\t#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tBNEZS8\t#%" PRId32,
address,
opcode, instruction->info.imm);
}
instruction->type = NDS32_INSN_MISC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tBREAK16\t#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tBREAK16\t#%" PRId16,
address,
opcode, opcode & 0x1F);
} else { /* EX9.IT */
/* TODO: implement real instruction semantics */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tEX9.IT\t#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tEX9.IT\t#%" PRId16,
address,
opcode, opcode & 0x1FF);
}
instruction->type = NDS32_INSN_DATA_PROC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tADDI10.SP\t#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tADDI10.SP\t#%" PRId32,
address,
opcode, instruction->info.imm);
break;
if (nds32_extract_field_8u(opcode, 7, 1) == 0) { /* LWI37.SP */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tLWI37.SP\t$r%d,[+#%d]",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tLWI37.SP\t$r%" PRIu8 ",[+#%" PRId32 "]",
address,
opcode, instruction->info.rt, instruction->info.imm);
} else { /* SWI37.SP */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tSWI37.SP\t$r%d,[+#%d]",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tSWI37.SP\t$r%" PRIu8 ",[+#%" PRId32 "]",
address,
opcode, instruction->info.rt, instruction->info.imm);
}
instruction->type = NDS32_INSN_JUMP_BRANCH;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tIFCALL9\t#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tIFCALL9\t#%" PRId32 "",
address,
opcode, instruction->info.imm);
break;
instruction->type = NDS32_INSN_MISC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32 "\t\tMOVPI45\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tMOVPI45\t$r%" PRIu8 ",#%" PRId32 "",
address,
opcode, instruction->info.rt, instruction->info.imm);
break;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32
- "\t\tPUSH25\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tPUSH25\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rd,
instruction->info.imm);
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32
- "\t\tPOP25\t$r%d,#%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tPOP25\t$r%" PRIu8 ",#%" PRId32,
address,
opcode, instruction->info.rd,
instruction->info.imm);
instruction->type = NDS32_INSN_MISC;
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32
- "\t\tMOVD44\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tMOVD44\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
break;
case 2: /* NEG33 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32
- "\t\tNEG33\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tNEG33\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
break;
case 3: /* NOT33 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32
- "\t\tNOT33\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tNOT33\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
break;
case 4: /* MUL33 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32
- "\t\tMUL33\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tMUL33\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
break;
case 5: /* XOR33 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32
- "\t\tXOR33\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tXOR33\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
break;
case 6: /* AND33 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32
- "\t\tAND33\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tAND33\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
break;
case 7: /* OR33 */
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%4.4" PRIx32
- "\t\tOR33\t$r%d,$r%d",
+ "0x%8.8" PRIx32 "\t0x%4.4" PRIx16
+ "\t\tOR33\t$r%" PRIu8 ",$r%" PRIu8,
address,
opcode, instruction->info.rt, instruction->info.ra);
break;
default:
snprintf(instruction->text,
128,
- "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tUNDEFINED INSTRUCTION",
+ "0x%8.8" PRIx32 "\t0x%8.8" PRIx16 "\tUNDEFINED INSTRUCTION",
address,
opcode);
return ERROR_FAIL;