mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 23:50:11 +01:00
aco: use UINT64_C on 64 bit constant arguments
avoids errors seen when building on 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.
Fixes: df645fa369 ("aco: implement VK_KHR_shader_float_controls")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7944>
This commit is contained in:
parent
454c848592
commit
ebfb9e1817
1 changed files with 3 additions and 3 deletions
|
|
@ -840,7 +840,7 @@ void emit_vop3a_instruction(isel_context *ctx, nir_alu_instr *instr, aco_opcode
|
|||
if (dst.size() == 1)
|
||||
bld.vop2(aco_opcode::v_mul_f32, Definition(dst), Operand(0x3f800000u), tmp);
|
||||
else
|
||||
bld.vop3(aco_opcode::v_mul_f64, Definition(dst), Operand(0x3FF0000000000000lu), tmp);
|
||||
bld.vop3(aco_opcode::v_mul_f64, Definition(dst), Operand(UINT64_C(0x3FF0000000000000)), tmp);
|
||||
} else if (num_sources == 3) {
|
||||
bld.vop3(op, Definition(dst), src[0], src[1], src[2]);
|
||||
} else {
|
||||
|
|
@ -1959,7 +1959,7 @@ void visit_alu_instr(isel_context *ctx, nir_alu_instr *instr)
|
|||
bld.vop2(aco_opcode::v_xor_b32, Definition(dst), Operand(0x80000000u), as_vgpr(ctx, src));
|
||||
} else if (dst.regClass() == v2) {
|
||||
if (ctx->block->fp_mode.must_flush_denorms16_64)
|
||||
src = bld.vop3(aco_opcode::v_mul_f64, bld.def(v2), Operand(0x3FF0000000000000lu), as_vgpr(ctx, src));
|
||||
src = bld.vop3(aco_opcode::v_mul_f64, bld.def(v2), Operand(UINT64_C(0x3FF0000000000000)), as_vgpr(ctx, src));
|
||||
Temp upper = bld.tmp(v1), lower = bld.tmp(v1);
|
||||
bld.pseudo(aco_opcode::p_split_vector, Definition(lower), Definition(upper), src);
|
||||
upper = bld.vop2(aco_opcode::v_xor_b32, bld.def(v1), Operand(0x80000000u), upper);
|
||||
|
|
@ -1981,7 +1981,7 @@ void visit_alu_instr(isel_context *ctx, nir_alu_instr *instr)
|
|||
bld.vop2(aco_opcode::v_and_b32, Definition(dst), Operand(0x7FFFFFFFu), as_vgpr(ctx, src));
|
||||
} else if (dst.regClass() == v2) {
|
||||
if (ctx->block->fp_mode.must_flush_denorms16_64)
|
||||
src = bld.vop3(aco_opcode::v_mul_f64, bld.def(v2), Operand(0x3FF0000000000000lu), as_vgpr(ctx, src));
|
||||
src = bld.vop3(aco_opcode::v_mul_f64, bld.def(v2), Operand(UINT64_C(0x3FF0000000000000)), as_vgpr(ctx, src));
|
||||
Temp upper = bld.tmp(v1), lower = bld.tmp(v1);
|
||||
bld.pseudo(aco_opcode::p_split_vector, Definition(lower), Definition(upper), src);
|
||||
upper = bld.vop2(aco_opcode::v_and_b32, bld.def(v1), Operand(0x7FFFFFFFu), upper);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue