struct qinst *producer =
(struct qinst *) c->cur_block->instructions.prev;
assert(producer);
- producer->ldvary_pipelining = true;
+ producer->is_ldvary_sequence = true;
c->ldvary_sequence_end_inst = producer;
return result;
}
track_ldvary_pipelining(struct v3d_compile *c, struct qinst *ldvary)
{
if (ldvary) {
+ ldvary->is_ldvary_sequence = true;
c->ldvary_sequence_length++;
- ldvary->ldvary_pipelining = true;
if (c->ldvary_sequence_length == 1) {
ldvary->ldvary_pipelining_start = true;
c->ldvary_sequence_start_inst = ldvary;
}
static void
-break_smooth_varying_sequence(struct v3d_compile *c)
+varying_sequence_end(struct v3d_compile *c)
{
if (!c->ldvary_sequence_start_inst) {
assert(!c->ldvary_sequence_end_inst);
assert(c->ldvary_sequence_end_inst);
assert(c->ldvary_sequence_start_inst != c->ldvary_sequence_end_inst);
- /* We need at least two smooth ldvary sequences to do some pipelining */
+ /* We need at least two ldvary sequences to do some pipelining */
if (c->ldvary_sequence_length == 1)
c->ldvary_sequence_start_inst->ldvary_pipelining_start = false;
}
}
- break_smooth_varying_sequence(c);
+ varying_sequence_end(c);
}
static void
list_for_each_entry(struct schedule_node, n, &scoreboard->dag->heads,
dag.link) {
- /* If we are scheduling a pipelined smooth varying sequence then
+ /* If we are scheduling a pipelined varying sequence then
* we want to pick up the next instruction in the sequence.
*/
if (scoreboard->ldvary_pipelining &&
- !n->inst->ldvary_pipelining) {
+ !n->inst->is_ldvary_sequence) {
continue;
}
* pipelining the new sequence into the previous one.
*/
if (scoreboard->ldvary_pipelining && inst->sig.ldvary) {
- assert(n->inst->ldvary_pipelining);
+ assert(n->inst->is_ldvary_sequence);
scoreboard->fixup_ldvary = true;
return n;
}
* continue the sequence.
*/
if (scoreboard->ldvary_pipelining && !prev_inst && !chosen) {
- bool prev_ldvary_pipelining = scoreboard->ldvary_pipelining;
scoreboard->ldvary_pipelining = false;
- chosen = choose_instruction_to_schedule(devinfo, scoreboard, prev_inst);
- if (!chosen)
- scoreboard->ldvary_pipelining = prev_ldvary_pipelining;
+ chosen = choose_instruction_to_schedule(devinfo, scoreboard,
+ prev_inst);
+ scoreboard->ldvary_pipelining = !chosen;
} else if (chosen) {
if (scoreboard->ldvary_pipelining) {
- assert(chosen->inst->ldvary_pipelining);
- if (chosen->inst->ldvary_pipelining_end)
- scoreboard->ldvary_pipelining = false;
+ assert(chosen->inst->is_ldvary_sequence);
+ scoreboard->ldvary_pipelining =
+ !chosen->inst->ldvary_pipelining_end;
} else if (chosen->inst->ldvary_pipelining_start) {
assert(chosen->inst->qpu.sig.ldvary);
scoreboard->ldvary_pipelining = true;
if (fixup_pipelined_ldvary(c, scoreboard, block, inst)) {
/* Flag the ldvary as scheduled
* now so we can try to merge the
- * follow-up fmul into the current
- * instruction.
+ * follow-up instruction in the
+ * the ldvary sequence into the
+ * current instruction.
*/
mark_instruction_scheduled(
devinfo, scoreboard->dag,
*/
int uniform;
- /* Set if this instruction participates in a pipelinable sequence of
- * smooth varyings.
- */
- bool ldvary_pipelining;
- /* Set if this is the ldvary instruction starting a pipelinable
- * sequence of smooth varyings.
+ /* Set if this instruction participates in a varying setup. */
+ bool is_ldvary_sequence;
+ /* Set if this is the ldvary instruction starting a sequence of
+ * varyings we want to pipeline.
*/
bool ldvary_pipelining_start;
- /* Set if this is the fadd instruction ending a pipelinable
- * sequence of smooth varyings.
+ /* Set if this is the last instruction involved with a pipelineable
+ * varying sequence.
*/
bool ldvary_pipelining_end;
};
uint32_t program_id;
uint32_t variant_id;
- /* Used to track pipelinable sequences of smooth varyings */
+ /* Used to track pipelinable sequences of varyings */
struct qinst *ldvary_sequence_start_inst;
struct qinst *ldvary_sequence_end_inst;
uint32_t ldvary_sequence_length;