lima/gpir: clean up override-init warnings
Define gpir_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:
@@ -32,6 +32,7 @@
|
||||
|
||||
/* list of operations that a node can do. */
|
||||
typedef enum {
|
||||
gpir_op_unsupported = 0,
|
||||
gpir_op_mov,
|
||||
|
||||
/* mul ops */
|
||||
|
||||
@@ -147,9 +147,6 @@ static gpir_node *gpir_node_find(gpir_block *block, nir_src *src,
|
||||
}
|
||||
|
||||
static int nir_to_gpir_opcodes[nir_num_opcodes] = {
|
||||
/* not supported */
|
||||
[0 ... nir_last_opcode] = -1,
|
||||
|
||||
[nir_op_fmul] = gpir_op_mul,
|
||||
[nir_op_fadd] = gpir_op_add,
|
||||
[nir_op_fneg] = gpir_op_neg,
|
||||
@@ -188,7 +185,7 @@ static bool gpir_emit_alu(gpir_block *block, nir_instr *ni)
|
||||
|
||||
int op = nir_to_gpir_opcodes[instr->op];
|
||||
|
||||
if (op < 0) {
|
||||
if (op == gpir_op_unsupported) {
|
||||
gpir_error("unsupported nir_op: %s\n", nir_op_infos[instr->op].name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
#include "gpir.h"
|
||||
|
||||
const gpir_op_info gpir_op_infos[] = {
|
||||
[gpir_op_unsupported] = {
|
||||
.name = "unsupported",
|
||||
},
|
||||
[gpir_op_mov] = {
|
||||
.name = "mov",
|
||||
.slots = (int []) {
|
||||
|
||||
Reference in New Issue
Block a user