panfrost,asahi: Use util_sign_extend for unpacking
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Kristian H. Kristensen <hoegsberg@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17214>
This commit is contained in:
parent
6787c96039
commit
642283a2c1
|
@ -117,8 +117,7 @@ __gen_unpack_sint(const uint8_t *restrict cl, uint32_t start, uint32_t end)
|
|||
int size = end - start + 1;
|
||||
int64_t val = __gen_unpack_uint(cl, start, end);
|
||||
|
||||
/* Get the sign bit extended. */
|
||||
return (val << (64 - size)) >> (64 - size);
|
||||
return util_sign_extend(val, size);
|
||||
}
|
||||
|
||||
#define agx_prepare(dst, T) \\
|
||||
|
|
|
@ -118,8 +118,7 @@ __gen_unpack_sint(const uint8_t *restrict cl, uint32_t start, uint32_t end)
|
|||
int size = end - start + 1;
|
||||
int64_t val = __gen_unpack_uint(cl, start, end);
|
||||
|
||||
/* Get the sign bit extended. */
|
||||
return (val << (64 - size)) >> (64 - size);
|
||||
return util_sign_extend(val, size);
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
|
|
Loading…
Reference in New Issue