forked from M-Labs/artiq
Use the correct printf format for 64-bit integers.
This commit is contained in:
parent
236d5b886a
commit
86e006830c
|
@ -1339,7 +1339,13 @@ class ARTIQIRGenerator(algorithm.Visitor):
|
||||||
ir.Constant("True", builtins.TStr()),
|
ir.Constant("True", builtins.TStr()),
|
||||||
ir.Constant("False", builtins.TStr()))))
|
ir.Constant("False", builtins.TStr()))))
|
||||||
elif builtins.is_int(value.type):
|
elif builtins.is_int(value.type):
|
||||||
format_string += "%d"
|
width = builtins.get_int_width(value.type)
|
||||||
|
if width <= 32:
|
||||||
|
format_string += "%ld"
|
||||||
|
elif width <= 64:
|
||||||
|
format_string += "%lld"
|
||||||
|
else:
|
||||||
|
assert False
|
||||||
args.append(value)
|
args.append(value)
|
||||||
elif builtins.is_float(value.type):
|
elif builtins.is_float(value.type):
|
||||||
format_string += "%g"
|
format_string += "%g"
|
||||||
|
|
Loading…
Reference in New Issue