gallium: Drop the unused CND opcode.

Nothing in the tree generates it.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
This commit is contained in:
Eric Anholt 2014-11-12 14:23:59 -08:00
parent 00f7002c5c
commit 365a4a3f9a
11 changed files with 5 additions and 82 deletions

View File

@ -1057,24 +1057,6 @@ ucmp_emit_cpu(
cond, emit_data->args[1], emit_data->args[2]);
}
/* TGSI_OPCODE_CND (CPU Only) */
static void
cnd_emit_cpu(
const struct lp_build_tgsi_action * action,
struct lp_build_tgsi_context * bld_base,
struct lp_build_emit_data * emit_data)
{
LLVMValueRef half, tmp;
half = lp_build_const_vec(bld_base->base.gallivm, bld_base->base.type, 0.5);
tmp = lp_build_cmp(&bld_base->base, PIPE_FUNC_GREATER,
emit_data->args[2], half);
emit_data->output[emit_data->chan] = lp_build_select(&bld_base->base,
tmp,
emit_data->args[0],
emit_data->args[1]);
}
/* TGSI_OPCODE_COS (CPU Only) */
static void
cos_emit_cpu(
@ -1821,7 +1803,6 @@ lp_set_default_actions_cpu(
bld_base->op_actions[TGSI_OPCODE_ARL].emit = arl_emit_cpu;
bld_base->op_actions[TGSI_OPCODE_ARR].emit = arr_emit_cpu;
bld_base->op_actions[TGSI_OPCODE_CEIL].emit = ceil_emit_cpu;
bld_base->op_actions[TGSI_OPCODE_CND].emit = cnd_emit_cpu;
bld_base->op_actions[TGSI_OPCODE_COS].emit = cos_emit_cpu;
bld_base->op_actions[TGSI_OPCODE_CMP].emit = cmp_emit_cpu;
bld_base->op_actions[TGSI_OPCODE_DIV].emit = div_emit_cpu;

View File

@ -620,15 +620,6 @@ lp_emit_instruction_aos(
dst0 = lp_build_add(&bld->bld_base.base, tmp0, src2);
break;
case TGSI_OPCODE_CND:
src0 = lp_build_emit_fetch(&bld->bld_base, inst, 0, LP_CHAN_ALL);
src1 = lp_build_emit_fetch(&bld->bld_base, inst, 1, LP_CHAN_ALL);
src2 = lp_build_emit_fetch(&bld->bld_base, inst, 2, LP_CHAN_ALL);
tmp1 = lp_build_const_vec(bld->bld_base.base.gallivm, bld->bld_base.base.type, 0.5);
tmp0 = lp_build_cmp(&bld->bld_base.base, PIPE_FUNC_GREATER, src2, tmp1);
dst0 = lp_build_select(&bld->bld_base.base, tmp0, src0, src1);
break;
case TGSI_OPCODE_DP2A:
return FALSE;

View File

@ -136,18 +136,6 @@ micro_cmp(union tgsi_exec_channel *dst,
dst->f[3] = src0->f[3] < 0.0f ? src1->f[3] : src2->f[3];
}
static void
micro_cnd(union tgsi_exec_channel *dst,
const union tgsi_exec_channel *src0,
const union tgsi_exec_channel *src1,
const union tgsi_exec_channel *src2)
{
dst->f[0] = src2->f[0] > 0.5f ? src0->f[0] : src1->f[0];
dst->f[1] = src2->f[1] > 0.5f ? src0->f[1] : src1->f[1];
dst->f[2] = src2->f[2] > 0.5f ? src0->f[2] : src1->f[2];
dst->f[3] = src2->f[3] > 0.5f ? src0->f[3] : src1->f[3];
}
static void
micro_cos(union tgsi_exec_channel *dst,
const union tgsi_exec_channel *src)
@ -3603,10 +3591,6 @@ exec_instruction(
exec_vector_trinary(mach, inst, micro_lrp, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT);
break;
case TGSI_OPCODE_CND:
exec_vector_trinary(mach, inst, micro_cnd, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT);
break;
case TGSI_OPCODE_SQRT:
exec_scalar_unary(mach, inst, micro_sqrt, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT);
break;

View File

@ -56,7 +56,7 @@ static const struct tgsi_opcode_info opcode_info[TGSI_OPCODE_LAST] =
{ 1, 3, 0, 0, 0, 0, COMP, "MAD", TGSI_OPCODE_MAD },
{ 1, 2, 0, 0, 0, 0, COMP, "SUB", TGSI_OPCODE_SUB },
{ 1, 3, 0, 0, 0, 0, COMP, "LRP", TGSI_OPCODE_LRP },
{ 1, 3, 0, 0, 0, 0, COMP, "CND", TGSI_OPCODE_CND },
{ 0, 0, 0, 0, 0, 0, NONE, "", 19 }, /* removed */
{ 1, 1, 0, 0, 0, 0, REPL, "SQRT", TGSI_OPCODE_SQRT },
{ 1, 3, 0, 0, 0, 0, REPL, "DP2A", TGSI_OPCODE_DP2A },
{ 0, 0, 0, 0, 0, 0, NONE, "", 22 }, /* removed */

View File

@ -75,7 +75,6 @@ OP12(SGE)
OP13(MAD)
OP12(SUB)
OP13(LRP)
OP13(CND)
OP11(SQRT)
OP13(DP2A)
OP11(FRC)

View File

@ -193,7 +193,6 @@ tgsi_util_get_inst_usage_mask(const struct tgsi_full_instruction *inst,
case TGSI_OPCODE_MAD:
case TGSI_OPCODE_SUB:
case TGSI_OPCODE_LRP:
case TGSI_OPCODE_CND:
case TGSI_OPCODE_FRC:
case TGSI_OPCODE_CEIL:
case TGSI_OPCODE_CLAMP:

View File

@ -272,19 +272,6 @@ This instruction replicates its result.
dst.w = src0.w \times src1.w + (1 - src0.w) \times src2.w
.. opcode:: CND - Condition
.. math::
dst.x = (src2.x > 0.5) ? src0.x : src1.x
dst.y = (src2.y > 0.5) ? src0.y : src1.y
dst.z = (src2.z > 0.5) ? src0.z : src1.z
dst.w = (src2.w > 0.5) ? src0.w : src1.w
.. opcode:: DP2A - 2-component Dot Product And Add
.. math::

View File

@ -568,21 +568,6 @@ aos_LRP(struct toy_compiler *tc,
tc_MAC(tc, dst[0], src[0], src[1], tsrc_from(tmp));
}
static void
aos_CND(struct toy_compiler *tc,
const struct tgsi_full_instruction *tgsi_inst,
struct toy_dst *dst,
struct toy_src *src)
{
struct toy_inst *inst;
assert(!"CND untested");
tc_CMP(tc, tdst_null(), src[2], tsrc_imm_f(0.5f), GEN6_COND_G);
inst = tc_SEL(tc, dst[0], src[0], src[1], GEN6_COND_NONE);
inst->pred_ctrl = GEN6_PREDCTRL_NORMAL;
}
static void
aos_DP2A(struct toy_compiler *tc,
const struct tgsi_full_instruction *tgsi_inst,
@ -795,7 +780,6 @@ static const toy_tgsi_translate aos_translate_table[TGSI_OPCODE_LAST] = {
[TGSI_OPCODE_MAD] = aos_simple,
[TGSI_OPCODE_SUB] = aos_simple,
[TGSI_OPCODE_LRP] = aos_LRP,
[TGSI_OPCODE_CND] = aos_CND,
[TGSI_OPCODE_SQRT] = aos_simple,
[TGSI_OPCODE_DP2A] = aos_DP2A,
[TGSI_OPCODE_FRC] = aos_simple,
@ -1339,7 +1323,6 @@ static const toy_tgsi_translate soa_translate_table[TGSI_OPCODE_LAST] = {
[TGSI_OPCODE_MAD] = soa_per_channel,
[TGSI_OPCODE_SUB] = soa_per_channel,
[TGSI_OPCODE_LRP] = soa_per_channel,
[TGSI_OPCODE_CND] = soa_per_channel,
[TGSI_OPCODE_SQRT] = soa_scalar_replicate,
[TGSI_OPCODE_DP2A] = soa_dot_product,
[TGSI_OPCODE_FRC] = soa_per_channel,

View File

@ -51,7 +51,6 @@ static unsigned translate_opcode(unsigned opcode)
case TGSI_OPCODE_MAD: return RC_OPCODE_MAD;
case TGSI_OPCODE_SUB: return RC_OPCODE_SUB;
case TGSI_OPCODE_LRP: return RC_OPCODE_LRP;
case TGSI_OPCODE_CND: return RC_OPCODE_CND;
/* case TGSI_OPCODE_DP2A: return RC_OPCODE_DP2A; */
case TGSI_OPCODE_FRC: return RC_OPCODE_FRC;
case TGSI_OPCODE_CLAMP: return RC_OPCODE_CLAMP;

View File

@ -7207,7 +7207,7 @@ static struct r600_shader_tgsi_instruction r600_shader_tgsi_instruction[] = {
{TGSI_OPCODE_MAD, 1, ALU_OP3_MULADD, tgsi_op3},
{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},
{19, 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},
{22, 0, ALU_OP0_NOP, tgsi_unsupported},
@ -7406,7 +7406,7 @@ static struct r600_shader_tgsi_instruction eg_shader_tgsi_instruction[] = {
{TGSI_OPCODE_MAD, 1, ALU_OP3_MULADD, tgsi_op3},
{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},
{19, 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},
{22, 0, ALU_OP0_NOP, tgsi_unsupported},
@ -7605,7 +7605,7 @@ static struct r600_shader_tgsi_instruction cm_shader_tgsi_instruction[] = {
{TGSI_OPCODE_MAD, 1, ALU_OP3_MULADD, tgsi_op3},
{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},
{19, 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},
{22, 0, ALU_OP0_NOP, tgsi_unsupported},

View File

@ -303,7 +303,7 @@ struct tgsi_property_data {
#define TGSI_OPCODE_MAD 16
#define TGSI_OPCODE_SUB 17
#define TGSI_OPCODE_LRP 18
#define TGSI_OPCODE_CND 19
/* gap */
#define TGSI_OPCODE_SQRT 20
#define TGSI_OPCODE_DP2A 21
/* gap */