tgsi: implement ddiv opcode
authorRoland Scheidegger <sroland@vmware.com>
Mon, 23 Jan 2017 17:10:44 +0000 (18:10 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Tue, 24 Jan 2017 18:12:46 +0000 (19:12 +0100)
softpipe (along with llvmpipe) claims to support arb_gpu_shader_fp64,
so we really need to support that opcode.

Cc: 17.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/tgsi/tgsi_exec.c

index 915cd10e683083b9a5557ed3f5486b9721303439..2135ad103de8c51dde93a5c217106a8783f21c5f 100644 (file)
@@ -209,6 +209,16 @@ micro_dadd(union tgsi_double_channel *dst,
    dst->d[3] = src[0].d[3] + src[1].d[3];
 }
 
+static void
+micro_ddiv(union tgsi_double_channel *dst,
+          const union tgsi_double_channel *src)
+{
+   dst->d[0] = src[0].d[0] / src[1].d[0];
+   dst->d[1] = src[0].d[1] / src[1].d[1];
+   dst->d[2] = src[0].d[2] / src[1].d[2];
+   dst->d[3] = src[0].d[3] / src[1].d[3];
+}
+
 static void
 micro_ddx(union tgsi_exec_channel *dst,
           const union tgsi_exec_channel *src)
@@ -5995,6 +6005,10 @@ exec_instruction(
       exec_double_binary(mach, inst, micro_dadd, TGSI_EXEC_DATA_DOUBLE);
       break;
 
+   case TGSI_OPCODE_DDIV:
+      exec_double_binary(mach, inst, micro_ddiv, TGSI_EXEC_DATA_DOUBLE);
+      break;
+
    case TGSI_OPCODE_DMUL:
       exec_double_binary(mach, inst, micro_dmul, TGSI_EXEC_DATA_DOUBLE);
       break;