Lines Matching refs:expression
104 return Expression(val, name_base, varset)
105 elif isinstance(val, Expression):
126 is equivalent to when constructing the replacement expression. This is
183 # - If it's in the search expression, we don't need to check anything
184 # - If it's in the replace expression, either it's ambiguous (in which
198 % elif isinstance(val, Expression):
211 Expression=Expression)
316 class Expression(Value):
318 Value.__init__(self, expr, name_base, "expression")
333 'Expression cannot use an unsized conversion opcode with ' \
350 if isinstance(s, Expression):
361 return srcs + super(Expression, self).render(cache)
394 32-bit result so it could end up replacing a 64-bit expression with one
396 example, consider this expression:
400 In this case, in the search expression a must be 32-bit but b can
413 When doing this for the replacement expression, we make sure to never change
416 expression, but we make the user specify those constraints themselves, to
419 the source and replacment expressions) or the roots of the expression (the
420 replacement expression must produce the same bit size as the search
421 expression), we prevent merging a variable with anything when processing the
422 replacement expression, or specializing the search bitsize
432 from being allowed, since the search expression has the bit size of a and b,
434 expression. It also prevents something like:
446 replacement expression.
460 - In the search expression, variables can always be specialized to each
461 other and to physical bitsizes. In the replace expression, we disallow
462 this to avoid adding extra constraints to the search expression that
496 In the replace expression, disallow merging variables with other
515 expression, even if we're actually not, since otherwise we'd get errors
516 if the search expression specified some constraint but the replace
517 expression didn't, because we'd be merging a variable and a constant.
529 elif isinstance(val, Expression):
534 """Validate the an expression by performing classic Hindley-Milner
537 have the same bitsize. If we're operating on the replace expression, we
542 if not isinstance(val, Expression):
551 "Expression {} has {} sources, expected 1".format(
558 "Expression {} has {} sources, expected {}".format(
589 'replacement expression.'.format(
635 'somewhere, or the search expression.'.format(val)
637 if isinstance(val, Expression):
657 'The search expression bit size {} and replace expression ' \
685 if isinstance(search, Expression):
688 self.search = Expression(search, "search{0}".format(self.id), varset)
824 assert isinstance(src, Expression)