assembler: Rename branch_2_offset to break_cont

Once again, import the equivalent struct from mesa.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
This commit is contained in:
Damien Lespiau 2013-01-16 01:44:41 +00:00
parent cb425d6d20
commit c7dac84953
2 changed files with 17 additions and 7 deletions

View File

@ -1324,11 +1324,21 @@ struct brw_instruction
GLuint pad1:2; /* reserved */ GLuint pad1:2; /* reserved */
} da3src; } da3src;
/* This is also used for gen7 IF/ELSE instructions */
struct struct
{ {
GLint JIP:16; /* Gen7 bspec: both the JIP and UIP are signed 16-bit numbers */ /* Signed jump distance to the ip to jump to if all channels
GLint UIP:16; * are disabled after the break or continue. It should point
} branch_2_offset; /* for Gen6, Gen7 2-offsets branch; for Gen7 1-offset branch */ * to the end of the innermost control flow block, as that's
* where some channel could get re-enabled.
*/
int jip:16;
/* Signed jump distance to the location to resume execution
* of this channel if it's enabled for the break or continue.
*/
int uip:16;
} break_cont;
GLint JIP; /* used by Gen6 CALL instructions; Gen7 JMPI */ GLint JIP; /* used by Gen6 CALL instructions; Gen7 JMPI */

View File

@ -424,8 +424,8 @@ int main(int argc, char **argv)
if (inst->second_reloc_offset) { if (inst->second_reloc_offset) {
// this is a branch instruction with two offset arguments // this is a branch instruction with two offset arguments
entry->instruction.bits3.branch_2_offset.JIP = jump_distance(inst->first_reloc_offset); entry->instruction.bits3.break_cont.jip = jump_distance(inst->first_reloc_offset);
entry->instruction.bits3.branch_2_offset.UIP = jump_distance(inst->second_reloc_offset); entry->instruction.bits3.break_cont.uip = jump_distance(inst->second_reloc_offset);
} else if (inst->first_reloc_offset) { } else if (inst->first_reloc_offset) {
// this is a branch instruction with one offset argument // this is a branch instruction with one offset argument
int offset = inst->first_reloc_offset; int offset = inst->first_reloc_offset;
@ -441,7 +441,7 @@ int main(int argc, char **argv)
if(!IS_GENp(6)) { if(!IS_GENp(6)) {
entry->instruction.bits3.JIP = offset; entry->instruction.bits3.JIP = offset;
if(entry->instruction.header.opcode == BRW_OPCODE_ELSE) if(entry->instruction.header.opcode == BRW_OPCODE_ELSE)
entry->instruction.bits3.branch_2_offset.UIP = 1; /* Set the istack pop count, which must always be 1. */ entry->instruction.bits3.break_cont.uip = 1; /* Set the istack pop count, which must always be 1. */
} else if(IS_GENx(6)) { } else if(IS_GENx(6)) {
/* TODO: endif JIP pos is not in Gen6 spec. may be bits1 */ /* TODO: endif JIP pos is not in Gen6 spec. may be bits1 */
int opcode = entry->instruction.header.opcode; int opcode = entry->instruction.header.opcode;
@ -457,7 +457,7 @@ int main(int argc, char **argv)
if(opcode == BRW_OPCODE_JMPI) if(opcode == BRW_OPCODE_JMPI)
entry->instruction.bits3.JIP = offset; entry->instruction.bits3.JIP = offset;
else else
entry->instruction.bits3.branch_2_offset.JIP = offset; entry->instruction.bits3.break_cont.jip = offset;
} }
} }
} }