Skip to content

Commit

Permalink
Move GetTempReg higher in the source file, before its first usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
sephiroth99 authored and benvanik committed Sep 22, 2015
1 parent ff7c755 commit 542f5ba
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/xenia/cpu/backend/x64/x64_sequences.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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});
Expand Down

0 comments on commit 542f5ba

Please sign in to comment.