MCPcopy Create free account
hub / github.com/N64Recomp/N64Recomp / get_operand_string

Method get_operand_string

src/cgenerator.cpp:126–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126void N64Recomp::CGenerator::get_operand_string(Operand operand, UnaryOpType operation, const InstructionContext& context, std::string& operand_string) const {
127 switch (operand) {
128 case Operand::Rd:
129 operand_string = gpr_to_string(context.rd);
130 break;
131 case Operand::Rs:
132 operand_string = gpr_to_string(context.rs);
133 break;
134 case Operand::Rt:
135 operand_string = gpr_to_string(context.rt);
136 break;
137 case Operand::Fd:
138 operand_string = fpr_to_string(context.fd);
139 break;
140 case Operand::Fs:
141 operand_string = fpr_to_string(context.fs);
142 break;
143 case Operand::Ft:
144 operand_string = fpr_to_string(context.ft);
145 break;
146 case Operand::FdDouble:
147 operand_string = fpr_double_to_string(context.fd);
148 break;
149 case Operand::FsDouble:
150 operand_string = fpr_double_to_string(context.fs);
151 break;
152 case Operand::FtDouble:
153 operand_string = fpr_double_to_string(context.ft);
154 break;
155 case Operand::FdU32L:
156 operand_string = fpr_u32l_to_string(context.fd);
157 break;
158 case Operand::FsU32L:
159 operand_string = fpr_u32l_to_string(context.fs);
160 break;
161 case Operand::FtU32L:
162 operand_string = fpr_u32l_to_string(context.ft);
163 break;
164 case Operand::FdU32H:
165 assert(false);
166 break;
167 case Operand::FsU32H:
168 assert(false);
169 break;
170 case Operand::FtU32H:
171 assert(false);
172 break;
173 case Operand::FdU64:
174 operand_string = fpr_u64_to_string(context.fd);
175 break;
176 case Operand::FsU64:
177 operand_string = fpr_u64_to_string(context.fs);
178 break;
179 case Operand::FtU64:
180 operand_string = fpr_u64_to_string(context.ft);
181 break;
182 case Operand::ImmU16:
183 if (context.reloc_type != N64Recomp::RelocType::R_MIPS_NONE) {

Callers

nothing calls this directly

Calls 7

gpr_to_stringFunction · 0.85
fpr_to_stringFunction · 0.85
fpr_double_to_stringFunction · 0.85
fpr_u32l_to_stringFunction · 0.85
fpr_u64_to_stringFunction · 0.85
unsigned_relocFunction · 0.85
signed_relocFunction · 0.85

Tested by

no test coverage detected