r600g: Use hardware sqrt instruction
authorGlenn Kennard <glenn.kennard@gmail.com>
Fri, 18 Jul 2014 07:54:37 +0000 (09:54 +0200)
committerTom Stellard <thomas.stellard@amd.com>
Wed, 23 Jul 2014 14:29:17 +0000 (10:29 -0400)
Piglit quick tests including sqrt pass, no other regressions,
tested on radeon 6670.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/r600/r600_shader.c

index 5bf9c00479bf2048ca9b970ed9fed102c853da6c..ee6a4160dd10463a534828e5e02ddf5edae609c8 100644 (file)
@@ -428,7 +428,7 @@ static int r600_get_shader_param(struct pipe_screen* pscreen, unsigned shader, e
        case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED:
                return 1;
        case PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED:
-               return 0;
+               return 1;
        case PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR:
        case PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR:
        case PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR:
index db928f3ae38755ce4b2b68e5bfa354a11a34e801..907547d66f40e5f76ab2ec879a407426c2c4368f 100644 (file)
@@ -6498,8 +6498,7 @@ static struct r600_shader_tgsi_instruction r600_shader_tgsi_instruction[] = {
        {TGSI_OPCODE_SUB,       0, ALU_OP2_ADD, tgsi_op2},
        {TGSI_OPCODE_LRP,       0, ALU_OP0_NOP, tgsi_lrp},
        {TGSI_OPCODE_CND,       0, ALU_OP0_NOP, tgsi_unsupported},
-       /* gap */
-       {20,                    0, ALU_OP0_NOP, tgsi_unsupported},
+       {TGSI_OPCODE_SQRT,      0, ALU_OP1_SQRT_IEEE, tgsi_trans_srcx_replicate},
        {TGSI_OPCODE_DP2A,      0, ALU_OP0_NOP, tgsi_unsupported},
        /* gap */
        {22,                    0, ALU_OP0_NOP, tgsi_unsupported},
@@ -6693,8 +6692,7 @@ static struct r600_shader_tgsi_instruction eg_shader_tgsi_instruction[] = {
        {TGSI_OPCODE_SUB,       0, ALU_OP2_ADD, tgsi_op2},
        {TGSI_OPCODE_LRP,       0, ALU_OP0_NOP, tgsi_lrp},
        {TGSI_OPCODE_CND,       0, ALU_OP0_NOP, tgsi_unsupported},
-       /* gap */
-       {20,                    0, ALU_OP0_NOP, tgsi_unsupported},
+       {TGSI_OPCODE_SQRT,      0, ALU_OP1_SQRT_IEEE, tgsi_trans_srcx_replicate},
        {TGSI_OPCODE_DP2A,      0, ALU_OP0_NOP, tgsi_unsupported},
        /* gap */
        {22,                    0, ALU_OP0_NOP, tgsi_unsupported},
@@ -6888,8 +6886,7 @@ static struct r600_shader_tgsi_instruction cm_shader_tgsi_instruction[] = {
        {TGSI_OPCODE_SUB,       0, ALU_OP2_ADD, tgsi_op2},
        {TGSI_OPCODE_LRP,       0, ALU_OP0_NOP, tgsi_lrp},
        {TGSI_OPCODE_CND,       0, ALU_OP0_NOP, tgsi_unsupported},
-       /* gap */
-       {20,                    0, ALU_OP0_NOP, tgsi_unsupported},
+       {TGSI_OPCODE_SQRT,      0, ALU_OP1_SQRT_IEEE, cayman_emit_float_instr},
        {TGSI_OPCODE_DP2A,      0, ALU_OP0_NOP, tgsi_unsupported},
        /* gap */
        {22,                    0, ALU_OP0_NOP, tgsi_unsupported},