r600g: translate ARR instruction for evergreen
authorAlex Deucher <alexdeucher@gmail.com>
Fri, 19 Nov 2010 20:19:39 +0000 (15:19 -0500)
committerAlex Deucher <alexdeucher@gmail.com>
Fri, 19 Nov 2010 20:20:59 +0000 (15:20 -0500)
evergreen variant of:
9f7ec103e26c67cb077fd7d94d2fb68562b86c40

src/gallium/drivers/r600/r600_shader.c

index a6e8345c25be698d9bd1bf37db04cbc155352983..2e4056d77ac57cd3fc3ade6a9670f687f76812e6 100644 (file)
@@ -2658,16 +2658,25 @@ static int tgsi_log(struct r600_shader_ctx *ctx)
        return tgsi_helper_copy(ctx, inst);
 }
 
-/* r6/7 only for now */
 static int tgsi_eg_arl(struct r600_shader_ctx *ctx)
 {
        struct tgsi_full_instruction *inst = &ctx->parse.FullToken.FullInstruction;
        struct r600_bc_alu alu;
        int r;
-
        memset(&alu, 0, sizeof(struct r600_bc_alu));
 
-       alu.inst = EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FLT_TO_INT_FLOOR;
+       switch (inst->Instruction.Opcode) {
+       case TGSI_OPCODE_ARL:
+               alu.inst = EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FLT_TO_INT_FLOOR;
+               break;
+       case TGSI_OPCODE_ARR:
+               alu.inst = EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FLT_TO_INT;
+               break;
+       default:
+               assert(0);
+               return -1;
+       }
+
        r = tgsi_src(ctx, &inst->Src[0], &alu.src[0]);
        if (r)
                return r;
@@ -3276,7 +3285,7 @@ static struct r600_shader_tgsi_instruction eg_shader_tgsi_instruction[] = {
        {TGSI_OPCODE_UP4UB,     0, EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_unsupported},
        {TGSI_OPCODE_X2D,       0, EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_unsupported},
        {TGSI_OPCODE_ARA,       0, EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_unsupported},
-       {TGSI_OPCODE_ARR,       0, EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_unsupported},
+       {TGSI_OPCODE_ARR,       0, EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_eg_arl},
        {TGSI_OPCODE_BRA,       0, EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_unsupported},
        {TGSI_OPCODE_CAL,       0, EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_unsupported},
        {TGSI_OPCODE_RET,       0, EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_unsupported},