diff options
-rw-r--r-- | orc-test/orctest.c | 4 | ||||
-rw-r--r-- | orc-test/orctest.h | 1 | ||||
-rw-r--r-- | tools/orcc.c | 7 |
3 files changed, 12 insertions, 0 deletions
diff --git a/orc-test/orctest.c b/orc-test/orctest.c index 673eb2b..547a8aa 100644 --- a/orc-test/orctest.c +++ b/orc-test/orctest.c @@ -955,6 +955,10 @@ orc_test_performance_full (OrcProgram *program, int flags, orc_profile_start (&prof); orc_executor_run_backup (ex); orc_profile_stop (&prof); + } else if (flags & ORC_TEST_FLAGS_EMULATE) { + orc_profile_start (&prof); + orc_executor_emulate (ex); + orc_profile_stop (&prof); } else { orc_profile_start (&prof); orc_executor_run (ex); diff --git a/orc-test/orctest.h b/orc-test/orctest.h index 55188de..53d15c9 100644 --- a/orc-test/orctest.h +++ b/orc-test/orctest.h @@ -15,6 +15,7 @@ typedef enum { #define ORC_TEST_FLAGS_BACKUP (1<<0) #define ORC_TEST_FLAGS_FLOAT (1<<1) +#define ORC_TEST_FLAGS_EMULATE (1<<2) void orc_test_init (void); OrcTestResult orc_test_gcc_compile (OrcProgram *p); diff --git a/tools/orcc.c b/tools/orcc.c index 97d769b..a8d087f 100644 --- a/tools/orcc.c +++ b/tools/orcc.c @@ -997,6 +997,13 @@ output_code_test (OrcProgram *p, FILE *output) } fprintf(output, "\n"); + if (compat >= ORC_VERSION(0,4,7,1)) { + fprintf(output, " if (benchmark) {\n"); + fprintf(output, " printf (\" cycles (emulate) : %%g\\n\",\n"); + fprintf(output, " orc_test_performance_full (p, ORC_TEST_FLAGS_EMULATE, NULL));\n"); + fprintf(output, " }\n"); + fprintf(output, "\n"); + } fprintf(output, " ret = orc_test_compare_output_backup (p);\n"); fprintf(output, " if (!ret) {\n"); fprintf(output, " error = TRUE;\n"); |