Move GetTempReg higher in the source file, before its first usage.

This commit is contained in:
sephiroth99 2015-09-22 00:55:30 -04:00 committed by Ben Vanik
parent ff7c755bc9
commit 542f5ba8e5
1 changed files with 19 additions and 19 deletions

View File

@ -411,6 +411,25 @@ struct I<OPCODE, DEST, SRC1, SRC2, SRC3> : DestField<DEST> {
}
};
template <typename T>
const T GetTempReg(X64Emitter& e);
template <>
const Reg8 GetTempReg<Reg8>(X64Emitter& e) {
return e.al;
}
template <>
const Reg16 GetTempReg<Reg16>(X64Emitter& e) {
return e.ax;
}
template <>
const Reg32 GetTempReg<Reg32>(X64Emitter& e) {
return e.eax;
}
template <>
const Reg64 GetTempReg<Reg64>(X64Emitter& e) {
return e.rax;
}
template <typename SEQ, typename T>
struct Sequence {
typedef T EmitArgType;
@ -629,25 +648,6 @@ struct Sequence {
}
};
template <typename T>
const T GetTempReg(X64Emitter& e);
template <>
const Reg8 GetTempReg<Reg8>(X64Emitter& e) {
return e.al;
}
template <>
const Reg16 GetTempReg<Reg16>(X64Emitter& e) {
return e.ax;
}
template <>
const Reg32 GetTempReg<Reg32>(X64Emitter& e) {
return e.eax;
}
template <>
const Reg64 GetTempReg<Reg64>(X64Emitter& e) {
return e.rax;
}
template <typename T>
void Register() {
sequence_table.insert({T::head_key(), T::Select});