aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2016-02-26 17:20:19 -0800
committerFrancisco Jerez <[email protected]>2016-03-06 12:22:40 -0800
commitdcf5e19e6564662ef3f7a4c7d42acc46a24e62c6 (patch)
tree94f94dfe9b6444ec4452f3af28064a5d4a0ebb9b /src
parentff7a2b489e6a8f3f63f71f36cd63d91cd81c326d (diff)
i965/vec4: Use swizzle() to swizzle immediates during constant propagation.
Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
index 6bd992882b8..5c2516473a5 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
@@ -76,22 +76,6 @@ is_channel_updated(vec4_instruction *inst, src_reg *values[4], int ch)
inst->dst.writemask & (1 << BRW_GET_SWZ(src->swizzle, ch)));
}
-static unsigned
-swizzle_vf_imm(unsigned vf4, unsigned swizzle)
-{
- union {
- unsigned vf4;
- uint8_t vf[4];
- } v = { vf4 }, ret;
-
- ret.vf[0] = v.vf[BRW_GET_SWZ(swizzle, 0)];
- ret.vf[1] = v.vf[BRW_GET_SWZ(swizzle, 1)];
- ret.vf[2] = v.vf[BRW_GET_SWZ(swizzle, 2)];
- ret.vf[3] = v.vf[BRW_GET_SWZ(swizzle, 3)];
-
- return ret.vf4;
-}
-
static bool
is_logic_op(enum opcode opcode)
{
@@ -144,8 +128,7 @@ try_constant_propagate(const struct brw_device_info *devinfo,
}
}
- if (value.type == BRW_REGISTER_TYPE_VF)
- value.ud = swizzle_vf_imm(value.ud, inst->src[arg].swizzle);
+ value = swizzle(value, inst->src[arg].swizzle);
switch (inst->opcode) {
case BRW_OPCODE_MOV: