summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew M. B. Boktor <[email protected]>2012-05-17 14:30:03 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:47:31 -0700
commitecb34ef80da3880fcfb3e1d66b40bab1cde5e0cc (patch)
treecca03e823709251346d583ce588564d9d3d60127
parent777bcb88020996e3a4c180040817cfb49748cde6 (diff)
Removing a variable that's never used
Fixing shift/reduce conflicts [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 12630]
-rw-r--r--cuobjdump_to_ptxplus/Makefile2
-rw-r--r--cuobjdump_to_ptxplus/cuobjdumpInstList.cc2
-rw-r--r--cuobjdump_to_ptxplus/sass.y58
3 files changed, 26 insertions, 36 deletions
diff --git a/cuobjdump_to_ptxplus/Makefile b/cuobjdump_to_ptxplus/Makefile
index fc43027..2bdca27 100644
--- a/cuobjdump_to_ptxplus/Makefile
+++ b/cuobjdump_to_ptxplus/Makefile
@@ -3,7 +3,7 @@ LEXFLAGS = -B
YACC = bison
YFLAGS = -t -d -v --report=all
CC = gcc
-CCFLAGS = -ggdb -fPIC -Wall
+CCFLAGS = -ggdb -fPIC -Wall -Wno-unused-function -Wno-sign-compare
CXX = g++
CXXFLAGS = ${CCFLAGS}
LD = g++
diff --git a/cuobjdump_to_ptxplus/cuobjdumpInstList.cc b/cuobjdump_to_ptxplus/cuobjdumpInstList.cc
index b850298..ea5df82 100644
--- a/cuobjdump_to_ptxplus/cuobjdumpInstList.cc
+++ b/cuobjdump_to_ptxplus/cuobjdumpInstList.cc
@@ -368,7 +368,6 @@ void cuobjdumpInstList::addCuobjdumpRegister(std::string reg, bool lo)
// add memory operand
// memType: 0=constant, 1=shared, 2=global, 3=local
-unsigned currconstmem =1;
void cuobjdumpInstList::addCuobjdumpMemoryOperand(std::string mem, int memType) {
std::string origMem = mem;
bool neg = false;
@@ -409,7 +408,6 @@ void cuobjdumpInstList::addCuobjdumpMemoryOperand(std::string mem, int memType)
mem = "constant0" + mem.substr(7, mem.length());
}
else if(mem.substr(0, 5) == "c [0x"){
- if(currconstmem != m_entryList.size()) currconstmem++;
std::string out;
out = "constant1" + m_entryList.back().m_entryName + mem.substr(8);
mem = out.c_str();
diff --git a/cuobjdump_to_ptxplus/sass.y b/cuobjdump_to_ptxplus/sass.y
index 1c67aaf..3009aa1 100644
--- a/cuobjdump_to_ptxplus/sass.y
+++ b/cuobjdump_to_ptxplus/sass.y
@@ -90,49 +90,41 @@ cuobjdumpInst *instEntry;
%%
/*translation rules*/
-program : NEWLINE sassCode
- | program sassCode
- | ;
+program : program sassCode
+ | sassCode;
-sassCode : VERSIONHEADER IDENTIFIER functionList { printf($1); printf($2); printf(" No parsing errors\n\n"); }
- | newlines VERSIONHEADER IDENTIFIER functionList { printf($2); printf($3); printf(" No parsing errors\n\n"); }
- ;
+sassCode : VERSIONHEADER IDENTIFIER NEWLINE functionList { printf($1); printf($2); printf(" No parsing errors\n\n"); }
+ | NEWLINE VERSIONHEADER IDENTIFIER NEWLINE functionList { printf($2); printf($3); printf(" No parsing errors\n\n"); }
+ | VERSIONHEADER IDENTIFIER NEWLINE;
-functionList : functionList FUNCTIONHEADER IDENTIFIER {
- printf($2);
- printf($3);
- printf("\n");
- g_instList->addEntry($3);
- instEntry = new cuobjdumpInst();
- instEntry->setBase(".entry");
- g_instList->add(instEntry);
- g_instList->getListEnd().addOperand($3);} statementList { /*g_instList->getListEnd().addBaseModifier(".exit");*/ }
-/* | FUNCTIONHEADER IDENTIFIER { printf($1); printf($2);
- g_instList->addEntry($2);
- instEntry = new cuobjdumpInst();
- instEntry->setBase(".entry");
- g_instList->add(instEntry);
- g_instList->getListEnd().addOperand($2);} statementList { g_instList->getListEnd().addBaseModifier(".exit"); }*/
- | functionList newlines
- |
+functionList : functionList function
+ | function
;
+
+function : FUNCTIONHEADER IDENTIFIER {
+ printf($1);
+ printf($2);
+ printf("\n");
+ g_instList->addEntry($2);
+ instEntry = new cuobjdumpInst();
+ instEntry->setBase(".entry");
+ g_instList->add(instEntry);
+ g_instList->getListEnd().addOperand($2);} statementList NEWLINE
+ ;
-statementList : statementList statement newlines { printf("\n"); }
- | statement newlines { printf("\n"); }
- | statementList statement SEMICOLON newlines { printf(";\n"); }
- | statement SEMICOLON newlines { printf(";\n"); }
- | newlines {}
- ;
-newlines : NEWLINE
- | newlines NEWLINE
- ;
+statementList : statementList statement NEWLINE { printf("\n"); }
+ | statementList statement SEMICOLON NEWLINE { printf(";\n"); }
+ | statement NEWLINE { printf("\n"); }
+ | statement SEMICOLON NEWLINE { printf(";\n"); }
+ | NEWLINE {}
+ ;
statement : { instEntry = new cuobjdumpInst(); } instructionLabel instructionHex assemblyInstruction
;
instructionHex : INSTHEX
- ;
+ ;
instructionLabel : LABELSTART LABEL LABELEND { char* tempInput = $2;
char* tempLabel = new char[12];