freedreno/ir3: fix incorrect conversion folding
authorJonathan Marek <jonathan@marek.ca>
Thu, 23 Apr 2020 16:31:15 +0000 (12:31 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 24 Apr 2020 13:11:58 +0000 (13:11 +0000)
Fixes dEQP-VK.glsl.builtin.function.pack_unpack.unpackhalf2x16_compute

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4708>

src/freedreno/ir3/ir3_cf.c

index 9875ba4906f37c540c9cf18ee4033b42fd37c9ee..db9b5de008b7adcf608b482475a256dc075c5ea9 100644 (file)
@@ -103,6 +103,13 @@ try_conversion_folding(struct ir3_instruction *conv)
        case OPC_SIGN_F:
        case OPC_ABSNEG_F:
                return;
+       case OPC_MOV:
+               /* if src is a "cov" and type doesn't match, then it can't be folded
+                * for example cov.u32u16+cov.f16f32 can't be folded to cov.u32f32
+                */
+               if (src->cat1.dst_type != src->cat1.src_type &&
+                       conv->cat1.src_type != src->cat1.dst_type)
+                       return;
        default:
                break;
        }