If we add a new file type, we'd like to get warnings if it's not handled. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>tags/11.1-branchpoint
@@ -88,8 +88,6 @@ fs_inst::init(enum opcode opcode, uint8_t exec_size, const fs_reg &dst, | |||
case IMM: | |||
case UNIFORM: | |||
unreachable("Invalid destination register file"); | |||
default: | |||
unreachable("Invalid register file"); | |||
} | |||
this->writes_accumulator = false; | |||
@@ -845,9 +843,8 @@ fs_inst::regs_read(int arg) const | |||
REG_SIZE); | |||
case MRF: | |||
unreachable("MRF registers are not allowed as sources"); | |||
default: | |||
unreachable("Invalid register file"); | |||
} | |||
return 0; | |||
} | |||
bool | |||
@@ -4506,9 +4503,8 @@ fs_visitor::dump_instruction(backend_instruction *be_inst, FILE *file) | |||
if (inst->dst.fixed_hw_reg.subnr) | |||
fprintf(file, "+%d", inst->dst.fixed_hw_reg.subnr); | |||
break; | |||
default: | |||
fprintf(file, "???"); | |||
break; | |||
case IMM: | |||
unreachable("not reached"); | |||
} | |||
fprintf(file, ":%s, ", brw_reg_type_letters(inst->dst.type)); | |||
@@ -4601,9 +4597,6 @@ fs_visitor::dump_instruction(backend_instruction *be_inst, FILE *file) | |||
if (inst->src[i].fixed_hw_reg.abs) | |||
fprintf(file, "|"); | |||
break; | |||
default: | |||
fprintf(file, "???"); | |||
break; | |||
} | |||
if (inst->src[i].abs) | |||
fprintf(file, "|"); |
@@ -416,9 +416,10 @@ fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry) | |||
inst->src[arg].subreg_offset = offset % 32; | |||
} | |||
break; | |||
default: | |||
unreachable("Invalid register file"); | |||
break; | |||
case MRF: | |||
case IMM: | |||
unreachable("not reached"); | |||
} | |||
if (has_source_modifiers) { |
@@ -42,9 +42,13 @@ static uint32_t brw_file_from_reg(fs_reg *reg) | |||
return BRW_MESSAGE_REGISTER_FILE; | |||
case IMM: | |||
return BRW_IMMEDIATE_VALUE; | |||
default: | |||
case BAD_FILE: | |||
case HW_REG: | |||
case ATTR: | |||
case UNIFORM: | |||
unreachable("not reached"); | |||
} | |||
return 0; | |||
} | |||
static struct brw_reg | |||
@@ -116,7 +120,8 @@ brw_reg_from_fs_reg(fs_inst *inst, fs_reg *reg, unsigned gen) | |||
/* Probably unused. */ | |||
brw_reg = brw_null_reg(); | |||
break; | |||
default: | |||
case ATTR: | |||
case UNIFORM: | |||
unreachable("not reached"); | |||
} | |||
if (reg->abs) |
@@ -97,7 +97,9 @@ byte_offset(fs_reg reg, unsigned delta) | |||
case MRF: | |||
reg.reg += delta / 32; | |||
break; | |||
default: | |||
case IMM: | |||
case HW_REG: | |||
case UNIFORM: | |||
assert(delta == 0); | |||
} | |||
reg.subreg_offset += delta % 32; | |||
@@ -119,7 +121,7 @@ horiz_offset(fs_reg reg, unsigned delta) | |||
case MRF: | |||
case ATTR: | |||
return byte_offset(reg, delta * reg.stride * type_sz(reg.type)); | |||
default: | |||
case HW_REG: | |||
assert(delta == 0); | |||
} | |||
return reg; | |||
@@ -163,7 +165,6 @@ half(fs_reg reg, unsigned idx) | |||
case ATTR: | |||
case HW_REG: | |||
default: | |||
unreachable("Cannot take half of this register type"); | |||
} | |||
return reg; |
@@ -1427,9 +1427,10 @@ vec4_visitor::dump_instruction(backend_instruction *be_inst, FILE *file) | |||
case BAD_FILE: | |||
fprintf(file, "(null)"); | |||
break; | |||
default: | |||
fprintf(file, "???"); | |||
break; | |||
case IMM: | |||
case ATTR: | |||
case UNIFORM: | |||
unreachable("not reached"); | |||
} | |||
if (inst->dst.writemask != WRITEMASK_XYZW) { | |||
fprintf(file, "."); | |||
@@ -1521,9 +1522,8 @@ vec4_visitor::dump_instruction(backend_instruction *be_inst, FILE *file) | |||
case BAD_FILE: | |||
fprintf(file, "(null)"); | |||
break; | |||
default: | |||
fprintf(file, "???"); | |||
break; | |||
case MRF: | |||
unreachable("not reached"); | |||
} | |||
/* Don't print .0; and only VGRFs have reg_offsets and sizes */ | |||
@@ -1839,7 +1839,8 @@ vec4_visitor::convert_to_hw_regs() | |||
reg = brw_null_reg(); | |||
break; | |||
default: | |||
case MRF: | |||
case ATTR: | |||
unreachable("not reached"); | |||
} | |||
src.fixed_hw_reg = reg; | |||
@@ -1871,7 +1872,9 @@ vec4_visitor::convert_to_hw_regs() | |||
reg = brw_null_reg(); | |||
break; | |||
default: | |||
case IMM: | |||
case ATTR: | |||
case UNIFORM: | |||
unreachable("not reached"); | |||
} | |||