summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2014-03-25 15:43:21 -0700
committerMatt Turner <mattst88@gmail.com>2014-06-17 09:40:07 -0700
commit4b7bca897984d7d0cbe2d51d4a5919dcc7702a41 (patch)
tree3ba2e9ac848eef1ec4dabe7f9fac31d9d7b071e2 /src/mesa/drivers/dri/i965/brw_fs_cse.cpp
parent68b7b034292b561cb95d81acb08a502f5a840085 (diff)
i965/fs: Emit load_payload instead of multiple MOVs for large VGRFs.
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs_cse.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_cse.cpp33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_cse.cpp b/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
index 920bfeed22..abaf688004 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
@@ -188,15 +188,20 @@ fs_visitor::opt_cse_local(bblock_t *block, exec_list *aeb)
entry->tmp = tmp;
entry->generator->dst = tmp;
- for (int i = 0; i < written; i++) {
- fs_inst *copy = MOV(orig_dst, tmp);
+ fs_inst *copy;
+ if (written > 1) {
+ fs_reg *sources = ralloc_array(mem_ctx, fs_reg, written);
+ for (int i = 0; i < written; i++) {
+ sources[i] = tmp;
+ sources[i].reg_offset = i;
+ }
+ copy = LOAD_PAYLOAD(orig_dst, sources, written);
+ } else {
+ copy = MOV(orig_dst, tmp);
copy->force_writemask_all =
entry->generator->force_writemask_all;
- entry->generator->insert_after(copy);
-
- orig_dst.reg_offset++;
- tmp.reg_offset++;
}
+ entry->generator->insert_after(copy);
}
/* dest <- temp */
@@ -206,15 +211,19 @@ fs_visitor::opt_cse_local(bblock_t *block, exec_list *aeb)
assert(inst->dst.type == entry->tmp.type);
fs_reg dst = inst->dst;
fs_reg tmp = entry->tmp;
- fs_inst *copy = NULL;
- for (int i = 0; i < written; i++) {
+ fs_inst *copy;
+ if (written > 1) {
+ fs_reg *sources = ralloc_array(mem_ctx, fs_reg, written);
+ for (int i = 0; i < written; i++) {
+ sources[i] = tmp;
+ sources[i].reg_offset = i;
+ }
+ copy = LOAD_PAYLOAD(dst, sources, written);
+ } else {
copy = MOV(dst, tmp);
copy->force_writemask_all = inst->force_writemask_all;
- inst->insert_before(copy);
-
- dst.reg_offset++;
- tmp.reg_offset++;
}
+ inst->insert_before(copy);
}
/* Set our iterator so that next time through the loop inst->next