|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.util.Utils
at.dms.compiler.Phylum
at.dms.kjc.JPhylum
at.dms.kjc.JStatement
at.dms.kjc.sir.InlineAssembly
public class InlineAssembly
Statement used for generating inline assembly. Leverages gcc's asm volatile keyword. Mostly holds Strings that are passed directly to codegen but is structured slightly to allow automatic generation of the appropriate asm volatile statement. See spacetime/TraceIRtoC for example of how the output should be formatted. May hold a whole block of assembly instructions.
Field Summary |
---|
Fields inherited from class at.dms.util.Utils |
---|
EMPTY_LIST, getForLoopCallers |
Fields inherited from interface at.dms.kjc.Constants |
---|
CMP_VERSION, JAV_CLASS, JAV_CLONE, JAV_CLONEABLE, JAV_CONSTRUCTOR, JAV_ERROR, JAV_EXCEPTION, JAV_INIT, JAV_LENGTH, JAV_NAME_SEPARATOR, JAV_OBJECT, JAV_OUTER_THIS, JAV_RUNTIME, JAV_RUNTIME_EXCEPTION, JAV_STATIC_INIT, JAV_STRING, JAV_STRINGBUFFER, JAV_THIS, JAV_THROWABLE, OPE_BAND, OPE_BNOT, OPE_BOR, OPE_BSR, OPE_BXOR, OPE_EQ, OPE_GE, OPE_GT, OPE_LE, OPE_LNOT, OPE_LT, OPE_MINUS, OPE_NE, OPE_PERCENT, OPE_PLUS, OPE_POSTDEC, OPE_POSTINC, OPE_PREDEC, OPE_PREINC, OPE_SIMPLE, OPE_SL, OPE_SLASH, OPE_SR, OPE_STAR, TID_ARRAY, TID_BIT, TID_BOOLEAN, TID_BYTE, TID_CHAR, TID_CLASS, TID_DOUBLE, TID_FLOAT, TID_INT, TID_LONG, TID_SHORT, TID_VECTOR, TID_VOID, VECTOR_EMPTY |
Constructor Summary | |
---|---|
InlineAssembly()
Construct InlineAssembly containing no instructions. |
|
InlineAssembly(String asm)
Construct InlineAssembly containing the initial instruction asm. |
Method Summary | |
---|---|
Object |
accept(AttributeVisitor p)
Dummy method to accept AttributeVisitor but not do anything. |
void |
accept(KjcVisitor p)
Main entry point for KjcVisitor. |
void |
add(String instr)
Add single instruction. |
void |
addClobber(String clobber)
Add register clobbered by this instruction block. |
void |
addInput(String input)
Add input to instruction block. |
void |
analyse(CBodyContext context)
Dummy method for analyse(CBodyContext context). |
void |
genCode(CodeSequence code)
Dummy method for genCode(CodeSequence). |
String[] |
getClobber()
Returns list of clobbered registers. |
String[] |
getInput()
Returns list of input labels. |
String[] |
getInstructions()
Returns list of instructions. |
Methods inherited from class at.dms.kjc.JStatement |
---|
deepClone, deepCloneInto, fail, getBreakLabel, getComments, getContinueLabel, setComments |
Methods inherited from class at.dms.kjc.JPhylum |
---|
assertMutable, check, check, check, check, deepCloneInto, setLineNumber |
Methods inherited from class at.dms.compiler.Phylum |
---|
deepCloneInto, getTokenReference, setTokenReference |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InlineAssembly()
public InlineAssembly(String asm)
asm
- The initial instruction to include.Method Detail |
---|
public void add(String instr)
instr
- The instruction to add.public void addInput(String input)
input
- The input label to add.public void addClobber(String clobber)
clobber
- The register to add.public String[] getInstructions()
public String[] getInput()
public String[] getClobber()
public Object accept(AttributeVisitor p)
accept
in class JStatement
p
- the visitorpublic void genCode(CodeSequence code)
genCode
in class JStatement
code
- the code listpublic void analyse(CBodyContext context)
analyse
in class JStatement
context
- the analysis contextpublic void accept(KjcVisitor p)
accept
in class JStatement
p
- the visitor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |