[Mesa-dev] [PATCH 1/3] gallivm: support printing of 64 bit integers

Zack Rusin zackr at vmware.com
Tue Oct 8 12:22:22 PDT 2013


only 8 and 32 bit integers were supported before.

Signed-off-by: Zack Rusin <zackr at vmware.com>
---
 src/gallium/auxiliary/gallivm/lp_bld_printf.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_printf.c b/src/gallium/auxiliary/gallivm/lp_bld_printf.c
index 1324da2..d06209a 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_printf.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_printf.c
@@ -106,7 +106,11 @@ lp_build_print_value(struct gallivm_state *gallivm,
       type_fmt[4] = 'g';
       type_fmt[5] = '\0';
    } else if (type_kind == LLVMIntegerTypeKind) {
-      if (LLVMGetIntTypeWidth(type_ref) == 8) {
+      if (LLVMGetIntTypeWidth(type_ref) == 64) {
+         type_fmt[2] = 'l';
+         type_fmt[3] = 'd';
+         type_fmt[4] = '\0';
+      } else if (LLVMGetIntTypeWidth(type_ref) == 8) {
          type_fmt[2] = 'u';
       } else {
          type_fmt[2] = 'i';
-- 
1.8.1.2


More information about the mesa-dev mailing list