summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/r300_vertprog.c
diff options
context:
space:
mode:
authorOliver McFadden <z3ro.geek@gmail.com>2008-02-25 12:35:55 +0000
committerOliver McFadden <z3ro.geek@gmail.com>2008-03-01 06:33:06 +0000
commitbd46a482c479e7ce765e45f444ba0f7e54432a4e (patch)
tree14c01eca17cc85bd6872f41df942de8759e8f8d8 /src/mesa/drivers/dri/r300/r300_vertprog.c
parent66952fa5aec04aa2abeefa0e949ce3812fae229d (diff)
r300: Converted to the new Vector Engine defines.
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_vertprog.c')
-rw-r--r--src/mesa/drivers/dri/r300/r300_vertprog.c59
1 files changed, 30 insertions, 29 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c
index 7e724514b0..ec2299f4c8 100644
--- a/src/mesa/drivers/dri/r300/r300_vertprog.c
+++ b/src/mesa/drivers/dri/r300/r300_vertprog.c
@@ -376,7 +376,7 @@ static GLuint *t_opcode_abs(struct r300_vertex_program *vp,
//MAX RESULT 1.X Y Z W PARAM 0{} {X Y Z W} PARAM 0{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_MAX, t_dst_index(vp, &vpi->DstReg),
+ MAKE_VSF_OP(VE_MAXIMUM, t_dst_index(vp, &vpi->DstReg),
t_dst_mask(vpi->DstReg.WriteMask),
t_dst_class(vpi->DstReg.File));
@@ -406,7 +406,7 @@ static GLuint *t_opcode_add(struct r300_vertex_program *vp,
hw_op = (src[0].File == PROGRAM_TEMPORARY
&& src[1].File ==
PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 :
- R300_VPI_OUT_OP_MAD;
+ VE_MULTIPLY_ADD;
inst[0] =
MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
@@ -417,7 +417,7 @@ static GLuint *t_opcode_add(struct r300_vertex_program *vp,
inst[3] = t_src(vp, &src[1]);
#else
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg),
+ MAKE_VSF_OP(VE_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]);
@@ -434,7 +434,7 @@ static GLuint *t_opcode_arl(struct r300_vertex_program *vp,
struct prog_src_register src[3])
{
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_ARL, t_dst_index(vp, &vpi->DstReg),
+ MAKE_VSF_OP(VE_FLT2FIX_DX, t_dst_index(vp, &vpi->DstReg),
t_dst_mask(vpi->DstReg.WriteMask),
t_dst_class(vpi->DstReg.File));
@@ -452,7 +452,7 @@ static GLuint *t_opcode_dp3(struct r300_vertex_program *vp,
//DOT RESULT 1.X Y Z W PARAM 0{} {X Y Z ZERO} PARAM 0{} {X Y Z ZERO}
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_DOT, t_dst_index(vp, &vpi->DstReg),
+ MAKE_VSF_OP(VE_DOT_PRODUCT, t_dst_index(vp, &vpi->DstReg),
t_dst_mask(vpi->DstReg.WriteMask),
t_dst_class(vpi->DstReg.File));
@@ -486,7 +486,7 @@ static GLuint *t_opcode_dp4(struct r300_vertex_program *vp,
struct prog_src_register src[3])
{
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_DOT, t_dst_index(vp, &vpi->DstReg),
+ MAKE_VSF_OP(VE_DOT_PRODUCT, t_dst_index(vp, &vpi->DstReg),
t_dst_mask(vpi->DstReg.WriteMask),
t_dst_class(vpi->DstReg.File));
@@ -503,7 +503,7 @@ static GLuint *t_opcode_dph(struct r300_vertex_program *vp,
{
//DOT RESULT 1.X Y Z W PARAM 0{} {X Y Z ONE} PARAM 0{} {X Y Z W}
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_DOT, t_dst_index(vp, &vpi->DstReg),
+ MAKE_VSF_OP(VE_DOT_PRODUCT, t_dst_index(vp, &vpi->DstReg),
t_dst_mask(vpi->DstReg.WriteMask),
t_dst_class(vpi->DstReg.File));
@@ -527,7 +527,7 @@ static GLuint *t_opcode_dst(struct r300_vertex_program *vp,
struct prog_src_register src[3])
{
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_DST, t_dst_index(vp, &vpi->DstReg),
+ MAKE_VSF_OP(VE_DISTANCE_VECTOR, t_dst_index(vp, &vpi->DstReg),
t_dst_mask(vpi->DstReg.WriteMask),
t_dst_class(vpi->DstReg.File));
@@ -578,7 +578,7 @@ static GLuint *t_opcode_flr(struct r300_vertex_program *vp,
ADD RESULT 1.X Y Z W PARAM 0{} {X Y Z W} TMP 0{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W */
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_FRC, *u_temp_i,
+ MAKE_VSF_OP(VE_FRACTION, *u_temp_i,
t_dst_mask(vpi->DstReg.WriteMask),
PVS_DST_REG_TEMPORARY);
@@ -588,7 +588,7 @@ static GLuint *t_opcode_flr(struct r300_vertex_program *vp,
inst += 4;
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg),
+ MAKE_VSF_OP(VE_ADD, t_dst_index(vp, &vpi->DstReg),
t_dst_mask(vpi->DstReg.WriteMask),
t_dst_class(vpi->DstReg.File));
@@ -613,7 +613,7 @@ static GLuint *t_opcode_frc(struct r300_vertex_program *vp,
struct prog_src_register src[3])
{
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_FRC, t_dst_index(vp, &vpi->DstReg),
+ MAKE_VSF_OP(VE_FRACTION, t_dst_index(vp, &vpi->DstReg),
t_dst_mask(vpi->DstReg.WriteMask),
t_dst_class(vpi->DstReg.File));
@@ -716,7 +716,7 @@ static GLuint *t_opcode_mad(struct r300_vertex_program *vp,
&& src[1].File == PROGRAM_TEMPORARY
&& src[2].File ==
PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 :
- R300_VPI_OUT_OP_MAD;
+ VE_MULTIPLY_ADD;
inst[0] =
MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
@@ -734,7 +734,7 @@ static GLuint *t_opcode_max(struct r300_vertex_program *vp,
struct prog_src_register src[3])
{
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_MAX, t_dst_index(vp, &vpi->DstReg),
+ MAKE_VSF_OP(VE_MAXIMUM, t_dst_index(vp, &vpi->DstReg),
t_dst_mask(vpi->DstReg.WriteMask),
t_dst_class(vpi->DstReg.File));
@@ -750,7 +750,7 @@ static GLuint *t_opcode_min(struct r300_vertex_program *vp,
struct prog_src_register src[3])
{
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_MIN, t_dst_index(vp, &vpi->DstReg),
+ MAKE_VSF_OP(VE_MINIMUM, t_dst_index(vp, &vpi->DstReg),
t_dst_mask(vpi->DstReg.WriteMask),
t_dst_class(vpi->DstReg.File));
@@ -769,7 +769,7 @@ static GLuint *t_opcode_mov(struct r300_vertex_program *vp,
#if 1
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg),
+ MAKE_VSF_OP(VE_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]);
@@ -779,7 +779,7 @@ static GLuint *t_opcode_mov(struct r300_vertex_program *vp,
hw_op =
(src[0].File ==
PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 :
- R300_VPI_OUT_OP_MAD;
+ VE_MULTIPLY_ADD;
inst[0] =
MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
@@ -804,7 +804,7 @@ static GLuint *t_opcode_mul(struct r300_vertex_program *vp,
hw_op = (src[0].File == PROGRAM_TEMPORARY
&& src[1].File ==
PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 :
- R300_VPI_OUT_OP_MAD;
+ VE_MULTIPLY_ADD;
inst[0] =
MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
@@ -870,7 +870,7 @@ static GLuint *t_opcode_sge(struct r300_vertex_program *vp,
struct prog_src_register src[3])
{
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_SGE, t_dst_index(vp, &vpi->DstReg),
+ MAKE_VSF_OP(VE_SET_GREATER_THAN_EQUAL, t_dst_index(vp, &vpi->DstReg),
t_dst_mask(vpi->DstReg.WriteMask),
t_dst_class(vpi->DstReg.File));
@@ -886,7 +886,7 @@ static GLuint *t_opcode_slt(struct r300_vertex_program *vp,
struct prog_src_register src[3])
{
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_SLT, t_dst_index(vp, &vpi->DstReg),
+ MAKE_VSF_OP(VE_SET_LESS_THAN, t_dst_index(vp, &vpi->DstReg),
t_dst_mask(vpi->DstReg.WriteMask),
t_dst_class(vpi->DstReg.File));
@@ -909,7 +909,7 @@ static GLuint *t_opcode_sub(struct r300_vertex_program *vp,
hw_op = (src[0].File == PROGRAM_TEMPORARY
&& src[1].File ==
PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 :
- R300_VPI_OUT_OP_MAD;
+ VE_MULTIPLY_ADD;
inst[0] =
MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
@@ -929,7 +929,7 @@ static GLuint *t_opcode_sub(struct r300_vertex_program *vp,
(src[1].RelAddr << 4);
#else
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg),
+ MAKE_VSF_OP(VE_ADD, t_dst_index(vp, &vpi->DstReg),
t_dst_mask(vpi->DstReg.WriteMask),
t_dst_class(vpi->DstReg.File));
@@ -958,7 +958,7 @@ static GLuint *t_opcode_swz(struct r300_vertex_program *vp,
#if 1
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg),
+ MAKE_VSF_OP(VE_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]);
@@ -968,7 +968,7 @@ static GLuint *t_opcode_swz(struct r300_vertex_program *vp,
hw_op =
(src[0].File ==
PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 :
- R300_VPI_OUT_OP_MAD;
+ VE_MULTIPLY_ADD;
inst[0] =
MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg),
@@ -992,7 +992,7 @@ static GLuint *t_opcode_xpd(struct r300_vertex_program *vp,
*/
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_MAD, *u_temp_i,
+ MAKE_VSF_OP(VE_MULTIPLY_ADD, *u_temp_i,
t_dst_mask(vpi->DstReg.WriteMask),
PVS_DST_REG_TEMPORARY);
@@ -1019,7 +1019,7 @@ static GLuint *t_opcode_xpd(struct r300_vertex_program *vp,
(*u_temp_i)--;
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_MAD, t_dst_index(vp, &vpi->DstReg),
+ MAKE_VSF_OP(VE_MULTIPLY_ADD, t_dst_index(vp, &vpi->DstReg),
t_dst_mask(vpi->DstReg.WriteMask),
t_dst_class(vpi->DstReg.File));
@@ -1147,7 +1147,7 @@ static void r300TranslateVertexShader(struct r300_vertex_program *vp,
if (CMP_SRCS(src[1], src[2])
|| CMP_SRCS(src[0], src[2])) {
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_ADD,
+ MAKE_VSF_OP(VE_ADD,
u_temp_i, VSF_FLAG_ALL,
PVS_DST_REG_TEMPORARY);
@@ -1175,7 +1175,7 @@ static void r300TranslateVertexShader(struct r300_vertex_program *vp,
if (num_operands >= 2) {
if (CMP_SRCS(src[1], src[0])) {
inst[0] =
- MAKE_VSF_OP(R300_VPI_OUT_OP_ADD,
+ MAKE_VSF_OP(VE_ADD,
u_temp_i, VSF_FLAG_ALL,
PVS_DST_REG_TEMPORARY);
@@ -1296,8 +1296,9 @@ static void r300TranslateVertexShader(struct r300_vertex_program *vp,
of the fragment program. Blank the outputs here. */
for (i = 0; i < VERT_RESULT_MAX; i++) {
if (vp->key.OutputsAdded & (1 << i)) {
- inst[0] = MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, vp->outputs[i],
- VSF_FLAG_ALL, VSF_OUT_CLASS_RESULT);
+ inst[0] = MAKE_VSF_OP(VE_ADD, vp->outputs[i],
+ VSF_FLAG_ALL,
+ VSF_OUT_CLASS_RESULT);
inst[1] = ZERO_SRC_0;
inst[2] = ZERO_SRC_0;
inst[3] = ZERO_SRC_0;