void r300_vs_src_dump(uint32_t src)
{
- debug_printf(" %s/%s/%s/%s\n",
+ debug_printf(" %s%s/%s%s/%s%s/%s%s\n",
+ src & (1 << 25) ? "-" : " ",
r300_vs_swiz_debug[(src >> 13) & 0x7],
+ src & (1 << 26) ? "-" : " ",
r300_vs_swiz_debug[(src >> 16) & 0x7],
+ src & (1 << 27) ? "-" : " ",
r300_vs_swiz_debug[(src >> 19) & 0x7],
+ src & (1 << 28) ? "-" : " ",
r300_vs_swiz_debug[(src >> 22) & 0x7]);
}
return R300_VE_MULTIPLY;
case TGSI_OPCODE_ADD:
case TGSI_OPCODE_MOV:
+ case TGSI_OPCODE_SUB:
case TGSI_OPCODE_SWZ:
return R300_VE_ADD;
case TGSI_OPCODE_MAX:
static uint32_t r300_vs_swiz(struct tgsi_full_src_register* reg)
{
if (reg->SrcRegister.Extended) {
- return reg->SrcRegisterExtSwz.ExtSwizzleX |
+ return (reg->SrcRegister.Negate ? R300_PVS_NEGATE_XYZW : 0) |
+ reg->SrcRegisterExtSwz.ExtSwizzleX |
(reg->SrcRegisterExtSwz.ExtSwizzleY << 3) |
(reg->SrcRegisterExtSwz.ExtSwizzleZ << 6) |
(reg->SrcRegisterExtSwz.ExtSwizzleW << 9);
} else {
- return reg->SrcRegister.SwizzleX |
+ return (reg->SrcRegister.Negate ? R300_PVS_NEGATE_XYZW : 0) |
+ reg->SrcRegister.SwizzleX |
(reg->SrcRegister.SwizzleY << 3) |
(reg->SrcRegister.SwizzleZ << 6) |
(reg->SrcRegister.SwizzleW << 9);
static uint32_t r300_vs_scalar_swiz(struct tgsi_full_src_register* reg)
{
if (reg->SrcRegister.Extended) {
- return reg->SrcRegisterExtSwz.ExtSwizzleX |
+ return (reg->SrcRegister.Negate ? R300_PVS_NEGATE_XYZW : 0) |
+ reg->SrcRegisterExtSwz.ExtSwizzleX |
(reg->SrcRegisterExtSwz.ExtSwizzleX << 3) |
(reg->SrcRegisterExtSwz.ExtSwizzleX << 6) |
(reg->SrcRegisterExtSwz.ExtSwizzleX << 9);
} else {
- return reg->SrcRegister.SwizzleX |
+ return (reg->SrcRegister.Negate ? R300_PVS_NEGATE_XYZW : 0) |
+ reg->SrcRegister.SwizzleX |
(reg->SrcRegister.SwizzleX << 3) |
(reg->SrcRegister.SwizzleX << 6) |
(reg->SrcRegister.SwizzleX << 9);
&inst->FullDstRegisters[0], inst->Instruction.Opcode,
1, TRUE);
break;
+ case TGSI_OPCODE_SUB:
+ inst->FullSrcRegisters[1].SrcRegister.Negate =
+ !inst->FullSrcRegisters[1].SrcRegister.Negate;
+ /* Fall through */
case TGSI_OPCODE_ADD:
case TGSI_OPCODE_MUL:
case TGSI_OPCODE_MAX:
((R300_PVS_SRC_SELECT_FORCE_1 | (R300_PVS_SRC_SELECT_FORCE_1 << 3) | \
(R300_PVS_SRC_SELECT_FORCE_1 << 6) | \
(R300_PVS_SRC_SELECT_FORCE_1 << 9)) << 13)
+#define R300_PVS_MODIFIER_X (1 << 25)
+#define R300_PVS_MODIFIER_Y (1 << 26)
+#define R300_PVS_MODIFIER_Z (1 << 27)
+#define R300_PVS_MODIFIER_W (1 << 28)
+#define R300_PVS_NEGATE_XYZW \
+ (R300_PVS_MODIFIER_X | R300_PVS_MODIFIER_Y | \
+ R300_PVS_MODIFIER_Z | R300_PVS_MODIFIER_W)
static const struct tgsi_full_src_register r300_constant_zero = {
.SrcRegister.Extended = TRUE,