summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorConnor Abbott <cwabbott0@gmail.com>2021-06-23 17:51:28 +0200
committerMarge Bot <eric+marge@anholt.net>2021-06-23 17:20:29 +0000
commit2522f387a3d640b091b5ae2ca69a5e1d23edce99 (patch)
tree43f51710514789ece33d78920ecc2c63dafaa5c3 /src
parentdce680737ddb200c59c55a8c696114f793757398 (diff)
ir3: Add is_reg_special()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11469>
Diffstat (limited to 'src')
-rw-r--r--src/freedreno/ir3/ir3.h11
-rw-r--r--src/freedreno/ir3/ir3_postsched.c2
2 files changed, 12 insertions, 1 deletions
diff --git a/src/freedreno/ir3/ir3.h b/src/freedreno/ir3/ir3.h
index 487dd4b4b1a..f949ba32535 100644
--- a/src/freedreno/ir3/ir3.h
+++ b/src/freedreno/ir3/ir3.h
@@ -1006,6 +1006,17 @@ static inline bool writes_pred(struct ir3_instruction *instr)
return false;
}
+/* Is it something other than a normal register. Shared regs, p0, and a0/a1
+ * are considered special here. Special registers are always accessed with one
+ * size and never alias normal registers, even though a naive calculation
+ * would sometimes make it seem like e.g. r30.z aliases a0.x.
+ */
+static inline bool is_reg_special(const struct ir3_register *reg)
+{
+ return (reg->flags & IR3_REG_SHARED) ||
+ (reg_num(reg) == REG_A0) || (reg_num(reg) == REG_P0);
+}
+
/* returns defining instruction for reg */
/* TODO better name */
static inline struct ir3_instruction *ssa(struct ir3_register *reg)
diff --git a/src/freedreno/ir3/ir3_postsched.c b/src/freedreno/ir3/ir3_postsched.c
index 3b246ed0963..cf6bec512b5 100644
--- a/src/freedreno/ir3/ir3_postsched.c
+++ b/src/freedreno/ir3/ir3_postsched.c
@@ -422,7 +422,7 @@ add_reg_dep(struct ir3_postsched_deps_state *state,
* half-registers don't alias random full registers by pretending that
* they're full registers:
*/
- if ((reg->flags & IR3_REG_HALF) && num < regid(48, 0)) {
+ if ((reg->flags & IR3_REG_HALF) && !is_reg_special(reg)) {
/* single conflict in half-reg space: */
add_single_reg_dep(state, node, num, src_n);
} else {