Home | History | Annotate | Download | only in nir

Lines Matching defs:Value

90 class Value(object):
114 """Get the physical bit-size that has been chosen for this value, or if
115 there is none, the canonical value which currently represents this
117 variables in the equivalence class, the canonical value will be a
118 variable. We do this since we'll need to know which variable each value
124 while isinstance(bit_size, Value):
162 return "&{0}.value".format(self.__c_name(cache))
178 # case we'd reject it), or it equals the bit-size of the search value
185 ${val.type()}, { ${val.hex()} /* ${val.value} */ },
218 _constant_re = re.compile(r"(?P<value>[^@\(]+)(?:@(?P<bits>\d+))?")
220 class Constant(Value):
222 Value.__init__(self, val, name, "constant")
226 self.value = ast.literal_eval(m.group('value'))
229 self.value = val
232 if isinstance(self.value, bool):
237 if isinstance(self.value, (bool)):
238 return 'NIR_TRUE' if self.value else 'NIR_FALSE'
239 if isinstance(self.value, int):
240 return hex(self.value)
241 elif isinstance(self.value, float):
242 return hex(struct.unpack('Q', struct.pack('d', self.value))[0])
247 if isinstance(self.value, (bool)):
249 elif isinstance(self.value, int):
251 elif isinstance(self.value, float):
265 return self.value == other.value
275 class Variable(Value):
277 Value.__init__(self, val, name, "variable")
343 class Expression(Value):
345 Value.__init__(self, expr, name_base, "expression")
373 self.sources = [ Value.create(src, "{0}_{1}".format(name_base, i), varset)
448 register or SSA value. NIR has two simple rules for bit sizes that are
472 that takes two 64-bit values and produces a 32-bit value. As another
478 potentially have any bit size. If we had a 64-bit b value, we would end up
479 trying to and a 32-bit value with a 64-bit value which would be invalid
486 Each value maintains a "bit-size class", which is either an actual bit size
710 'Ambiguous bit size for replacement value {}: ' \
769 if isinstance(replace, Value):
772 self.replace = Value.create(replace, "replace{0}".format(self.id), varset)
783 and constants (without checking the actual value), leaving more detailed
891 # Note: we throw away the actual constant value!