*/
#include "etnaviv_compiler.h"
+#include "etnaviv_compiler_nir.h"
#include "etnaviv_asm.h"
#include "etnaviv_context.h"
#include "etnaviv_debug.h"
struct etna_op_info ei = etna_ops[op];
unsigned swiz_scalar = INST_SWIZ_BROADCAST(ffs(dst.write_mask) - 1);
- assert(ei.opcode != 0xff);
+ if (ei.opcode == 0xff)
+ compile_error(c, "Unhandled ALU op: %s\n", nir_op_infos[op].name);
struct etna_inst inst = {
.opcode = ei.opcode,
case nir_texop_txb: inst.opcode = INST_OPCODE_TEXLDB; break;
case nir_texop_txl: inst.opcode = INST_OPCODE_TEXLDL; break;
default:
- assert(0);
+ compile_error(c, "Unhandled NIR tex type: %d\n", op);
}
emit_inst(c, &inst);
--- /dev/null
+/*
+ * Copyright (c) 2020 Etnaviv Project
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sub license,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Jonathan Marek <jonathan@marek.ca>
+ */
+
+#ifndef H_ETNAVIV_COMPILER_NIR
+#define H_ETNAVIV_COMPILER_NIR
+
+#define compile_error(ctx, args...) ({ \
+ printf(args); \
+ ctx->error = true; \
+ assert(0); \
+})
+
+#endif
#include "etnaviv_asm.h"
#include "etnaviv_context.h"
+#include "etnaviv_compiler_nir.h"
#include "compiler/nir/nir.h"
#include "compiler/nir/nir_builder.h"
unsigned num_nodes;
};
-#define compile_error(ctx, args...) ({ \
- printf(args); \
- ctx->error = true; \
- assert(0); \
-})
-
static inline hw_src
src_swizzle(hw_src src, unsigned swizzle)
{