Merge remote-tracking branch 'origin/master' into pipe-video
[mesa.git] / src / gallium / drivers / r600 / r600_shader.c
index 0b4dc75e584d3c757af873ceb579ca2b58f2a4a6..845d41ace0278be86cca714b9eb62b41f125ec7d 100644 (file)
@@ -21,6 +21,7 @@
  * USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 #include "pipe/p_shader_tokens.h"
+#include "tgsi/tgsi_info.h"
 #include "tgsi/tgsi_parse.h"
 #include "tgsi/tgsi_scan.h"
 #include "tgsi/tgsi_dump.h"
 #include "r600d.h"
 #include <stdio.h>
 #include <errno.h>
-
-static void r600_pipe_shader_vs(struct pipe_context *ctx, struct r600_pipe_shader *shader)
-{
-       struct r600_pipe_state *rstate = &shader->rstate;
-       struct r600_shader *rshader = &shader->shader;
-       unsigned spi_vs_out_id[10];
-       unsigned i, tmp;
-
-       /* clear previous register */
-       rstate->nregs = 0;
-
-       /* so far never got proper semantic id from tgsi */
-       /* FIXME better to move this in config things so they get emited
-        * only one time per cs
-        */
-       for (i = 0; i < 10; i++) {
-               spi_vs_out_id[i] = 0;
-       }
-       for (i = 0; i < 32; i++) {
-               tmp = i << ((i & 3) * 8);
-               spi_vs_out_id[i / 4] |= tmp;
-       }
-       for (i = 0; i < 10; i++) {
-               r600_pipe_state_add_reg(rstate,
-                                       R_028614_SPI_VS_OUT_ID_0 + i * 4,
-                                       spi_vs_out_id[i], 0xFFFFFFFF, NULL);
-       }
-
-       r600_pipe_state_add_reg(rstate,
-                       R_0286C4_SPI_VS_OUT_CONFIG,
-                       S_0286C4_VS_EXPORT_COUNT(rshader->noutput - 2),
-                       0xFFFFFFFF, NULL);
-       r600_pipe_state_add_reg(rstate,
-                       R_028868_SQ_PGM_RESOURCES_VS,
-                       S_028868_NUM_GPRS(rshader->bc.ngpr) |
-                       S_028868_STACK_SIZE(rshader->bc.nstack),
-                       0xFFFFFFFF, NULL);
-       r600_pipe_state_add_reg(rstate,
-                       R_0288D0_SQ_PGM_CF_OFFSET_VS,
-                       0x00000000, 0xFFFFFFFF, NULL);
-       r600_pipe_state_add_reg(rstate,
-                       R_028858_SQ_PGM_START_VS,
-                       r600_bo_offset(shader->bo) >> 8, 0xFFFFFFFF, shader->bo);
-
-       r600_pipe_state_add_reg(rstate,
-                               R_03E200_SQ_LOOP_CONST_0 + (32 * 4), 0x01000FFF,
-                               0xFFFFFFFF, NULL);
-
-}
+#include <byteswap.h>
 
 int r600_find_vs_semantic_index(struct r600_shader *vs,
                                struct r600_shader *ps, int id)
@@ -97,109 +50,12 @@ int r600_find_vs_semantic_index(struct r600_shader *vs,
        return 0;
 }
 
-static void r600_pipe_shader_ps(struct pipe_context *ctx, struct r600_pipe_shader *shader)
-{
-       struct r600_pipe_state *rstate = &shader->rstate;
-       struct r600_shader *rshader = &shader->shader;
-       unsigned i, exports_ps, num_cout, spi_ps_in_control_0, spi_input_z, spi_ps_in_control_1;
-       int pos_index = -1, face_index = -1;
-
-       rstate->nregs = 0;
-
-       for (i = 0; i < rshader->ninput; i++) {
-               if (rshader->input[i].name == TGSI_SEMANTIC_POSITION)
-                       pos_index = i;
-               if (rshader->input[i].name == TGSI_SEMANTIC_FACE)
-                       face_index = i;
-       }
-
-       for (i = 0; i < rshader->noutput; i++) {
-               if (rshader->output[i].name == TGSI_SEMANTIC_POSITION)
-                       r600_pipe_state_add_reg(rstate,
-                                               R_02880C_DB_SHADER_CONTROL,
-                                               S_02880C_Z_EXPORT_ENABLE(1),
-                                               S_02880C_Z_EXPORT_ENABLE(1), NULL);
-               if (rshader->output[i].name == TGSI_SEMANTIC_STENCIL)
-                       r600_pipe_state_add_reg(rstate,
-                                               R_02880C_DB_SHADER_CONTROL,
-                                               S_02880C_STENCIL_REF_EXPORT_ENABLE(1),
-                                               S_02880C_STENCIL_REF_EXPORT_ENABLE(1), NULL);
-       }
-
-       exports_ps = 0;
-       num_cout = 0;
-       for (i = 0; i < rshader->noutput; i++) {
-               if (rshader->output[i].name == TGSI_SEMANTIC_POSITION || rshader->output[i].name == TGSI_SEMANTIC_STENCIL)
-                       exports_ps |= 1;
-               else if (rshader->output[i].name == TGSI_SEMANTIC_COLOR) {
-                       num_cout++;
-               }
-       }
-       exports_ps |= S_028854_EXPORT_COLORS(num_cout);
-       if (!exports_ps) {
-               /* always at least export 1 component per pixel */
-               exports_ps = 2;
-       }
-
-       spi_ps_in_control_0 = S_0286CC_NUM_INTERP(rshader->ninput) |
-                               S_0286CC_PERSP_GRADIENT_ENA(1);
-       spi_input_z = 0;
-       if (pos_index != -1) {
-               spi_ps_in_control_0 |= (S_0286CC_POSITION_ENA(1) |
-                                       S_0286CC_POSITION_CENTROID(rshader->input[pos_index].centroid) |
-                                       S_0286CC_POSITION_ADDR(rshader->input[pos_index].gpr) |
-                                       S_0286CC_BARYC_SAMPLE_CNTL(1));
-               spi_input_z |= 1;
-       }
-
-       spi_ps_in_control_1 = 0;
-       if (face_index != -1) {
-               spi_ps_in_control_1 |= S_0286D0_FRONT_FACE_ENA(1) |
-                       S_0286D0_FRONT_FACE_ADDR(rshader->input[face_index].gpr);
-       }
-
-       r600_pipe_state_add_reg(rstate, R_0286CC_SPI_PS_IN_CONTROL_0, spi_ps_in_control_0, 0xFFFFFFFF, NULL);
-       r600_pipe_state_add_reg(rstate, R_0286D0_SPI_PS_IN_CONTROL_1, spi_ps_in_control_1, 0xFFFFFFFF, NULL);
-       r600_pipe_state_add_reg(rstate, R_0286D8_SPI_INPUT_Z, spi_input_z, 0xFFFFFFFF, NULL);
-       r600_pipe_state_add_reg(rstate,
-                               R_028840_SQ_PGM_START_PS,
-                               r600_bo_offset(shader->bo) >> 8, 0xFFFFFFFF, shader->bo);
-       r600_pipe_state_add_reg(rstate,
-                               R_028850_SQ_PGM_RESOURCES_PS,
-                               S_028868_NUM_GPRS(rshader->bc.ngpr) |
-                               S_028868_STACK_SIZE(rshader->bc.nstack),
-                               0xFFFFFFFF, NULL);
-       r600_pipe_state_add_reg(rstate,
-                               R_028854_SQ_PGM_EXPORTS_PS,
-                               exports_ps, 0xFFFFFFFF, NULL);
-       r600_pipe_state_add_reg(rstate,
-                               R_0288CC_SQ_PGM_CF_OFFSET_PS,
-                               0x00000000, 0xFFFFFFFF, NULL);
-
-       if (rshader->fs_write_all) {
-               r600_pipe_state_add_reg(rstate, R_028808_CB_COLOR_CONTROL,
-                                       S_028808_MULTIWRITE_ENABLE(1),
-                                       S_028808_MULTIWRITE_ENABLE(1),
-                                       NULL);
-       }
-
-       if (rshader->uses_kill) {
-               /* only set some bits here, the other bits are set in the dsa state */
-               r600_pipe_state_add_reg(rstate,
-                                       R_02880C_DB_SHADER_CONTROL,
-                                       S_02880C_KILL_ENABLE(1),
-                                       S_02880C_KILL_ENABLE(1), NULL);
-       }
-       r600_pipe_state_add_reg(rstate,
-                               R_03E200_SQ_LOOP_CONST_0, 0x01000FFF,
-                               0xFFFFFFFF, NULL);
-}
-
 static int r600_pipe_shader(struct pipe_context *ctx, struct r600_pipe_shader *shader)
 {
        struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
        struct r600_shader *rshader = &shader->shader;
-       void *ptr;
+       uint32_t *ptr;
+       int     i;
 
        /* copy new shader */
        if (shader->bo == NULL) {
@@ -207,8 +63,14 @@ static int r600_pipe_shader(struct pipe_context *ctx, struct r600_pipe_shader *s
                if (shader->bo == NULL) {
                        return -ENOMEM;
                }
-               ptr = r600_bo_map(rctx->radeon, shader->bo, 0, NULL);
-               memcpy(ptr, rshader->bc.bytecode, rshader->bc.ndw * 4);
+               ptr = (uint32_t*)r600_bo_map(rctx->radeon, shader->bo, 0, NULL);
+               if (R600_BIG_ENDIAN) {
+                       for (i = 0; i < rshader->bc.ndw; ++i) {
+                               ptr[i] = bswap_32(rshader->bc.bytecode[i]);
+                       }
+               } else {
+                       memcpy(ptr, rshader->bc.bytecode, rshader->bc.ndw * sizeof(*ptr));
+               }
                r600_bo_unmap(rctx->radeon, shader->bo);
        }
        /* build state */
@@ -614,6 +476,7 @@ static int tgsi_fetch_rel_const(struct r600_shader_ctx *ctx, unsigned int offset
        vtx.num_format_all = 2;         /* NUM_FORMAT_SCALED */
        vtx.format_comp_all = 1;        /* FORMAT_COMP_SIGNED */
        vtx.srf_mode_all = 1;           /* SRF_MODE_NO_ZERO */
+       vtx.endian = r600_endian_swap(32);
 
        if ((r = r600_bc_add_vtx(ctx->bc, &vtx)))
                return r;
@@ -714,7 +577,7 @@ static int r600_shader_from_tgsi(const struct tgsi_token *tokens, struct r600_sh
        struct tgsi_full_property *property;
        struct r600_shader_ctx ctx;
        struct r600_bc_output output[32];
-       unsigned noutput;
+       unsigned output_done, noutput;
        unsigned opcode;
        int i, r = 0, pos0;
 
@@ -848,8 +711,10 @@ static int r600_shader_from_tgsi(const struct tgsi_token *tokens, struct r600_sh
                output[i].swizzle_z = 2;
                output[i].swizzle_w = 3;
                output[i].burst_count = 1;
+               output[i].barrier = 1;
                output[i].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PARAM;
                output[i].array_base = i - pos0;
+               output[i].inst = BC_INST(ctx.bc, V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT);
                switch (ctx.type) {
                case TGSI_PROCESSOR_VERTEX:
                        if (shader->output[i].name == TGSI_SEMANTIC_POSITION) {
@@ -910,8 +775,10 @@ static int r600_shader_from_tgsi(const struct tgsi_token *tokens, struct r600_sh
                        output[i].swizzle_z = 2;
                        output[i].swizzle_w = 3;
                        output[i].burst_count = 1;
+                       output[i].barrier = 1;
                        output[i].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PARAM;
                        output[i].array_base = 0;
+                       output[i].inst = BC_INST(ctx.bc, V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT);
                        noutput++;
                }
        }
@@ -925,10 +792,22 @@ static int r600_shader_from_tgsi(const struct tgsi_token *tokens, struct r600_sh
                output[0].swizzle_z = 7;
                output[0].swizzle_w = 7;
                output[0].burst_count = 1;
+               output[0].barrier = 1;
                output[0].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PIXEL;
                output[0].array_base = 0;
+               output[0].inst = BC_INST(ctx.bc, V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT);
                noutput++;
        }
+       /* set export done on last export of each type */
+       for (i = noutput - 1, output_done = 0; i >= 0; i--) {
+               if (i == (noutput - 1)) {
+                       output[i].end_of_program = 1;
+               }
+               if (!(output_done & (1 << output[i].type))) {
+                       output_done |= (1 << output[i].type);
+                       output[i].inst = BC_INST(ctx.bc, V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT_DONE);
+               }
+       }
        /* add output to bytecode */
        for (i = 0; i < noutput; i++) {
                r = r600_bc_add_output(ctx.bc, &output[i]);
@@ -946,7 +825,8 @@ out_err:
 
 static int tgsi_unsupported(struct r600_shader_ctx *ctx)
 {
-       R600_ERR("%d tgsi opcode unsupported\n", ctx->inst_info->tgsi_opcode);
+       R600_ERR("%s tgsi opcode unsupported\n",
+                tgsi_get_opcode_name(ctx->inst_info->tgsi_opcode));
        return -EINVAL;
 }
 
@@ -1027,6 +907,8 @@ static int tgsi_op2_s(struct r600_shader_ctx *ctx, int swap)
                        break;
                case TGSI_OPCODE_ABS:
                        alu.src[0].abs = 1;
+                       if (alu.src[0].neg)
+                         alu.src[0].neg = 0;
                        break;
                default:
                        break;
@@ -1657,9 +1539,13 @@ static int tgsi_tex(struct r600_shader_ctx *ctx)
        unsigned src_gpr;
        int r, i;
        int opcode;
-       boolean src_not_temp =
-               inst->Src[0].Register.File != TGSI_FILE_TEMPORARY &&
-               inst->Src[0].Register.File != TGSI_FILE_INPUT;
+       /* Texture fetch instructions can only use gprs as source.
+        * Also they cannot negate the source or take the absolute value */
+       const boolean src_requires_loading =
+               (inst->Src[0].Register.File != TGSI_FILE_TEMPORARY &&
+               inst->Src[0].Register.File != TGSI_FILE_INPUT) ||
+               ctx->src[0].neg || ctx->src[0].abs;
+       boolean src_loaded = FALSE;
 
        src_gpr = ctx->file_offset[inst->Src[0].Register.File] + inst->Src[0].Register.Index;
 
@@ -1701,42 +1587,20 @@ static int tgsi_tex(struct r600_shader_ctx *ctx)
                r = r600_bc_add_alu(ctx->bc, &alu);
                if (r)
                        return r;
-               src_not_temp = FALSE;
+               src_loaded = TRUE;
                src_gpr = ctx->temp_reg;
        }
 
        if (inst->Texture.Texture == TGSI_TEXTURE_CUBE) {
-               int src_chan, src2_chan;
+               static const unsigned src0_swizzle[] = {2, 2, 0, 1};
+               static const unsigned src1_swizzle[] = {1, 0, 2, 2};
 
                /* tmp1.xyzw = CUBE(R0.zzxy, R0.yxzz) */
                for (i = 0; i < 4; i++) {
                        memset(&alu, 0, sizeof(struct r600_bc_alu));
                        alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_CUBE);
-                       switch (i) {
-                       case 0:
-                               src_chan = 2;
-                               src2_chan = 1;
-                               break;
-                       case 1:
-                               src_chan = 2;
-                               src2_chan = 0;
-                               break;
-                       case 2:
-                               src_chan = 0;
-                               src2_chan = 2;
-                               break;
-                       case 3:
-                               src_chan = 1;
-                               src2_chan = 2;
-                               break;
-                       default:
-                               assert(0);
-                               src_chan = 0;
-                               src2_chan = 0;
-                               break;
-                       }
-                       r600_bc_src(&alu.src[0], &ctx->src[0], src_chan);
-                       r600_bc_src(&alu.src[1], &ctx->src[0], src2_chan);
+                       r600_bc_src(&alu.src[0], &ctx->src[0], src0_swizzle[i]);
+                       r600_bc_src(&alu.src[1], &ctx->src[0], src1_swizzle[i]);
                        alu.dst.sel = ctx->temp_reg;
                        alu.dst.chan = i;
                        if (i == 3)
@@ -1808,11 +1672,11 @@ static int tgsi_tex(struct r600_shader_ctx *ctx)
                if (r)
                        return r;
 
-               src_not_temp = FALSE;
+               src_loaded = TRUE;
                src_gpr = ctx->temp_reg;
        }
 
-       if (src_not_temp) {
+       if (src_requires_loading && !src_loaded) {
                for (i = 0; i < 4; i++) {
                        memset(&alu, 0, sizeof(struct r600_bc_alu));
                        alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
@@ -1826,6 +1690,7 @@ static int tgsi_tex(struct r600_shader_ctx *ctx)
                        if (r)
                                return r;
                }
+               src_loaded = TRUE;
                src_gpr = ctx->temp_reg;
        }
 
@@ -1844,10 +1709,18 @@ static int tgsi_tex(struct r600_shader_ctx *ctx)
        tex.dst_sel_y = (inst->Dst[0].Register.WriteMask & 2) ? 1 : 7;
        tex.dst_sel_z = (inst->Dst[0].Register.WriteMask & 4) ? 2 : 7;
        tex.dst_sel_w = (inst->Dst[0].Register.WriteMask & 8) ? 3 : 7;
-       tex.src_sel_x = 0;
-       tex.src_sel_y = 1;
-       tex.src_sel_z = 2;
-       tex.src_sel_w = 3;
+       if (src_loaded) {
+               tex.src_sel_x = 0;
+               tex.src_sel_y = 1;
+               tex.src_sel_z = 2;
+               tex.src_sel_w = 3;
+       } else {
+               tex.src_sel_x = ctx->src[0].swizzle[0];
+               tex.src_sel_y = ctx->src[0].swizzle[1];
+               tex.src_sel_z = ctx->src[0].swizzle[2];
+               tex.src_sel_w = ctx->src[0].swizzle[3];
+               tex.src_rel = ctx->src[0].rel;
+       }
 
        if (inst->Texture.Texture == TGSI_TEXTURE_CUBE) {
                tex.src_sel_x = 1;
@@ -1865,12 +1738,12 @@ static int tgsi_tex(struct r600_shader_ctx *ctx)
 
        if (inst->Texture.Texture == TGSI_TEXTURE_1D_ARRAY) {
                tex.coord_type_z = 0;
-               tex.src_sel_z = 1;
+               tex.src_sel_z = tex.src_sel_y;
        } else if (inst->Texture.Texture == TGSI_TEXTURE_2D_ARRAY)
                tex.coord_type_z = 0;
 
        if (inst->Texture.Texture == TGSI_TEXTURE_SHADOW1D || inst->Texture.Texture == TGSI_TEXTURE_SHADOW2D)
-               tex.src_sel_w = 2;
+               tex.src_sel_w = tex.src_sel_z;
 
        r = r600_bc_add_tex(ctx->bc, &tex);
        if (r)
@@ -2011,6 +1884,8 @@ static int tgsi_cmp(struct r600_shader_ctx *ctx)
 static int tgsi_xpd(struct r600_shader_ctx *ctx)
 {
        struct tgsi_full_instruction *inst = &ctx->parse.FullToken.FullInstruction;
+       static const unsigned int src0_swizzle[] = {2, 0, 1};
+       static const unsigned int src1_swizzle[] = {1, 2, 0};
        struct r600_bc_alu alu;
        uint32_t use_temp = 0;
        int i, r;
@@ -2021,33 +1896,12 @@ static int tgsi_xpd(struct r600_shader_ctx *ctx)
        for (i = 0; i < 4; i++) {
                memset(&alu, 0, sizeof(struct r600_bc_alu));
                alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL);
-
-               switch (i) {
-               case 0:
-                       r600_bc_src(&alu.src[0], &ctx->src[0], 2);
-                       break;
-               case 1:
-                       r600_bc_src(&alu.src[0], &ctx->src[0], 0);
-                       break;
-               case 2:
-                       r600_bc_src(&alu.src[0], &ctx->src[0], 1);
-                       break;
-               case 3:
+               if (i < 3) {
+                       r600_bc_src(&alu.src[0], &ctx->src[0], src0_swizzle[i]);
+                       r600_bc_src(&alu.src[1], &ctx->src[1], src1_swizzle[i]);
+               } else {
                        alu.src[0].sel = V_SQ_ALU_SRC_0;
                        alu.src[0].chan = i;
-               }
-
-               switch (i) {
-               case 0:
-                       r600_bc_src(&alu.src[1], &ctx->src[1], 1);
-                       break;
-               case 1:
-                       r600_bc_src(&alu.src[1], &ctx->src[1], 2);
-                       break;
-               case 2:
-                       r600_bc_src(&alu.src[1], &ctx->src[1], 0);
-                       break;
-               case 3:
                        alu.src[1].sel = V_SQ_ALU_SRC_0;
                        alu.src[1].chan = i;
                }
@@ -2067,32 +1921,12 @@ static int tgsi_xpd(struct r600_shader_ctx *ctx)
                memset(&alu, 0, sizeof(struct r600_bc_alu));
                alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_MULADD);
 
-               switch (i) {
-               case 0:
-                       r600_bc_src(&alu.src[0], &ctx->src[0], 1);
-                       break;
-               case 1:
-                       r600_bc_src(&alu.src[0], &ctx->src[0], 2);
-                       break;
-               case 2:
-                       r600_bc_src(&alu.src[0], &ctx->src[0], 0);
-                       break;
-               case 3:
+               if (i < 3) {
+                       r600_bc_src(&alu.src[0], &ctx->src[0], src1_swizzle[i]);
+                       r600_bc_src(&alu.src[1], &ctx->src[1], src0_swizzle[i]);
+               } else {
                        alu.src[0].sel = V_SQ_ALU_SRC_0;
                        alu.src[0].chan = i;
-               }
-
-               switch (i) {
-               case 0:
-                       r600_bc_src(&alu.src[1], &ctx->src[1], 2);
-                       break;
-               case 1:
-                       r600_bc_src(&alu.src[1], &ctx->src[1], 0);
-                       break;
-               case 2:
-                       r600_bc_src(&alu.src[1], &ctx->src[1], 1);
-                       break;
-               case 3:
                        alu.src[1].sel = V_SQ_ALU_SRC_0;
                        alu.src[1].chan = i;
                }
@@ -2161,9 +1995,11 @@ static int tgsi_exp(struct r600_shader_ctx *ctx)
                r600_bc_src(&alu.src[0], &ctx->src[0], 0);
 
                alu.dst.sel = ctx->temp_reg;
-//             r = tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
-//             if (r)
-//                     return r;
+#if 0
+               r = tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
+               if (r)
+                       return r;
+#endif
                alu.dst.write = 1;
                alu.dst.chan = 1;
 
@@ -2960,7 +2796,7 @@ static struct r600_shader_tgsi_instruction eg_shader_tgsi_instruction[] = {
        {TGSI_OPCODE_RCP,       0, EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_RECIP_IEEE, tgsi_trans_srcx_replicate},
        {TGSI_OPCODE_RSQ,       0, EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_RECIPSQRT_IEEE, tgsi_trans_srcx_replicate},
        {TGSI_OPCODE_EXP,       0, EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_exp},
-       {TGSI_OPCODE_LOG,       0, EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_unsupported},
+       {TGSI_OPCODE_LOG,       0, EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_log},
        {TGSI_OPCODE_MUL,       0, EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL, tgsi_op2},
        {TGSI_OPCODE_ADD,       0, EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_ADD, tgsi_op2},
        {TGSI_OPCODE_DP3,       0, EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_DOT4, tgsi_dp},