summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_bld_debug.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2009-09-10 15:33:45 -0700
committerIan Romanick <ian.d.romanick@intel.com>2009-09-10 15:33:45 -0700
commitb8e1e8d2d8ae6ffbf8f271b46ee89788a926b3b0 (patch)
tree5db502ab80287bfc8ff61082784017c7448464f5 /src/gallium/drivers/llvmpipe/lp_bld_debug.c
parent81722c5d7e8e93d837510b9e6e5d014ec64cf4b3 (diff)
parentd9dc4cb0e4f578da9e50c9d1ba6fd9c22ea2fca6 (diff)
Merge branch 'master' into asm-shader-rework-2
Conflicts: src/mesa/shader/lex.yy.c src/mesa/shader/program_parse.tab.c src/mesa/shader/program_parse.tab.h
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_bld_debug.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_debug.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_debug.c b/src/gallium/drivers/llvmpipe/lp_bld_debug.c
index 30925b5f41..59d8f492e6 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_debug.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_debug.c
@@ -30,10 +30,27 @@
#include <udis86.h>
#endif
+#include "util/u_math.h"
#include "util/u_debug.h"
#include "lp_bld_debug.h"
+/**
+ * Check alignment.
+ *
+ * It is important that this check is not implemented as a macro or inlined
+ * function, as the compiler assumptions in respect to alignment of global
+ * and stack variables would often make the check a no op, defeating the
+ * whole purpose of the exercise.
+ */
+boolean
+lp_check_alignment(const void *ptr, unsigned alignment)
+{
+ assert(util_is_pot(alignment));
+ return ((uintptr_t)ptr & (alignment - 1)) == 0;
+}
+
+
void
lp_disassemble(const void* func)
{