summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-09-05 07:42:36 -0700
committerEric Anholt <[email protected]>2012-09-17 12:32:52 -0700
commit3e165ba62cd607c1a3402b7db52789fc37b6876c (patch)
tree39c3b06e9222d748262f02bea3506900f3cbfe87 /src/mesa/drivers
parentbce72170ea2bf6b9bab09fd0febb71475dcb5609 (diff)
i965: Test instruction compaction on gen7
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu_compact.c3
-rw-r--r--src/mesa/drivers/dri/i965/test_eu_compact.c30
2 files changed, 23 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_eu_compact.c b/src/mesa/drivers/dri/i965/brw_eu_compact.c
index 881255e2304..90d1cdd8d9a 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_compact.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_compact.c
@@ -582,7 +582,8 @@ void brw_debug_compact_uncompact(struct intel_context *intel,
struct brw_instruction *orig,
struct brw_instruction *uncompacted)
{
- fprintf(stderr, "Instruction compact/uncompact changed:\n");
+ fprintf(stderr, "Instruction compact/uncompact changed (gen%d):\n",
+ intel->gen);
fprintf(stderr, " before: ");
brw_disasm(stderr, orig, intel->gen);
diff --git a/src/mesa/drivers/dri/i965/test_eu_compact.c b/src/mesa/drivers/dri/i965/test_eu_compact.c
index e9d43015ea3..73351c3e1bf 100644
--- a/src/mesa/drivers/dri/i965/test_eu_compact.c
+++ b/src/mesa/drivers/dri/i965/test_eu_compact.c
@@ -256,13 +256,10 @@ struct {
{ gen_f1_MOV_GRF_GRF },
};
-int
-main(int argc, char **argv)
+static bool
+run_tests(struct brw_context *brw)
{
- struct brw_context *brw = calloc(1, sizeof(*brw));
- struct intel_context *intel = &brw->intel;
- intel->gen = 6;
- int ret = 0;
+ bool fail = false;
for (int i = 0; i < ARRAY_SIZE(tests); i++) {
for (int align_16 = 0; align_16 <= 1; align_16++) {
@@ -279,12 +276,12 @@ main(int argc, char **argv)
assert(p->nr_insn == 1);
if (!test_compact_instruction(p, p->store[0])) {
- ret = 1;
+ fail = true;
continue;
}
if (!test_fuzz_compact_instruction(p, p->store[0])) {
- ret = 1;
+ fail = true;
continue;
}
@@ -292,5 +289,20 @@ main(int argc, char **argv)
}
}
- return ret;
+ return fail;
+}
+
+int
+main(int argc, char **argv)
+{
+ struct brw_context *brw = calloc(1, sizeof(*brw));
+ struct intel_context *intel = &brw->intel;
+ intel->gen = 6;
+ bool fail = false;
+
+ for (intel->gen = 6; intel->gen <= 7; intel->gen++) {
+ fail |= run_tests(brw);
+ }
+
+ return fail;
}