pan/bi: Fix source mod testing for CMP
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 28 Apr 2020 16:27:11 +0000 (12:27 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 28 Apr 2020 17:17:48 +0000 (17:17 +0000)
Outputs u32.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4789>

src/panfrost/bifrost/bir.c

index a40b33800f80c8e3dbd9fc3991d25697ea067768..923815b15246003619c09c8b7fccc3a50eec2fe9 100644 (file)
@@ -38,14 +38,15 @@ bi_has_outmod(bi_instruction *ins)
         return classy && floaty;
 }
 
-/* Technically we should check the source type, not the dest
- * type, but the type converting opcodes (i2f, f2i) don't
- * actually support mods so it doesn't matter. */
+/* Have to check source for e.g. compares */
 
 bool
 bi_has_source_mods(bi_instruction *ins)
 {
-        return bi_has_outmod(ins);
+        bool classy = bi_class_props[ins->type] & BI_MODS;
+        bool floaty = nir_alu_type_get_base_type(ins->src_types[0]) == nir_type_float;
+
+        return classy && floaty;
 }
 
 /* A source is swizzled if the op is swizzlable, in 8-bit or