More newline and whitespace cleanups
This commit is contained in:
@@ -92,7 +92,7 @@ static const macro_op_t alu_store_op =
|
||||
.uop[0] = {.type = UOP_LOAD, .latency = 1},
|
||||
.uop[1] = {.type = UOP_ALU, .latency = 1},
|
||||
.uop[2] = {.type = UOP_STORED, .latency = 1},
|
||||
.uop[3] = {.type = UOP_STOREA, .latency = 1}
|
||||
.uop[3] = {.type = UOP_STOREA, .latency = 1}
|
||||
};
|
||||
static const macro_op_t alup0_store_op =
|
||||
{
|
||||
@@ -101,7 +101,7 @@ static const macro_op_t alup0_store_op =
|
||||
.uop[0] = {.type = UOP_LOAD, .latency = 1},
|
||||
.uop[1] = {.type = UOP_ALUP0, .latency = 1},
|
||||
.uop[2] = {.type = UOP_STORED, .latency = 1},
|
||||
.uop[3] = {.type = UOP_STOREA, .latency = 1}
|
||||
.uop[3] = {.type = UOP_STOREA, .latency = 1}
|
||||
};
|
||||
|
||||
static const macro_op_t branch_op =
|
||||
@@ -130,7 +130,7 @@ static const macro_op_t store_op =
|
||||
.nr_uops = 2,
|
||||
.decode_type = DECODE_COMPLEX,
|
||||
.uop[0] = {.type = UOP_STORED, .latency = 1},
|
||||
.uop[1] = {.type = UOP_STOREA, .latency = 1}
|
||||
.uop[1] = {.type = UOP_STOREA, .latency = 1}
|
||||
};
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ static const macro_op_t bswap_op =
|
||||
.nr_uops = 2,
|
||||
.decode_type = DECODE_COMPLEX,
|
||||
.uop[0] = {.type = UOP_ALU, .latency = 1},
|
||||
.uop[1] = {.type = UOP_ALU, .latency = 1},
|
||||
.uop[1] = {.type = UOP_ALU, .latency = 1},
|
||||
};
|
||||
static const macro_op_t leave_op =
|
||||
{
|
||||
@@ -175,7 +175,7 @@ static const macro_op_t movs_op =
|
||||
.decode_type = DECODE_COMPLEX,
|
||||
.uop[0] = {.type = UOP_LOAD, .latency = 1},
|
||||
.uop[1] = {.type = UOP_STORED, .latency = 1},
|
||||
.uop[2] = {.type = UOP_STOREA, .latency = 1},
|
||||
.uop[2] = {.type = UOP_STOREA, .latency = 1},
|
||||
.uop[3] = {.type = UOP_ALU, .latency = 1}
|
||||
};
|
||||
static const macro_op_t pop_reg_op =
|
||||
@@ -191,7 +191,7 @@ static const macro_op_t pop_mem_op =
|
||||
.decode_type = DECODE_COMPLEX,
|
||||
.uop[0] = {.type = UOP_LOAD, .latency = 1},
|
||||
.uop[1] = {.type = UOP_STORED, .latency = 1},
|
||||
.uop[2] = {.type = UOP_STOREA, .latency = 1},
|
||||
.uop[2] = {.type = UOP_STOREA, .latency = 1},
|
||||
.uop[3] = {.type = UOP_ALU, .latency = 1}
|
||||
};
|
||||
static const macro_op_t push_imm_op =
|
||||
@@ -199,7 +199,7 @@ static const macro_op_t push_imm_op =
|
||||
.nr_uops = 2,
|
||||
.decode_type = DECODE_COMPLEX,
|
||||
.uop[0] = {.type = UOP_STORED, .latency = 1},
|
||||
.uop[1] = {.type = UOP_STOREA, .latency = 1},
|
||||
.uop[1] = {.type = UOP_STOREA, .latency = 1},
|
||||
};
|
||||
static const macro_op_t push_mem_op =
|
||||
{
|
||||
@@ -223,7 +223,7 @@ static const macro_op_t stos_op =
|
||||
.nr_uops = 3,
|
||||
.decode_type = DECODE_COMPLEX,
|
||||
.uop[1] = {.type = UOP_STORED, .latency = 1},
|
||||
.uop[2] = {.type = UOP_STOREA, .latency = 1},
|
||||
.uop[2] = {.type = UOP_STOREA, .latency = 1},
|
||||
.uop[3] = {.type = UOP_ALU, .latency = 1}
|
||||
};
|
||||
static const macro_op_t test_reg_op =
|
||||
@@ -359,7 +359,7 @@ static const macro_op_t fchs_op =
|
||||
.decode_type = DECODE_COMPLEX,
|
||||
.uop[0] = {.type = UOP_FLOAT, .latency = 2},
|
||||
.uop[1] = {.type = UOP_FLOAT, .latency = 2},
|
||||
.uop[2] = {.type = UOP_FLOAT, .latency = 2}
|
||||
.uop[2] = {.type = UOP_FLOAT, .latency = 2}
|
||||
};
|
||||
static const macro_op_t load_float_op =
|
||||
{
|
||||
@@ -399,7 +399,7 @@ static const macro_op_t load_fiadd_op =
|
||||
.uop[3] = {.type = UOP_FLOAT, .latency = 1},
|
||||
.uop[4] = {.type = UOP_FLOAT, .latency = 1},
|
||||
.uop[5] = {.type = UOP_FLOAT, .latency = 1},
|
||||
.uop[6] = {.type = UOP_FLOAT, .latency = 1}
|
||||
.uop[6] = {.type = UOP_FLOAT, .latency = 1}
|
||||
};
|
||||
static const macro_op_t fdiv_op =
|
||||
{
|
||||
@@ -547,7 +547,7 @@ static const macro_op_t call_far_op =
|
||||
.decode_type = DECODE_COMPLEX,
|
||||
.uop[0] = {.type = UOP_ALU, .latency = 3},
|
||||
.uop[1] = {.type = UOP_STORED, .latency = 1},
|
||||
.uop[2] = {.type = UOP_STOREA, .latency = 1},
|
||||
.uop[2] = {.type = UOP_STOREA, .latency = 1},
|
||||
.uop[3] = {.type = UOP_BRANCH, .latency = 1}
|
||||
};
|
||||
static const macro_op_t cli_sti_op =
|
||||
@@ -675,7 +675,7 @@ static const macro_op_t int_op =
|
||||
.uop[3] = {.type = UOP_STORED, .latency = 1},
|
||||
.uop[4] = {.type = UOP_STOREA, .latency = 1},
|
||||
.uop[5] = {.type = UOP_STORED, .latency = 1},
|
||||
.uop[6] = {.type = UOP_STOREA, .latency = 1},
|
||||
.uop[6] = {.type = UOP_STOREA, .latency = 1},
|
||||
.uop[7] = {.type = UOP_BRANCH, .latency = 1}
|
||||
};
|
||||
static const macro_op_t iret_op =
|
||||
@@ -771,7 +771,7 @@ static const macro_op_t outs_op =
|
||||
.nr_uops = 3,
|
||||
.decode_type = DECODE_COMPLEX,
|
||||
.uop[0] = {.type = UOP_LOAD, .latency = 1},
|
||||
.uop[1] = {.type = UOP_ALU, .latency = 18}
|
||||
.uop[1] = {.type = UOP_ALU, .latency = 18}
|
||||
};
|
||||
static const macro_op_t pusha_op =
|
||||
{
|
||||
@@ -804,7 +804,7 @@ static const macro_op_t popf_op =
|
||||
.nr_uops = 3,
|
||||
.decode_type = DECODE_COMPLEX,
|
||||
.uop[0] = {.type = UOP_LOAD, .latency = 1},
|
||||
.uop[1] = {.type = UOP_ALU, .latency = 6},
|
||||
.uop[1] = {.type = UOP_ALU, .latency = 6},
|
||||
.uop[2] = {.type = UOP_ALUP0, .latency = 10}
|
||||
};
|
||||
static const macro_op_t pushf_op =
|
||||
@@ -881,7 +881,7 @@ static const macro_op_t xchg_mem_op =
|
||||
.decode_type = DECODE_COMPLEX,
|
||||
.uop[0] = {.type = UOP_LOAD, .latency = 1},
|
||||
.uop[1] = {.type = UOP_STORED, .latency = 1},
|
||||
.uop[2] = {.type = UOP_STOREA, .latency = 1},
|
||||
.uop[2] = {.type = UOP_STOREA, .latency = 1},
|
||||
.uop[3] = {.type = UOP_ALU, .latency = 1}
|
||||
};
|
||||
static const macro_op_t xlat_op =
|
||||
@@ -1152,7 +1152,7 @@ static const macro_op_t *opcode_timings_mod3[256] =
|
||||
&alup0_6_op, &alup0_3_op, &complex_alup0_1_op, &xlat_op,
|
||||
INVALID, INVALID, INVALID, INVALID,
|
||||
INVALID, INVALID, INVALID, INVALID,
|
||||
|
||||
|
||||
/* LOOPNE LOOPE LOOP JCXZ*/
|
||||
/*e0*/ &loop_op, &loop_op, &loop_op, &loop_op,
|
||||
/* IN AL IN AX OUT_AL OUT_AX*/
|
||||
@@ -1372,7 +1372,7 @@ static const macro_op_t *opcode_timings_8x[8] =
|
||||
{
|
||||
&alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op,
|
||||
&alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op,
|
||||
};
|
||||
};
|
||||
static const macro_op_t *opcode_timings_8x_mod3[8] =
|
||||
{
|
||||
&alu_op, &alu_op, &alu_store_op, &alu_store_op,
|
||||
@@ -1618,7 +1618,7 @@ static p6_unit_t p2_units[] =
|
||||
{.uop_mask = (1 << UOP_ALU) | (1 << UOP_ALUP0) | (1 << UOP_FLOAT) | /*Port 0*/
|
||||
(1 << UOP_MMX) | (1 << UOP_MMX_MUL)},
|
||||
{.uop_mask = (1 << UOP_ALU) | (1 << UOP_BRANCH) | /*Port 1*/
|
||||
(1 << UOP_MMX) | (1 << UOP_MMX_SHIFT)},
|
||||
(1 << UOP_MMX) | (1 << UOP_MMX_SHIFT)},
|
||||
{.uop_mask = (1 << UOP_LOAD) | (1 << UOP_FLOAD) | (1 << UOP_MLOAD)}, /*Port 2*/
|
||||
{.uop_mask = (1 << UOP_STORED) | (1 << UOP_FSTORED) | (1 << UOP_MSTORED)}, /*Port 3*/
|
||||
{.uop_mask = (1 << UOP_STOREA) | (1 << UOP_FSTOREA) | (1 << UOP_MSTOREA)}, /*Port 4*/
|
||||
@@ -1630,11 +1630,11 @@ static int uop_run(const p6_uop_t *uop, int decode_time)
|
||||
int c;
|
||||
p6_unit_t *best_unit = NULL;
|
||||
int best_start_cycle = 99999;
|
||||
|
||||
|
||||
/*UOP_FXCH does not require execution*/
|
||||
if (uop->type == UOP_FXCH)
|
||||
return decode_time;
|
||||
|
||||
|
||||
/*Find execution unit for this uOP*/
|
||||
for (c = 0; c < nr_units; c++)
|
||||
{
|
||||
@@ -1653,7 +1653,7 @@ static int uop_run(const p6_uop_t *uop, int decode_time)
|
||||
if (best_start_cycle < decode_time)
|
||||
best_start_cycle = decode_time;
|
||||
best_unit->first_available_cycle = best_start_cycle + uop->latency;
|
||||
|
||||
|
||||
|
||||
|
||||
return best_start_cycle + uop->latency;
|
||||
@@ -1692,7 +1692,7 @@ void decode_flush_p6()
|
||||
{
|
||||
int c;
|
||||
int start_timestamp, uop_timestamp = 0;
|
||||
|
||||
|
||||
/*Decoded opseq can not be submitted if there are no free spaces in the
|
||||
opseq buffer*/
|
||||
if (decode_timestamp < opseq_completion_timestamp[next_opseq])
|
||||
@@ -1709,7 +1709,7 @@ void decode_flush_p6()
|
||||
start_timestamp = last_uop_timestamp;
|
||||
else
|
||||
start_timestamp = decode_buffer.earliest_start[c];
|
||||
|
||||
|
||||
last_uop_timestamp = uop_run(decode_buffer.uops[c], start_timestamp);
|
||||
if (last_uop_timestamp > uop_timestamp)
|
||||
uop_timestamp = last_uop_timestamp;
|
||||
@@ -1785,7 +1785,7 @@ static int codegen_timing_instr_length(uint64_t deps, uint32_t fetchdat, int op_
|
||||
static void decode_instruction(const macro_op_t *ins, uint64_t deps, uint32_t fetchdat, int op_32, int bit8)
|
||||
{
|
||||
uint32_t regmask_required;
|
||||
uint32_t regmask_modified;
|
||||
uint32_t regmask_modified;
|
||||
int c;
|
||||
int d = 0; /*Complex decoder uOPs*/
|
||||
int earliest_start = 0;
|
||||
@@ -1822,43 +1822,43 @@ static void decode_instruction(const macro_op_t *ins, uint64_t deps, uint32_t fe
|
||||
decode_type = DECODE_COMPLEX;
|
||||
|
||||
switch (decode_type)
|
||||
{
|
||||
case DECODE_SIMPLE:
|
||||
{
|
||||
case DECODE_SIMPLE:
|
||||
if (decode_buffer.nr_uops - d == 2)
|
||||
{
|
||||
decode_buffer.uops[decode_buffer.nr_uops] = &ins->uop[0];
|
||||
decode_buffer.earliest_start[decode_buffer.nr_uops] = earliest_start;
|
||||
decode_buffer.nr_uops = 3;
|
||||
decode_flush_p6();
|
||||
}
|
||||
}
|
||||
else if (decode_buffer.nr_uops - d == 1)
|
||||
{
|
||||
{
|
||||
decode_buffer.uops[decode_buffer.nr_uops] = &ins->uop[0];
|
||||
decode_buffer.earliest_start[decode_buffer.nr_uops] = earliest_start;
|
||||
decode_buffer.nr_uops = 2+d;
|
||||
if (d)
|
||||
decode_flush_p6();
|
||||
}
|
||||
}
|
||||
else if (decode_buffer.nr_uops)
|
||||
{
|
||||
decode_buffer.uops[decode_buffer.nr_uops] = &ins->uop[0];
|
||||
decode_buffer.earliest_start[decode_buffer.nr_uops] = earliest_start;
|
||||
decode_buffer.nr_uops = 1+d;
|
||||
decode_buffer.nr_uops = 1+d;
|
||||
}
|
||||
else
|
||||
{
|
||||
decode_buffer.nr_uops = 1;
|
||||
decode_buffer.uops[0] = &ins->uop[0];
|
||||
decode_buffer.earliest_start[0] = earliest_start;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case DECODE_COMPLEX:
|
||||
if (decode_buffer.nr_uops)
|
||||
decode_flush_p6(); /*The 4-1-1 arrangement implies that a complex ins. can't be decoded after a simple one*/
|
||||
|
||||
|
||||
d = 0;
|
||||
|
||||
|
||||
for (c = 0; c < ins->nr_uops; c++)
|
||||
{
|
||||
decode_buffer.uops[d] = &ins->uop[c];
|
||||
@@ -1867,7 +1867,7 @@ static void decode_instruction(const macro_op_t *ins, uint64_t deps, uint32_t fe
|
||||
else
|
||||
decode_buffer.earliest_start[d] = -1;
|
||||
d++;
|
||||
|
||||
|
||||
if ((d == 3) && (ins->nr_uops > 4)) /*Ins. with >4 uOPs require the use of special units only present on 3 translate PLAs*/
|
||||
{
|
||||
d = 0;
|
||||
@@ -1877,9 +1877,9 @@ static void decode_instruction(const macro_op_t *ins, uint64_t deps, uint32_t fe
|
||||
}
|
||||
if (d)
|
||||
{
|
||||
decode_buffer.nr_uops = d;
|
||||
}
|
||||
break;
|
||||
decode_buffer.nr_uops = d;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/*Update write timestamps for any output registers*/
|
||||
@@ -1932,11 +1932,11 @@ void codegen_timing_p6_block_start()
|
||||
|
||||
decode_timestamp = 0;
|
||||
last_complete_timestamp = 0;
|
||||
|
||||
|
||||
for (c = 0; c < NR_OPSEQS; c++)
|
||||
opseq_completion_timestamp[c] = 0;
|
||||
next_opseq = 0;
|
||||
|
||||
|
||||
for (c = 0; c < NR_REGS; c++)
|
||||
reg_available_timestamp[c] = 0;
|
||||
for (c = 0; c < 8; c++)
|
||||
@@ -2043,7 +2043,7 @@ void codegen_timing_p6_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, uint
|
||||
deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift;
|
||||
opcode = (fetchdat >> 3) & 7;
|
||||
break;
|
||||
|
||||
|
||||
case 0xc1: case 0xd1: case 0xd3:
|
||||
ins_table = mod3 ? opcode_timings_shift_mod3 : opcode_timings_shift;
|
||||
deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift;
|
||||
|
||||
Reference in New Issue
Block a user