v3dv: lower usubborrow and uaddcarry
authorIago Toral Quiroga <itoral@igalia.com>
Tue, 10 Mar 2020 11:03:19 +0000 (12:03 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 13 Oct 2020 21:21:28 +0000 (21:21 +0000)
For some reason our backend compiler doesn't have an implementation for
usubborrow, only for uaddcarry. We could add it, however, the existing
uaddcarry implementation also seems to fail some of the CTS tests,
which pass if we lower.

Fixes:
dEQP-VK.glsl.builtin.function.integer.uaddcarry.*
dEQP-VK.glsl.builtin.function.integer.usubborrow.*

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>

src/broadcom/vulkan/v3dv_pipeline.c

index d921b8f..d1878ae 100644 (file)
@@ -143,6 +143,11 @@ const nir_shader_compiler_options v3dv_nir_options = {
    .lower_unpack_snorm_4x8 = true,
    .lower_pack_half_2x16 = true,
    .lower_unpack_half_2x16 = true,
+   /* FIXME: see if we can avoid the uadd_carry and usub_borrow lowering and
+    * get the tests to pass since it might produce slightly better code.
+    */
+   .lower_uadd_carry = true,
+   .lower_usub_borrow = true,
    .lower_fdiv = true,
    .lower_find_lsb = true,
    .lower_ffma16 = true,