From: Jason Ekstrand Date: Wed, 22 Jan 2020 17:58:44 +0000 (-0600) Subject: anv: Add another align_down helper X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=658dc9ca506ae9e4894c2bb1577281a356f2d817;p=mesa.git anv: Add another align_down helper Reviewed-by: Lionel Landwerlin Reviewed-by: Jordan Justen Part-of: --- diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 2795cbda48f..6b4698d7144 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -237,10 +237,16 @@ align_u32(uint32_t v, uint32_t a) } static inline uint64_t -align_u64(uint64_t v, uint64_t a) +align_down_u64(uint64_t v, uint64_t a) { assert(a != 0 && a == (a & -a)); - return (v + a - 1) & ~(a - 1); + return v & ~(a - 1); +} + +static inline uint64_t +align_u64(uint64_t v, uint64_t a) +{ + return align_down_u64(v + a - 1, a); } static inline int32_t