Skip to content

aco: use UINT64_C on 64 bit constant arguments

Jonathan Gray requested to merge jsg/mesa:aco-constants into master

avoids errors seen when building with OpenBSD/amd64

../src/amd/compiler/aco_instruction_selection.cpp:1677:62: error: ambiguous conversion for functional-style cast from 'unsigned long' to 'aco::Operand'
            bld.vop3(aco_opcode::v_mul_f64, Definition(dst), Operand(0x3FF0000000000000lu), tmp);

glibc uses unsigned long for uint64_t on LP64 archs and unsigned long long for uint64_t on ILP32 archs. On OpenBSD unsigned long long is used for uint64_t on all archs.

The Operand constructors are uint8_t uint16_t uint32_t uint64_t use UINT64_C so lu or llu suffix will be used as needed.

split out from !6511 (merged) as suggested by @neobrain

After 0b6448bb this will not cleanly backport to 20.2 and earlier branches, make sure the 0x3FF0000000000000lu values change to UINT64_C(0x3FF0000000000000).

Edited by Jonathan Gray

Merge request reports