Commit 430dc087 authored by Christian Gmeiner's avatar Christian Gmeiner Committed by Marge Bot
Browse files

freedreno/isa: add split_bits(..) methods



Will be used to split a value into needed number of 32 bit words.
Signed-off-by: Christian Gmeiner's avatarChristian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark's avatarRob Clark <robdclark@chromium.org>
Part-of: <mesa/mesa!11321>
parent 1a804895
......@@ -514,3 +514,18 @@ class ISA(object):
parts.append('v[' + str(i) + ']')
return ', '.join(parts)
def split_bits(self, value):
''' Split `value` into a list of 32-bit integers '''
mask, parts = (1 << 32) - 1, []
words = self.bitsize / 32
while value:
parts.append(hex(value & mask))
value >>= 32
# Add 'missing' words
while len(parts) < words:
parts.append('0x0')
return parts
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment