broadcom/compiler: fix fp16 conversion operations
The case for converting a 32-bit integer to 16-bit float is not
correctly implemented.
Fixes: 214121e9b0
("broadcom/compiler: handle fp16 conversion ops")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32593>
This commit is contained in:

committed by
Marge Bot

parent
8ffdf5a2ab
commit
fd19106773
@@ -1469,6 +1469,8 @@ ntq_emit_alu(struct v3d_compile *c, nir_alu_instr *instr)
|
||||
uint32_t mask = bit_size == 16 ? 0xffff : 0xff;
|
||||
result = vir_AND(c, src[0], vir_uniform_ui(c, mask));
|
||||
result = sign_extend(c, result, bit_size, 32);
|
||||
} else {
|
||||
result = src[0];
|
||||
}
|
||||
result = vir_ITOF(c, result);
|
||||
vir_set_pack(c->defs[result.index], V3D_QPU_PACK_L);
|
||||
@@ -1481,6 +1483,8 @@ ntq_emit_alu(struct v3d_compile *c, nir_alu_instr *instr)
|
||||
if (bit_size < 32) {
|
||||
uint32_t mask = bit_size == 16 ? 0xffff : 0xff;
|
||||
result = vir_AND(c, src[0], vir_uniform_ui(c, mask));
|
||||
} else {
|
||||
result = src[0];
|
||||
}
|
||||
result = vir_UTOF(c, result);
|
||||
vir_set_pack(c->defs[result.index], V3D_QPU_PACK_L);
|
||||
|
Reference in New Issue
Block a user