Commit 9bc8da4c authored by Lovis J.I. Zenz's avatar Lovis J.I. Zenz
Browse files

armtesting - fix 007

parent 98ad3562
Pipeline #1812 passed with stage
in 2 minutes and 4 seconds
......@@ -354,7 +354,7 @@ void tbgen_mov_standard_old_register_generate(FILE *stream, enum arm7_id from, e
}
case ARM7_ID_TYPE_EXTENSION_DOUBLE: {
// VMOV to, from
uint8_t vmov[] = { 0x10 | ((0x10 & x) << 1) | ((0x10 & x) << 3) | (0x0f & x) ,0x01 | (tbgen_register_to_binary(to) << 4), 0x20 | ((0x10 & tbgen_register_to_binary(to)) << 2) | (0x0F & tbgen_register_to_binary(from)), 0xf2 };
uint8_t vmov[] = { 0x10 | ((0x10 & from) << 1) | ((0x10 & from) << 3) | (0x0f & from) ,0x01 | (tbgen_register_to_binary(to) << 4), 0x20 | ((0x10 & tbgen_register_to_binary(to)) << 2) | (0x0F & tbgen_register_to_binary(from)), 0xf2 };
fwrite(vmov, 1, sizeof(vmov), stream);
}
case ARM7_ID_TYPE_EXTENSION_SINGLE: {
......@@ -402,13 +402,13 @@ static void tbgen_mov_memory_to_register_generate(FILE *stream, enum arm7_id reg
uint8_t t0_bin = tbgen_register_to_binary(t0);
uint8_t register_bin = tbgen_register_to_binary(register_);
uint8_t address_low_4_1 = (uint8_t) (0x0F & (address >> 12));
uint8_t address_low_4_2 = (uint8_t) (0x0F & (address >> 8));
uint8_t address_low_8 = (uint8_t) (0xFF & address);
uint8_t address_low_4_1 = (uint8_t) (0x0F & (*address >> 12));
uint8_t address_low_4_2 = (uint8_t) (0x0F & (*address >> 8));
uint8_t address_low_8 = (uint8_t) (0xFF & *address);
uint8_t address_high_4_1 = (uint8_t) (0x0F & (address >> 28));
uint8_t address_high_4_2 = (uint8_t) (0x0F & (address >> 24));
uint8_t address_high_8 = (uint8_t) (0xFF & (address >> 16));
uint8_t address_high_4_1 = (uint8_t) (0x0F & (*address >> 28));
uint8_t address_high_4_2 = (uint8_t) (0x0F & (*address >> 24));
uint8_t address_high_8 = (uint8_t) (0xFF & (*address >> 16));
// MOVW t0, address_low
uint8_t movw[] = { address_low_8, (t0_bin << 4) | address_low_4_2, address_low_4_1, 0xE3 };
......@@ -450,13 +450,13 @@ static void tbgen_mov_register_to_memory_generate(FILE *stream, enum arm7_id reg
uint8_t t0_bin = tbgen_register_to_binary(t0);
uint8_t register_bin = tbgen_register_to_binary(register_);
uint8_t address_low_4_1 = (uint8_t) (0x0F & (address >> 12));
uint8_t address_low_4_2 = (uint8_t) (0x0F & (address >> 8));
uint8_t address_low_8 = (uint8_t) (0xFF & address);
uint8_t address_low_4_1 = (uint8_t) (0x0F & (*address >> 12));
uint8_t address_low_4_2 = (uint8_t) (0x0F & (*address >> 8));
uint8_t address_low_8 = (uint8_t) (0xFF & *address);
uint8_t address_high_4_1 = (uint8_t) (0x0F & (address >> 28));
uint8_t address_high_4_2 = (uint8_t) (0x0F & (address >> 24));
uint8_t address_high_8 = (uint8_t) (0xFF & (address >> 16));
uint8_t address_high_4_1 = (uint8_t) (0x0F & (*address >> 28));
uint8_t address_high_4_2 = (uint8_t) (0x0F & (*address >> 24));
uint8_t address_high_8 = (uint8_t) (0xFF & (*address >> 16));
// MOVW t0, address_low
uint8_t movw[] = { address_low_8, (t0_bin << 4) | address_low_4_2, address_low_4_1, 0xE3 };
......@@ -499,13 +499,13 @@ static void tbgen_mov_memory_to_apsr_generate(FILE *stream, uint32_t *address, e
struct tbgen_register_allocation *allocation) {
uint8_t t0_bin = tbgen_register_to_binary(t0);
uint8_t address_low_4_1 = (uint8_t) (0x0F & (address >> 12));
uint8_t address_low_4_2 = (uint8_t) (0x0F & (address >> 8));
uint8_t address_low_8 = (uint8_t) (0xFF & address);
uint8_t address_low_4_1 = (uint8_t) (0x0F & (*address >> 12));
uint8_t address_low_4_2 = (uint8_t) (0x0F & (*address >> 8));
uint8_t address_low_8 = (uint8_t) (0xFF & *address);
uint8_t address_high_4_1 = (uint8_t) (0x0F & (address >> 28));
uint8_t address_high_4_2 = (uint8_t) (0x0F & (address >> 24));
uint8_t address_high_8 = (uint8_t) (0xFF & (address >> 16));
uint8_t address_high_4_1 = (uint8_t) (0x0F & (*address >> 28));
uint8_t address_high_4_2 = (uint8_t) (0x0F & (*address >> 24));
uint8_t address_high_8 = (uint8_t) (0xFF & (*address >> 16));
// MOVW t0, address_low
uint8_t movw[] = { address_low_8, (t0_bin << 4) | address_low_4_2, address_low_4_1, 0xE3 };
......@@ -533,13 +533,13 @@ static void tbgen_mov_apsr_to_memory_generate(FILE *stream, uint64_t *address, e
uint8_t mrs[] = { 0x00, t1_bin << 4, 0x0F, 0xE1 };
fwrite(mrs, 1, sizeof(mrs), stream);
uint8_t address_low_4_1 = (uint8_t) (0x0F & (address >> 12));
uint8_t address_low_4_2 = (uint8_t) (0x0F & (address >> 8));
uint8_t address_low_8 = (uint8_t) (0xFF & address);
uint8_t address_low_4_1 = (uint8_t) (0x0F & (*address >> 12));
uint8_t address_low_4_2 = (uint8_t) (0x0F & (*address >> 8));
uint8_t address_low_8 = (uint8_t) (0xFF & *address);
uint8_t address_high_4_1 = (uint8_t) (0x0F & (address >> 28));
uint8_t address_high_4_2 = (uint8_t) (0x0F & (address >> 24));
uint8_t address_high_8 = (uint8_t) (0xFF & (address >> 16));
uint8_t address_high_4_1 = (uint8_t) (0x0F & (*address >> 28));
uint8_t address_high_4_2 = (uint8_t) (0x0F & (*address >> 24));
uint8_t address_high_8 = (uint8_t) (0xFF & (*address >> 16));
// MOVW t0, address_low
uint8_t movw[] = { address_low_8, (t0_bin << 4) | address_low_4_2, address_low_4_1, 0xE3 };
......@@ -618,7 +618,7 @@ struct tbgen_result tbgen_code_generate(uint8_t *instruction, size_t instruction
*/
uint8_t return_reg_bin = tbgen_register_to_binary(return_reg);
uint32_t instruction_length_32 = (uint32_t) instruction;
uint32_t instruction_length_32 = (uint32_t) instruction_length;
uint8_t instruction_length_32_low_4_1 = (uint8_t) (0x0F & (instruction_length_32 >> 12));
uint8_t instruction_length_32_low_4_2 = (uint8_t) (0x0F & (instruction_length_32 >> 8));
......@@ -875,4 +875,4 @@ static char write_back_reg(void *closure, enum arm7_id reg) {
}
return 0;
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment