summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_instr_set.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2019-05-09 15:27:14 -0700
committerIan Romanick <[email protected]>2019-05-14 11:25:02 -0700
commitede45bf9cfe20578712ae874f7a3d18fd86a1297 (patch)
tree5833f557c30d35fb5273a53648abefad0544120b /src/compiler/nir/nir_instr_set.c
parente99081e76d4a0bba51ddaf87bc8cfb382cb4a448 (diff)
nir: Rename commutative to 2src_commutative
The meaning of the new name is that the first two sources are commutative. Since this is only currently applied to two-source operations, there is no change. A future change will mark ffma as 2src_commutative. It is also possible that future work will add 3src_commutative for opcodes like fmin3. v2: s/commutative_2src/2src_commutative/g. I had originally considered this, but I discarded it because I did't want to deal with identifiers that (should) start with 2. Jason suggested it in review, so we decided that _2src_commutative would be used in nir_opcodes.py. Also add some comments documenting what 2src_commutative means. Also suggested by Jason. Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_instr_set.c')
-rw-r--r--src/compiler/nir/nir_instr_set.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_instr_set.c b/src/compiler/nir/nir_instr_set.c
index bd62bc974ed..c6a69d345c9 100644
--- a/src/compiler/nir/nir_instr_set.c
+++ b/src/compiler/nir/nir_instr_set.c
@@ -56,7 +56,7 @@ hash_alu(uint32_t hash, const nir_alu_instr *instr)
hash = HASH(hash, instr->dest.dest.ssa.bit_size);
/* We explicitly don't hash instr->dest.dest.exact */
- if (nir_op_infos[instr->op].algebraic_properties & NIR_OP_IS_COMMUTATIVE) {
+ if (nir_op_infos[instr->op].algebraic_properties & NIR_OP_IS_2SRC_COMMUTATIVE) {
assert(nir_op_infos[instr->op].num_inputs == 2);
uint32_t hash0 = hash_alu_src(hash, &instr->src[0],
nir_ssa_alu_instr_src_components(instr, 0));
@@ -528,7 +528,7 @@ nir_instrs_equal(const nir_instr *instr1, const nir_instr *instr2)
/* We explicitly don't hash instr->dest.dest.exact */
- if (nir_op_infos[alu1->op].algebraic_properties & NIR_OP_IS_COMMUTATIVE) {
+ if (nir_op_infos[alu1->op].algebraic_properties & NIR_OP_IS_2SRC_COMMUTATIVE) {
assert(nir_op_infos[alu1->op].num_inputs == 2);
return (nir_alu_srcs_equal(alu1, alu2, 0, 0) &&
nir_alu_srcs_equal(alu1, alu2, 1, 1)) ||