diff options
author | Ian Romanick <[email protected]> | 2019-05-09 15:27:14 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2019-05-14 11:25:02 -0700 |
commit | ede45bf9cfe20578712ae874f7a3d18fd86a1297 (patch) | |
tree | 5833f557c30d35fb5273a53648abefad0544120b /src/compiler/nir/nir_algebraic.py | |
parent | e99081e76d4a0bba51ddaf87bc8cfb382cb4a448 (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_algebraic.py')
-rw-r--r-- | src/compiler/nir/nir_algebraic.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_algebraic.py b/src/compiler/nir/nir_algebraic.py index 47f374bfabd..d945c1a8075 100644 --- a/src/compiler/nir/nir_algebraic.py +++ b/src/compiler/nir/nir_algebraic.py @@ -340,7 +340,7 @@ class Expression(Value): """ self.comm_exprs = 0 if self.opcode not in conv_opcode_types and \ - "commutative" in opcodes[self.opcode].algebraic_properties: + "2src_commutative" in opcodes[self.opcode].algebraic_properties: self.comm_expr_idx = base_idx self.comm_exprs += 1 else: @@ -797,7 +797,7 @@ class TreeAutomaton(object): def get_item(opcode, children, pattern=None): commutative = len(children) == 2 \ - and "commutative" in opcodes[opcode].algebraic_properties + and "2src_commutative" in opcodes[opcode].algebraic_properties item = self.items.setdefault((opcode, children), self.Item(opcode, children)) if commutative: |