From 3e165ba62cd607c1a3402b7db52789fc37b6876c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 5 Sep 2012 07:42:36 -0700 Subject: [PATCH] i965: Test instruction compaction on gen7 --- src/mesa/drivers/dri/i965/brw_eu_compact.c | 3 ++- src/mesa/drivers/dri/i965/test_eu_compact.c | 30 ++++++++++++++------- 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; } -- 2.30.2