mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 21:40:20 +01:00
gallivm: support printing of 64 bit integers
only 8 and 32 bit integers were supported before. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: José Fonseca <jfonseca@vmware.com>
This commit is contained in:
parent
58bab95c95
commit
c01c6a95b4
1 changed files with 6 additions and 1 deletions
|
|
@ -26,6 +26,7 @@
|
|||
**************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_memory.h"
|
||||
|
|
@ -106,7 +107,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) {
|
||||
unsigned flen = strlen(PRId64);
|
||||
assert(flen <= 3);
|
||||
strncpy(type_fmt + 2, PRId64, flen);
|
||||
} else if (LLVMGetIntTypeWidth(type_ref) == 8) {
|
||||
type_fmt[2] = 'u';
|
||||
} else {
|
||||
type_fmt[2] = 'i';
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue