intel/fs: Emit better code for u2u of extract
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 27 Jan 2021 03:52:50 +0000 (19:52 -0800)
committerMarge Bot <eric+marge@anholt.net>
Wed, 18 Aug 2021 22:03:37 +0000 (22:03 +0000)
commit7c83aa0518988a3b2bc2bc6bf74d808db86982d1
tree814ef176885d719c2ecf8abbeab6af1d2d234b29
parente3f502e0074cc0b9d5a6807fa900b240cf7e0fc6
intel/fs: Emit better code for u2u of extract

Emitting the instructions one by one results in two MOV instructions
that won't be propagated.  By handling both instructions at once, a
single MOV is emitted.  For example, on Ice Lake this helps
dEQP-VK.spirv_assembly.type.vec3.i8.bitwise_xor_frag:

SIMD8 shader: 49 instructions. 1 loops. 4044 cycles. 0:0 spills:fills, 5 sends
SIMD8 shader: 41 instructions. 1 loops. 3804 cycles. 0:0 spills:fills, 5 sends

Without "intel/fs: Allow copy propagation between MOVs of mixed sizes,"
the improvement is still 8 instructions, but there are more instructions
to begin with:

SIMD8 shader: 52 instructions. 1 loops. 4164 cycles. 0:0 spills:fills, 5 sends
SIMD8 shader: 44 instructions. 1 loops. 3944 cycles. 0:0 spills:fills, 5 sends

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9025>
src/intel/compiler/brw_fs_nir.cpp