panfrost/midgard: Promote smul to vmul
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Wed, 27 Feb 2019 05:32:16 +0000 (05:32 +0000)
committerAlyssa Rosenzweig <alyssa@rosenzweig.io>
Mon, 4 Mar 2019 05:02:58 +0000 (05:02 +0000)
smul comes first in the pipeline, before vmul. Until we have a full
instruction scheduler, it's better to have vmul prioritized to maximize
bundle size.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Tested-by: Tomeu Vizoso <tomeu.vizoso@collabora.com
src/gallium/drivers/panfrost/midgard/midgard_compile.c

index f533572c05d0d99c11052a68a2fe803182c1b564..e37037ac73790691cd140225a6c0d2057f80b9b2 100644 (file)
@@ -2162,7 +2162,7 @@ schedule_bundle(compiler_context *ctx, midgard_block *block, midgard_instruction
                                                 if ((units & UNIT_SADD) && !(control & UNIT_SADD))
                                                         unit = UNIT_SADD;
                                                 else if (units & UNIT_SMUL)
-                                                        unit = UNIT_SMUL;
+                                                        unit = ((units & UNIT_VMUL) && !(control & UNIT_VMUL)) ? UNIT_VMUL : UNIT_SMUL;
                                                 else if ((units & UNIT_VADD) && !(control & UNIT_VADD))
                                                         unit = UNIT_VADD;
                                                 else