On 19/11/14 19:45, Ilia Mirkin wrote:
On Wed, Nov 19, 2014 at 2:32 PM, Eric Anholt <e...@anholt.net> wrote:
Eric Anholt <e...@anholt.net> writes:
This series removes a bunch of unused opcodes, mostly from TGSI. It
doesn't go as far as we could possibly go -- while I welcome discussion
for future patch series deleting more, I hope that discussion doesn't
derail the review process for these changes.
I haven't messed with the subroutine stuff, since I don't know what people
are planning with that. I also haven't messed with the pack/unpack
opcodes in TGSI, since they might be useful for some of the GLSL packing
stuff.
Testing status: compile-tested ilo/r600/softpipe, touch-tested softpipe.
Lots of "looks good", no Reviewed-by (other than Ian on the Mesa side).
I'm probably going to push soon anyway if somebody doesn't actually give
Reviewed-by or NAK.
st/nine got merged. It uses ARR. And at the very least references
TGSI_OPCODE_NRM even if it doesn't use it. It also has code that uses
CND and DP2A although it's presently disabled via #define's.
The patch attached should do it.
I'm pretty sure that your series will cause st/nine to fail compiling.
BTW, given it's not trivial to compile nine state-tracker, I think it
might be better to not obfuscate which opcodes or symbols it uses with
macros. It pays off to be upfront with these things, so that `git grep
foo` finds everything that should be found.
Jose
diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c
index cc027b4..4c4d38e 100644
--- a/src/gallium/state_trackers/nine/nine_shader.c
+++ b/src/gallium/state_trackers/nine/nine_shader.c
@@ -38,7 +38,6 @@
#if 1
#define NINE_TGSI_LAZY_DEVS /* don't use TGSI_OPCODE_BREAKC */
#endif
-#define NINE_TGSI_LAZY_R600 /* don't use TGSI_OPCODE_DP2A */
#define DUMP(args...) _nine_debug_printf(DBG_CHANNEL, NULL, args)
@@ -1374,7 +1373,6 @@ DECL_SPECIAL(CND)
}
cnd = tx_src_param(tx, &tx->insn.src[0]);
-#ifdef NINE_TGSI_LAZY_R600
cgt = tx_scratch(tx);
if (tx->version.major == 1 && tx->version.minor < 4) {
@@ -1387,13 +1385,6 @@ DECL_SPECIAL(CND)
ureg_CMP(tx->ureg, dst,
tx_src_param(tx, &tx->insn.src[1]),
tx_src_param(tx, &tx->insn.src[2]), ureg_negate(cnd));
-#else
- if (tx->version.major == 1 && tx->version.minor < 4)
- cnd = ureg_scalar(cnd, TGSI_SWIZZLE_W);
- ureg_CND(tx->ureg, dst,
- tx_src_param(tx, &tx->insn.src[1]),
- tx_src_param(tx, &tx->insn.src[2]), cnd);
-#endif
return D3D_OK;
}
@@ -1980,7 +1971,6 @@ DECL_SPECIAL(NRM)
DECL_SPECIAL(DP2ADD)
{
-#ifdef NINE_TGSI_LAZY_R600
struct ureg_dst tmp = tx_scratch_scalar(tx);
struct ureg_src dp2 = tx_src_scalar(tmp);
struct ureg_dst dst = tx_dst_param(tx, &tx->insn.dst[0]);
@@ -1994,9 +1984,6 @@ DECL_SPECIAL(DP2ADD)
ureg_ADD(tx->ureg, dst, src[2], dp2);
return D3D_OK;
-#else
- return NineTranslateInstruction_Generic(tx);
-#endif
}
DECL_SPECIAL(TEXCOORD)
@@ -2316,7 +2303,7 @@ struct sm1_op_info inst_table[] =
_OPI(CRS, XPD, V(0,0), V(3,0), V(0,0), V(3,0), 1, 2, NULL), /* XXX: .w */
_OPI(SGN, SSG, V(2,0), V(3,0), V(0,0), V(0,0), 1, 3, SPECIAL(SGN)), /* ignore src1,2 */
_OPI(ABS, ABS, V(0,0), V(3,0), V(0,0), V(3,0), 1, 1, NULL),
- _OPI(NRM, NRM, V(0,0), V(3,0), V(0,0), V(3,0), 1, 1, SPECIAL(NRM)), /* NRM doesn't fit */
+ _OPI(NRM, NOP, V(0,0), V(3,0), V(0,0), V(3,0), 1, 1, SPECIAL(NRM)), /* NRM doesn't fit */
_OPI(SINCOS, SCS, V(2,0), V(2,1), V(2,0), V(2,1), 1, 3, SPECIAL(SINCOS)),
_OPI(SINCOS, SCS, V(3,0), V(3,0), V(3,0), V(3,0), 1, 1, SPECIAL(SINCOS)),
@@ -2371,7 +2358,7 @@ struct sm1_op_info inst_table[] =
/* Misc */
_OPI(CMP, CMP, V(0,0), V(0,0), V(1,2), V(3,0), 1, 3, SPECIAL(CMP)), /* reversed */
_OPI(BEM, NOP, V(0,0), V(0,0), V(1,4), V(1,4), 0, 0, SPECIAL(BEM)),
- _OPI(DP2ADD, DP2A, V(0,0), V(0,0), V(2,0), V(3,0), 1, 3, SPECIAL(DP2ADD)), /* for radeons */
+ _OPI(DP2ADD, NOP, V(0,0), V(0,0), V(2,0), V(3,0), 1, 3, SPECIAL(DP2ADD)), /* for radeons */
_OPI(DSX, DDX, V(0,0), V(0,0), V(2,1), V(3,0), 1, 1, NULL),
_OPI(DSY, DDY, V(0,0), V(0,0), V(2,1), V(3,0), 1, 1, NULL),
_OPI(TEXLDD, TXD, V(0,0), V(0,0), V(2,1), V(3,0), 1, 4, SPECIAL(TEXLDD)),
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev