mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 18:08:40 +02:00
freedreno/registers: Small reg32 vs reg64 fixes
1) only use "ull" for reg64, which avoids some compiler warnings on the kernel side. 2) use "ull" for booleans as well, if reg64 Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40522>
This commit is contained in:
parent
2f503fe3f0
commit
fc3cf60188
1 changed files with 5 additions and 2 deletions
|
|
@ -301,6 +301,7 @@ class Bitset(object):
|
|||
def dump(self, has_variants, prefix=None, reg=None):
|
||||
if prefix is None:
|
||||
prefix = self.name
|
||||
suffix = ""
|
||||
if self.reg and self.reg.bit_size == 64:
|
||||
print(
|
||||
"static CONSTEXPR inline uint32_t %s_LO(uint32_t val)\n{" % prefix)
|
||||
|
|
@ -308,6 +309,8 @@ class Bitset(object):
|
|||
print(
|
||||
"static CONSTEXPR inline uint32_t %s_HI(uint32_t val)\n{" % prefix)
|
||||
print("\treturn val;\n}")
|
||||
suffix = "ull"
|
||||
|
||||
for f in self.fields:
|
||||
if f.name:
|
||||
name = prefix + "_" + f.name
|
||||
|
|
@ -317,10 +320,10 @@ class Bitset(object):
|
|||
if not f.name and f.low == 0 and f.shr == 0 and f.type not in ["float", "fixed", "ufixed"]:
|
||||
pass
|
||||
elif f.type == "boolean" or (f.type is None and f.low == f.high):
|
||||
tab_to("#define %s" % name, "0x%08x" % (1 << f.low))
|
||||
tab_to("#define %s" % name, "0x%08x%s" % ((1 << f.low), suffix))
|
||||
else:
|
||||
tab_to("#define %s__MASK" %
|
||||
name, "0x%08xull" % mask(f.low, f.high))
|
||||
name, "0x%08x%s" % (mask(f.low, f.high), suffix))
|
||||
tab_to("#define %s__SHIFT" % name, "%d" % f.low)
|
||||
type, val = f.ctype("val")
|
||||
ret_type = "uint64_t" if reg and reg.bit_size == 64 else "uint32_t"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue