summaryrefslogtreecommitdiff
path: root/instruction.cpp
diff options
context:
space:
mode:
authorTom Stellard <tstellar@gmail.com>2010-12-28 20:27:52 -0800
committerTom Stellard <tstellar@gmail.com>2010-12-28 20:27:52 -0800
commit9e18507a1ee455bacb2a72bb8e641242f2ed5baf (patch)
tree4f1e53b30cd4f21ae3bd3618a84044030bd2f342 /instruction.cpp
parent4f4f616a00c84867872e95720d4b5b0623062310 (diff)
instruction: Add trim_dst_regs()
Diffstat (limited to 'instruction.cpp')
-rw-r--r--instruction.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/instruction.cpp b/instruction.cpp
index 8509eb6..1e7f91b 100644
--- a/instruction.cpp
+++ b/instruction.cpp
@@ -21,6 +21,16 @@ void instruction::add_src_reg(std::vector<register_address> src_reg)
m_src_regs.push_back(src_reg);
}
+void instruction::trim_dst_regs()
+{
+ unsigned int i;
+ for (i = 0; i < m_src_regs.size(); i++){
+ while (m_dst.size() > m_src_regs[i].size()) {
+ m_dst.pop_back();
+ }
+ }
+}
+
add_instruction::add_instruction(
std::vector<register_address> dst,
std::vector<register_address> src0,