pan/bit: Interpret BI_SELECT
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 24 Apr 2020 23:14:21 +0000 (19:14 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 27 Apr 2020 14:52:26 +0000 (14:52 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766>

src/panfrost/bifrost/test/bi_interpret.c

index ea0064c0a3995fae3eecd0c2c82ef3c023476392..182a012bd78ace9834a6b7d4dbd51443bb5ad49b 100644 (file)
@@ -529,8 +529,20 @@ bit_step(struct bit_state *s, bi_instruction *ins, bool FMA)
                 break;
        }
 
+        case BI_SELECT: {
+                if (ins->dest_type == nir_type_uint16) {
+                        for (unsigned c = 0; c < 2; ++c)
+                                dest.u16[c] = srcs[c].u16[ins->swizzle[c][0]];
+                } else if (ins->dest_type == nir_type_uint8) {
+                        for (unsigned c = 0; c < 4; ++c)
+                                dest.u8[c] = srcs[c].u8[ins->swizzle[c][0]];
+                } else {
+                        unreachable("Unknown type");
+                }
+                break;
+        }
+
         case BI_SHIFT:
-        case BI_SELECT:
         case BI_ROUND:
                 unreachable("Unsupported op");