r300: Prefer to use the VE_ADD for simple MOV style opcodes.
authorOliver McFadden <z3ro.geek@gmail.com>
Thu, 28 Feb 2008 09:39:09 +0000 (09:39 +0000)
committerOliver McFadden <z3ro.geek@gmail.com>
Sat, 1 Mar 2008 06:33:06 +0000 (06:33 +0000)
The VE_MULTIPLY_ADD has further restrictions on reading temporary memory which
may complicate things. See AMD's documentation.

src/mesa/drivers/dri/r300/r300_vertprog.c

index 1b76d4bae2df16a18804762a0c6c6b79a9a8e089..4c7cafe9bf38fb44fc4ae6034541605a2e0f35f5 100644 (file)
@@ -387,15 +387,6 @@ static GLuint *t_opcode_add(struct r300_vertex_program *vp,
                            struct prog_instruction *vpi, GLuint * inst,
                            struct prog_src_register src[3])
 {
-#if 1
-       inst[0] =
-           PVS_VECTOR_OPCODE(VE_MULTIPLY_ADD, t_dst_index(vp, &vpi->DstReg),
-                       t_dst_mask(vpi->DstReg.WriteMask),
-                       t_dst_class(vpi->DstReg.File));
-       inst[1] = ONE_SRC_0;
-       inst[2] = t_src(vp, &src[0]);
-       inst[3] = t_src(vp, &src[1]);
-#else
        inst[0] =
            PVS_VECTOR_OPCODE(VE_ADD, t_dst_index(vp, &vpi->DstReg),
                        t_dst_mask(vpi->DstReg.WriteMask),
@@ -403,7 +394,6 @@ static GLuint *t_opcode_add(struct r300_vertex_program *vp,
        inst[1] = t_src(vp, &src[0]);
        inst[2] = t_src(vp, &src[1]);
        inst[3] = ZERO_SRC_1;
-#endif
 
        return inst;
 }
@@ -738,7 +728,6 @@ static GLuint *t_opcode_mov(struct r300_vertex_program *vp,
 {
        //ADD RESULT 1.X Y Z W PARAM 0{} {X Y Z W} PARAM 0{} {ZERO ZERO ZERO ZERO}
 
-#if 1
        inst[0] =
            PVS_VECTOR_OPCODE(VE_ADD, t_dst_index(vp, &vpi->DstReg),
                        t_dst_mask(vpi->DstReg.WriteMask),
@@ -746,15 +735,6 @@ static GLuint *t_opcode_mov(struct r300_vertex_program *vp,
        inst[1] = t_src(vp, &src[0]);
        inst[2] = ZERO_SRC_0;
        inst[3] = ZERO_SRC_0;
-#else
-       inst[0] =
-           PVS_VECTOR_OPCODE(VE_MULTIPLY_ADD, t_dst_index(vp, &vpi->DstReg),
-                       t_dst_mask(vpi->DstReg.WriteMask),
-                       t_dst_class(vpi->DstReg.File));
-       inst[1] = t_src(vp, &src[0]);
-       inst[2] = ONE_SRC_0;
-       inst[3] = ZERO_SRC_0;
-#endif
 
        return inst;
 }
@@ -905,7 +885,6 @@ static GLuint *t_opcode_swz(struct r300_vertex_program *vp,
 {
        //ADD RESULT 1.X Y Z W PARAM 0{} {X Y Z W} PARAM 0{} {ZERO ZERO ZERO ZERO}
 
-#if 1
        inst[0] =
            PVS_VECTOR_OPCODE(VE_ADD, t_dst_index(vp, &vpi->DstReg),
                        t_dst_mask(vpi->DstReg.WriteMask),
@@ -913,15 +892,6 @@ static GLuint *t_opcode_swz(struct r300_vertex_program *vp,
        inst[1] = t_src(vp, &src[0]);
        inst[2] = ZERO_SRC_0;
        inst[3] = ZERO_SRC_0;
-#else
-       inst[0] =
-           PVS_VECTOR_OPCODE(VE_MULTIPLY_ADD, t_dst_index(vp, &vpi->DstReg),
-                       t_dst_mask(vpi->DstReg.WriteMask),
-                       t_dst_class(vpi->DstReg.File));
-       inst[1] = t_src(vp, &src[0]);
-       inst[2] = ONE_SRC_0;
-       inst[3] = ZERO_SRC_0;
-#endif
 
        return inst;
 }