mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
pan/bi: Properly lower add/sub with saturation on v11+
We were wrongly lowering all add/sub operations with saturation on 8-bit values on v11+. This fixes CTS failures on "dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.*" and likely more apps. Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com> Fixes:d79a31bf81("pan/bi: Lower removed instructions in algebraic on v11+") Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34743> (cherry picked from commit6ab4ae1a19)
This commit is contained in:
parent
03dc23baa2
commit
1f82af229d
3 changed files with 14 additions and 15 deletions
|
|
@ -404,7 +404,7 @@
|
|||
"description": "pan/bi: Properly lower add/sub with saturation on v11+",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "d79a31bf81a3527897f7c6f5178abd47d80fbaee",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -5018,6 +5018,19 @@ bi_lower_bit_size(const nir_instr *instr, void *data)
|
|||
if (pan_arch(gpu_id) < 11)
|
||||
return 0;
|
||||
return (nir_src_bit_size(alu->src[0].src) == 32) ? 0 : 32;
|
||||
case nir_op_iadd:
|
||||
case nir_op_isub:
|
||||
case nir_op_iadd_sat:
|
||||
case nir_op_uadd_sat:
|
||||
case nir_op_isub_sat:
|
||||
case nir_op_usub_sat:
|
||||
case nir_op_ineg:
|
||||
case nir_op_iabs:
|
||||
/* On v11+, IABS.v4s8, IADD.v4s8 and ISUB.v4s8 are gone */
|
||||
if (pan_arch(gpu_id) < 11)
|
||||
return 0;
|
||||
|
||||
return (nir_src_bit_size(alu->src[0].src) == 8) ? 16 : 0;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,20 +100,6 @@ algebraic_late = [
|
|||
# On v11+, F16_TO_S32/F16_TO_U32 is gone but we still have F32_TO_S32/F32_TO_U32
|
||||
(('f2i32', 'a@16'), ('f2i32', ('f2f32', a)), 'gpu_arch >= 11'),
|
||||
(('f2u32', 'a@16'), ('f2u32', ('f2f32', a)), 'gpu_arch >= 11'),
|
||||
|
||||
# On v11+, IABS.v4s8 is gone
|
||||
(('iabs', 'a@8'), ('i2i8', ('iabs', ('i2i16', a))), 'gpu_arch >= 11'),
|
||||
|
||||
# On v11+, IADD.v4s8 is gone
|
||||
(('iadd', 'a@8', 'b@8'), ('i2i8', ('iadd', ('i2i16', a), ('i2i16', b))), 'gpu_arch >= 11'),
|
||||
(('iadd_sat', 'a@8', 'b@8'), ('i2i8', ('iadd_sat', ('i2i16', a), ('i2i16', b))), 'gpu_arch >= 11'),
|
||||
(('uadd_sat', 'a@8', 'b@8'), ('u2u8', ('uadd_sat', ('u2u16', a), ('u2u16', b))), 'gpu_arch >= 11'),
|
||||
|
||||
# On v11+, ISUB.v4s8 is gone
|
||||
(('ineg', 'a@8'), ('i2i8', ('ineg', ('i2i16', a))), 'gpu_arch >= 11'),
|
||||
(('isub', 'a@8', 'b@8'), ('i2i8', ('isub', ('i2i16', a), ('i2i16', b))), 'gpu_arch >= 11'),
|
||||
(('isub_sat', 'a@8', 'b@8'), ('i2i8', ('isub_sat', ('i2i16', a), ('i2i16', b))), 'gpu_arch >= 11'),
|
||||
(('usub_sat', 'a@8', 'b@8'), ('u2u8', ('usub_sat', ('u2u16', a), ('u2u16', b))), 'gpu_arch >= 11'),
|
||||
]
|
||||
|
||||
# On v11+, ICMP_OR.v4u8 was removed
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue