Lines Matching refs:search
176 # - If it's in the search expression, we don't need to check anything
178 # case we'd reject it), or it equals the bit-size of the search value
477 In this case, in the search expression a must be 32-bit but b can
482 that a given search-and-replace operation is 100% well-defined before we
491 the equivalence class of any of the search values. We could make the example
492 transforms above work by doing some extra run-time checking of the search
497 replacement expression must produce the same bit size as the search
499 replacement expression, or specializing the search bitsize
509 from being allowed, since the search expression has the bit size of a and b,
520 of the search expresssion, since those are the things that are known when
537 - In the search expression, variables can always be specialized to each
539 this to avoid adding extra constraints to the search expression that
591 uses of the same variable. We always do this as if we're in the search
593 if the search expression specified some constraint but the replace
706 def validate_replace(self, val, search):
709 bit_size == search.get_bit_size(), \
712 'somewhere, or the search expression.'.format(val)
716 self.validate_replace(src, search)
718 def validate(self, search, replace):
720 self.merge_variables(search)
722 self.validate_value(search)
727 # Check that search is always more specialized than replace. Note that
729 search_bit_size = search.get_bit_size()
734 'The search expression bit size {} and replace expression ' \
738 replace.set_bit_size(search)
740 self.validate_replace(replace, search)
750 search = transform[0]
762 if isinstance(search, Expression):
763 self.search = search
765 self.search = Expression(search, "search{0}".format(self.id), varset)
774 BitSizeValidator(varset).validate(self.search, self.replace)
777 """This class calculates a bottom-up tree automaton to quickly search for
784 checking to the search function which actually checks the leaves. The
785 automaton acts as a quick filter for the search function, requiring only n
793 self.patterns = [t.search for t in transforms]
910 # construct it to match the search opcode, in which case we
1045 * ${xform.search} => ${xform.replace}
1051 ${xform.search.render(cache)}
1059 { ${xforms[i].search.c_ptr(cache)}, ${xforms[i].replace.c_value_ptr(cache)}, ${xforms[i].condition_index} },
1158 if xform.search.opcode in conv_opcode_types:
1159 dst_type = conv_opcode_types[xform.search.opcode]
1161 sized_opcode = xform.search.opcode + str(size)
1164 self.opcode_xforms[xform.search.opcode].append(xform)
1166 # Check to make sure the search pattern does not unexpectedly contain
1169 comm_exprs = xform.search.comm_exprs
1171 if xform.search.many_commutative_expressions:
1188 print(" " + str(xform.search), file=sys.stderr)
1189 print("{}".format(xform.search.cond), file=sys.stderr)