LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
spim-assembly.hh
Go to the documentation of this file.
1 
6 #ifndef TARGET_MIPS_SPIM_ASSEMBLY_HH
7 # define TARGET_MIPS_SPIM_ASSEMBLY_HH
8 
9 # include <target/assembly.hh>
10 
11 namespace target
12 {
13 
14  namespace mips
15  {
16 
21  {
24  public:
26  SpimAssembly ();
28  virtual ~SpimAssembly ();
34  public:
36  std::string binop_inst (const tree::Binop::Oper& op) const;
39  const temp::Temp& left,
40  const temp::Temp& right,
41  const temp::Temp& res) const;
44  const temp::Temp& left,
45  int right,
46  const temp::Temp& res) const;
47 
48  // This method should be useless: the BURG generator should use
49  // the precedent form.
51  int left,
52  const temp::Temp& right,
53  const temp::Temp& res) const;
59  public:
62  const temp::Temp& dst) const;
65  assem::Instrs move_build (int immediate,
66  const temp::Temp& dst) const;
67 
69  assem::Instrs move_build (const temp::Label& label,
70  const temp::Temp& dst) const;
71 
73  assem::Instrs load_build (const temp::Temp& base,
74  int offset,
75  const temp::Temp& dst) const;
77  assem::Instrs load_build (const temp::Temp& base,
78  const temp::Temp& dst) const;
80  assem::Instrs load_build (int absolute,
81  const temp::Temp& dst) const;
82 
85  const temp::Temp& base,
86  int offset = 0) const;
89  int absolute) const;
95  public:
97  assem::Instrs label_build (const temp::Label& label) const;
98 
100  std::string cjump_inst (const tree::Cjump::Relop& op) const;
101 
104  const temp::Temp& left,
105  const temp::Temp& right,
106  const temp::Label& label_true,
107  const temp::Label& label_false) const;
108 
111  const temp::Temp& left,
112  int right,
113  const temp::Label& label_true,
114  const temp::Label& label_false) const;
116  assem::Instrs jump_build (const temp::Label& label) const;
121  public:
123  assem::Instrs call_build (const temp::Label& label,
124  const temp::temp_list_type& args,
125  const temp::temp_list_type& res) const;
127  assem::Instrs ret_build (const temp::Temp& ret) const;
133  public:
135  virtual const char* runtime (bool gc = false) const override;
137  };
138 
139  } // namespace mips
140 
141 } // namespace target
142 
143 #endif // !TARGET_MIPS_SPIM_ASSEMBLY_HH