[llvm-commits] CVS: llvm/include/llvm/Reoptimizer/BinInterface/sparc9.h sparcdis.h
Joel Stanley
jstanley at cs.uiuc.edu
Tue Apr 15 16:31:01 PDT 2003
Changes in directory llvm/include/llvm/Reoptimizer/BinInterface:
sparc9.h updated: 1.11 -> 1.12
sparcdis.h updated: 1.5 -> 1.6
---
Log message:
Changed print routines, renamed registers properly, etc.
Added more instruction-creation macros.
---
Diffs of the changes:
Index: llvm/include/llvm/Reoptimizer/BinInterface/sparc9.h
diff -u llvm/include/llvm/Reoptimizer/BinInterface/sparc9.h:1.11 llvm/include/llvm/Reoptimizer/BinInterface/sparc9.h:1.12
--- llvm/include/llvm/Reoptimizer/BinInterface/sparc9.h:1.11 Thu Apr 10 15:32:49 2003
+++ llvm/include/llvm/Reoptimizer/BinInterface/sparc9.h Tue Apr 15 16:32:53 2003
@@ -395,6 +395,15 @@
MK_FLD(INSTR_I, 1) | \
MK_FLD(INSTR_OP3, OP3_ADD))
+// Add a register to a register
+#define MK_ADD_R_R(dreg, sreg1, sreg2) \
+ (MK_FLD(INSTR_OP, OP_2) | \
+ MK_FLD(INSTR_RD, dreg) | \
+ MK_FLD(INSTR_OP3, OP3_ADD) | \
+ MK_FLD(INSTR_RS1, sreg1) | \
+ MK_FLD(INSTR_I, 0) | \
+ MK_FLD(INSTR_RS2, sreg2))
+
// Construct immediate-valued logical operation
#define MK_LOGIC_IMM(op3, dreg, sreg, imm) \
@@ -425,7 +434,7 @@
// Construct S{LL,RL,RA}X shift instruction.
-#define MK_SHIFTX(op3, dreg, sreg, shcnt) \
+#define MK_SHIFTX(op3, dreg, sreg, shcnt) \
(MK_FLD(INSTR_OP, OP_2) | \
MK_FLD(INSTR_RD, dreg) | \
MK_FLD(INSTR_OP3, op3) | \
@@ -433,3 +442,21 @@
MK_FLD(INSTR_I, 1) | \
MK_FLD(INSTR_X, 1) | \
MK_FLD(INSTR_SHCNT64, shcnt))
+
+// Construct save instruction
+
+#define MK_SAVE(dreg, sreg, imm) \
+ (MK_FLD(INSTR_OP, OP_2) | \
+ MK_FLD(INSTR_RD, dreg) | \
+ MK_FLD(INSTR_OP3, OP3_SAVE) | \
+ MK_FLD(INSTR_RS1, sreg) | \
+ MK_FLD(INSTR_I, 1) | \
+ MK_FLD(INSTR_SIMM13, imm))
+
+#define MK_RESTORE(dreg, sreg, imm) \
+ (MK_FLD(INSTR_OP, OP_2) | \
+ MK_FLD(INSTR_RD, dreg) | \
+ MK_FLD(INSTR_OP3, OP3_RESTORE) | \
+ MK_FLD(INSTR_RS1, sreg) | \
+ MK_FLD(INSTR_I, 1) | \
+ MK_FLD(INSTR_SIMM13, imm))
Index: llvm/include/llvm/Reoptimizer/BinInterface/sparcdis.h
diff -u llvm/include/llvm/Reoptimizer/BinInterface/sparcdis.h:1.5 llvm/include/llvm/Reoptimizer/BinInterface/sparcdis.h:1.6
--- llvm/include/llvm/Reoptimizer/BinInterface/sparcdis.h:1.5 Sun Dec 15 05:07:46 2002
+++ llvm/include/llvm/Reoptimizer/BinInterface/sparcdis.h Tue Apr 15 16:32:53 2003
@@ -1,36 +1,35 @@
-//*****************************************************************************
-// SPARC Instruction Disassembler
-//
-// Disassembler API Header
-//
-// * Initial implementation
-// * Added support for MOVcc (somehow I missed it?!)
-// * Added support for pseudo-disassembly
-// ( In the print routine for bin-interface we want
-// to be able to print the internal SSA form with
-// labels instead of registers. And we wish to
-// ommit RD from the view when we are not explicitly
-// reading from it)
-//
-// Todo:
-// * On the instructions that don't read from RD
-// do not print the label field (we get l-1 when we print)
-//
-// 2002 Cameron Buschardt
-//*****************************************************************************
-
-#ifndef __SPARCDIS__
-#define __SPARCDIS__
-// Conventional Disassembly. Prints instruction (no newline)
-void sparc_print(unsigned instr);
-
-// Pseudo disasm
-// uses the integers in labelrs1, labelrs2, labelrd, and labelccf as
-// gen labels for the parameter sources
-// instead of printing rxx for rs1, it will print l__labelrs1__
-void sparc_print_pseudo(unsigned instr, int labelrs1, int labelrs2, int labelrd, int labelccf);
-
-
-#endif
-
-
+//*****************************************************************************
+// SPARC Instruction Disassembler
+//
+// Disassembler API Header
+//
+// * Initial implementation
+// * Added support for MOVcc (somehow I missed it?!)
+// * Added support for pseudo-disassembly
+// ( In the print routine for bin-interface we want
+// to be able to print the internal SSA form with
+// labels instead of registers. And we wish to
+// ommit RD from the view when we are not explicitly
+// reading from it)
+//
+// Todo:
+// * On the instructions that don't read from RD
+// do not print the label field (we get l-1 when we print)
+//
+// 2002 Cameron Buschardt
+//*****************************************************************************
+
+#ifndef __SPARCDIS__
+#define __SPARCDIS__
+
+
+// Conventional Disassembly. Prints instruction (no newline)
+void sparc_print(unsigned instr);
+
+// Pseudo disasm
+// uses the integers in labelrs1, labelrs2, labelrd, and labelccf as
+// gen labels for the parameter sources
+// instead of printing rxx for rs1, it will print l__labelrs1__
+void sparc_print_pseudo(unsigned instr, int labelrs1, int labelrs2, int labelrd, int labelccf);
+
+#endif
More information about the llvm-commits
mailing list