summaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorLaura Ekstrand <laura.d.ekstrand@intel.com>2015-08-12 01:54:19 -0400
committerYang Rong <rong.r.yang@intel.com>2015-08-13 15:51:19 +0800
commit0410d0ba66b70db373eb32d0bd695e3da0764459 (patch)
tree31c21e7c3494f13c92a668465de5dd5fb34e3630 /backend
parent787502830469c674bc924e8411a273cca97eae36 (diff)
backend: Add ASM file name to GenContext object.
Part of the plumbing that passes the ASM file name from the compiler options level down to the emitCode level so that the assembly can be written to that file. Signed-off-by: Manasi Navare <manasi.d.navare@intel.com> Signed-off-by: Laura Ekstrand <laura.d.ekstrand@intel.com> Reviewed-by: Song, Ruiling <ruiling.song@intel.com>
Diffstat (limited to 'backend')
-rw-r--r--backend/src/backend/gen_context.cpp5
-rw-r--r--backend/src/backend/gen_context.hpp3
-rw-r--r--backend/src/backend/gen_program.cpp1
3 files changed, 9 insertions, 0 deletions
diff --git a/backend/src/backend/gen_context.cpp b/backend/src/backend/gen_context.cpp
index 06601d62..261e25df 100644
--- a/backend/src/backend/gen_context.cpp
+++ b/backend/src/backend/gen_context.cpp
@@ -49,6 +49,7 @@ namespace gbe
this->p = NULL;
this->sel = NULL;
this->ra = NULL;
+ this->asmFileName = NULL;
this->ifEndifFix = false;
this->regSpillTick = 0;
}
@@ -76,6 +77,10 @@ namespace gbe
this->regSpillTick = 0;
}
+ void GenContext::setASMFileName(const char* asmFname) {
+ this->asmFileName = asmFname;
+ }
+
void GenContext::newSelection(void) {
this->sel = GBE_NEW(Selection, *this);
}
diff --git a/backend/src/backend/gen_context.hpp b/backend/src/backend/gen_context.hpp
index e9c6366e..8ef725f6 100644
--- a/backend/src/backend/gen_context.hpp
+++ b/backend/src/backend/gen_context.hpp
@@ -69,6 +69,8 @@ namespace gbe
#define GEN7_SCRATCH_SIZE (12 * KB)
/*! Start new code generation with specific parameters */
void startNewCG(uint32_t simdWidth, uint32_t reservedSpillRegs, bool limitRegisterPressure);
+ /*! Set the file name for the ASM dump */
+ void setASMFileName(const char* asmFname);
/*! Target device ID*/
uint32_t deviceID;
/*! Implements base class */
@@ -218,6 +220,7 @@ namespace gbe
CompileErrorCode errCode;
bool ifEndifFix;
uint32_t regSpillTick;
+ const char* asmFileName;
/*! Build the curbe patch list for the given kernel */
void buildPatchList(void);
/* Helper for printing the assembly */
diff --git a/backend/src/backend/gen_program.cpp b/backend/src/backend/gen_program.cpp
index 9546ab3d..3c4983ed 100644
--- a/backend/src/backend/gen_program.cpp
+++ b/backend/src/backend/gen_program.cpp
@@ -172,6 +172,7 @@ namespace gbe {
ctx = GBE_NEW(Gen9Context, unit, name, deviceID, relaxMath);
}
GBE_ASSERTM(ctx != NULL, "Fail to create the gen context\n");
+ ctx->setASMFileName(this->asm_file_name);
for (; codeGen < codeGenNum; ++codeGen) {
const uint32_t simdWidth = codeGenStrategy[codeGen].simdWidth;