summaryrefslogtreecommitdiffstats
path: root/src/panfrost/bifrost/bifrost_ops.h
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-08-14 12:19:01 -0700
committerAlyssa Rosenzweig <[email protected]>2019-08-14 22:54:07 +0000
commit62bbc23da53d8f5fef5ea457b6e373ffbec1739f (patch)
treec5bdbf23cf5b8a6f10920110a58e3504f73c71db /src/panfrost/bifrost/bifrost_ops.h
parentb73cbd6880ef52dff424dafc203f5385e40e3958 (diff)
pan/bifrost: Sync disassembler with Ryan's tree
The disassembler was updated to move common code with the compiler into a shared header. Additional, some new ops and control registers relating to rounding were added. Signed-off-by: Ryan Houdek <[email protected]> Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost/bifrost/bifrost_ops.h')
-rw-r--r--src/panfrost/bifrost/bifrost_ops.h120
1 files changed, 120 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/bifrost_ops.h b/src/panfrost/bifrost/bifrost_ops.h
new file mode 100644
index 00000000000..96aff303a92
--- /dev/null
+++ b/src/panfrost/bifrost/bifrost_ops.h
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2019 Ryan Houdek <[email protected]>
+ *
+ * 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.
+ */
+
+#ifndef __bifrost_ops_h__
+#define __bifrost_ops_h__
+
+enum bifrost_ir_ops {
+ op_fma_f32 = 0x0,
+ op_fmul_f32,
+ op_fadd_f32,
+ op_frcp_fast_f32,
+ op_max_f32,
+ op_min_f32,
+ op_add_i32,
+ op_sub_i32,
+ op_imad,
+ op_mul_i32,
+ op_or_i32,
+ op_and_i32,
+ op_lshift_i32,
+ op_xor_i32,
+ op_rshift_i32,
+ op_arshift_i32,
+ op_csel_i32,
+ op_imin3_i32,
+ op_umin3_i32,
+ op_imax3_i32,
+ op_umax3_i32,
+
+ op_branch,
+
+ // unary
+ op_trunc,
+ op_ceil,
+ op_floor,
+ op_round,
+ op_roundeven,
+
+ op_mov,
+ op_movi,
+
+ op_ld_ubo_v1,
+ op_ld_ubo_v2,
+ op_ld_ubo_v3,
+ op_ld_ubo_v4,
+
+ op_ld_attr_v1,
+ op_ld_attr_v2,
+ op_ld_attr_v3,
+ op_ld_attr_v4,
+
+ op_ld_var_addr,
+ op_st_vary_v1,
+ op_st_vary_v2,
+ op_st_vary_v3,
+ op_st_vary_v4,
+
+ op_store_v1,
+ op_store_v2,
+ op_store_v3,
+ op_store_v4,
+
+ op_create_vector,
+ op_extract_element,
+ op_last,
+};
+
+
+enum branch_cond {
+ BR_COND_LT = 0,
+ BR_COND_LE = 1,
+ BR_COND_GE = 2,
+ BR_COND_GT = 3,
+ // Equal vs. not-equal determined by src0/src1 comparison
+ BR_COND_EQ = 4,
+ // floating-point comparisons
+ // Becomes UNE when you flip the arguments
+ BR_COND_OEQ = 5,
+ // TODO what happens when you flip the arguments?
+ BR_COND_OGT = 6,
+ BR_COND_OLT = 7,
+};
+
+enum branch_code {
+ BR_ALWAYS = 63,
+};
+
+enum csel_cond {
+ CSEL_NEQ_0 = 0,
+ CSEL_FEQ,
+ CSEL_FGTR,
+ CSEL_FGE,
+ CSEL_IEQ,
+ CSEL_IGT,
+ CSEL_IGE,
+ CSEL_UGT,
+ CSEL_UGE,
+};
+
+#endif