If a label is an entry, the assembler will pad empty instruction
before the label until offset % 4 == 0. In the past, the ILLEGAL
instructions are padded. It may raise exceptions. We use the NOP
instructions instead.
entry->inst_offset = inst_offset;
entry1 = entry->next;
if (entry1 && entry1->islabel && is_entry_point(entry1->string)) {
- // insert empty instructions until (inst_offset+1) % 4 == 0
+ // insert NOP instructions until (inst_offset+1) % 4 == 0
while (((inst_offset+1) % 4) != 0) {
tmp_entry = calloc(sizeof(*tmp_entry), 1);
+ tmp_entry->instruction.header.opcode = BRW_OPCODE_NOP;
entry->next = tmp_entry;
tmp_entry->next = entry1;
entry = tmp_entry;