mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
lima/ppir: clean up override-init warnings
Define ppir_op_unsupported as 0 so that we don't have to do the initialization to -1. Signed-off-by: Erico Nunes <nunes.erico@gmail.com> Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14894>
This commit is contained in:
parent
823be63216
commit
3d77950b8b
3 changed files with 5 additions and 4 deletions
|
|
@ -123,9 +123,6 @@ static void ppir_node_add_src(ppir_compiler *comp, ppir_node *node,
|
|||
}
|
||||
|
||||
static int nir_to_ppir_opcodes[nir_num_opcodes] = {
|
||||
/* not supported */
|
||||
[0 ... nir_last_opcode] = -1,
|
||||
|
||||
[nir_op_mov] = ppir_op_mov,
|
||||
[nir_op_fmul] = ppir_op_mul,
|
||||
[nir_op_fabs] = ppir_op_abs,
|
||||
|
|
@ -162,7 +159,7 @@ static bool ppir_emit_alu(ppir_block *block, nir_instr *ni)
|
|||
nir_alu_instr *instr = nir_instr_as_alu(ni);
|
||||
int op = nir_to_ppir_opcodes[instr->op];
|
||||
|
||||
if (op < 0) {
|
||||
if (op == ppir_op_unsupported) {
|
||||
ppir_error("unsupported nir_op: %s\n", nir_op_infos[instr->op].name);
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@
|
|||
#include "ppir.h"
|
||||
|
||||
const ppir_op_info ppir_op_infos[] = {
|
||||
[ppir_op_unsupported] = {
|
||||
.name = "unsupported",
|
||||
},
|
||||
[ppir_op_mov] = {
|
||||
.name = "mov",
|
||||
.slots = (int []) {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include "ir/lima_ir.h"
|
||||
|
||||
typedef enum {
|
||||
ppir_op_unsupported = 0,
|
||||
ppir_op_mov,
|
||||
ppir_op_abs,
|
||||
ppir_op_neg,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue