--- /dev/null
+/*
+ * Copyright (C) 2020 Collabora Ltd.
+ *
+ * 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, sublicense,
+ * 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 NONINFRINGEMENT. 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 (Collabora):
+ * Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
+ */
+
+#include "compiler.h"
+
+unsigned bi_class_props[BI_NUM_CLASSES] = {
+ [BI_ADD] = BI_MODS,
+ [BI_ATEST] = 0,
+ [BI_BRANCH] = 0,
+ [BI_CMP] = BI_MODS,
+ [BI_BLEND] = 0,
+ [BI_BITWISE] = 0,
+ [BI_CONVERT] = 0,
+ [BI_CSEL] = 0,
+ [BI_DISCARD] = 0,
+ [BI_FMA] = 0,
+ [BI_FREXP] = 0,
+ [BI_LOAD] = 0,
+ [BI_LOAD_ATTR] = 0,
+ [BI_LOAD_VAR] = 0,
+ [BI_LOAD_VAR_ADDRESS] = 0,
+ [BI_MINMAX] = 0,
+ [BI_MOV] = BI_MODS,
+ [BI_SHIFT] = 0,
+ [BI_STORE] = 0,
+ [BI_STORE_VAR] = 0,
+ [BI_SPECIAL] = 0,
+ [BI_TEX] = 0,
+ [BI_ROUND] = 0,
+};
#ifndef __BIFROST_COMPILER_H
#define __BIFROST_COMPILER_H
+#include "compiler/nir/nir.h"
+
/* Bifrost opcodes are tricky -- the same op may exist on both FMA and
* ADD with two completely different opcodes, and opcodes can be varying
* length in some cases. Then we have different opcodes for int vs float
BI_SPECIAL, /* _FAST, _TABLE on supported GPUs */
BI_TEX,
BI_ROUND,
+ BI_NUM_CLASSES
};
+/* Properties of a class... */
+extern unsigned bi_class_props[BI_NUM_CLASSES];
+
+/* abs/neg/outmod valid for a float op */
+#define BI_MODS (1 << 0)
+
/* It can't get any worse than csel4... can it? */
#define BIR_SRC_COUNT 4