[Avida-SVN] r3434 - development/source/cpu
brysonda at myxo.css.msu.edu
brysonda at myxo.css.msu.edu
Wed Sep 30 13:15:51 PDT 2009
Author: brysonda
Date: 2009-09-30 16:15:51 -0400 (Wed, 30 Sep 2009)
New Revision: 3434
Modified:
development/source/cpu/cHardwareCPU.cc
development/source/cpu/cHardwareExperimental.cc
development/source/cpu/cHardwareExperimental.h
Log:
Some tweaks and corrections to 'direct' label instruction variants. These are not final and likely will change or be removed in the future.
Modified: development/source/cpu/cHardwareCPU.cc
===================================================================
--- development/source/cpu/cHardwareCPU.cc 2009-09-30 15:34:39 UTC (rev 3433)
+++ development/source/cpu/cHardwareCPU.cc 2009-09-30 20:15:51 UTC (rev 3434)
@@ -336,7 +336,7 @@
tInstLibEntry<tMethod>("h-write", &cHardwareCPU::Inst_HeadWrite),
tInstLibEntry<tMethod>("h-copy", &cHardwareCPU::Inst_HeadCopy, nInstFlag::DEFAULT, "Copy from read-head to write-head; advance both"),
tInstLibEntry<tMethod>("h-search", &cHardwareCPU::Inst_HeadSearch, nInstFlag::DEFAULT, "Find complement template and make with flow head"),
- tInstLibEntry<tMethod>("h-search-direct", &cHardwareCPU::Inst_HeadSearch, nInstFlag::DEFAULT, "Find direct template and move the flow head"),
+ tInstLibEntry<tMethod>("h-search-direct", &cHardwareCPU::Inst_HeadSearchDirect, nInstFlag::DEFAULT, "Find direct template and move the flow head"),
tInstLibEntry<tMethod>("h-push", &cHardwareCPU::Inst_HeadPush),
tInstLibEntry<tMethod>("h-pop", &cHardwareCPU::Inst_HeadPop),
tInstLibEntry<tMethod>("set-head", &cHardwareCPU::Inst_SetHead),
@@ -345,7 +345,7 @@
tInstLibEntry<tMethod>("jmp-head", &cHardwareCPU::Inst_JumpHead, nInstFlag::DEFAULT, "Move head ?IP? by amount in CX register; CX = old pos."),
tInstLibEntry<tMethod>("get-head", &cHardwareCPU::Inst_GetHead, nInstFlag::DEFAULT, "Copy the position of the ?IP? head into CX"),
tInstLibEntry<tMethod>("if-label", &cHardwareCPU::Inst_IfLabel, nInstFlag::DEFAULT, "Execute next if we copied complement of attached label"),
- tInstLibEntry<tMethod>("if-label-direct", &cHardwareCPU::Inst_IfLabel, nInstFlag::DEFAULT, "Execute next if we copied direct match of the attached label"),
+ tInstLibEntry<tMethod>("if-label-direct", &cHardwareCPU::Inst_IfLabelDirect, nInstFlag::DEFAULT, "Execute next if we copied direct match of the attached label"),
tInstLibEntry<tMethod>("if-label2", &cHardwareCPU::Inst_IfLabel2, 0, "If copied label compl., exec next inst; else SKIP W/NOPS"),
tInstLibEntry<tMethod>("set-flow", &cHardwareCPU::Inst_SetFlow, nInstFlag::DEFAULT, "Set flow-head to position in ?CX?"),
@@ -6210,7 +6210,7 @@
bool cHardwareCPU::Inst_HeadSearchDirect(cAvidaContext& ctx)
{
ReadLabel();
- cHeadCPU found_pos = FindLabel(0);
+ cHeadCPU found_pos = FindLabel(1);
const int search_size = found_pos.GetPosition() - getIP().GetPosition();
GetRegister(REG_BX) = search_size;
GetRegister(REG_CX) = GetLabel().GetSize();
Modified: development/source/cpu/cHardwareExperimental.cc
===================================================================
--- development/source/cpu/cHardwareExperimental.cc 2009-09-30 15:34:39 UTC (rev 3433)
+++ development/source/cpu/cHardwareExperimental.cc 2009-09-30 20:15:51 UTC (rev 3434)
@@ -78,7 +78,10 @@
cNOPEntry("nop-B", REG_BX),
cNOPEntry("nop-C", REG_CX),
cNOPEntry("nop-D", REG_DX),
- };
+
+ cNOPEntry("nop-E", REG_EX),
+ cNOPEntry("nop-F", REG_FX),
+};
static const tInstLibEntry<tMethod> s_f_array[] = {
/*
@@ -90,7 +93,10 @@
tInstLibEntry<tMethod>("nop-B", &cHardwareExperimental::Inst_Nop, (nInstFlag::DEFAULT | nInstFlag::NOP), "No-operation; modifies other instructions"),
tInstLibEntry<tMethod>("nop-C", &cHardwareExperimental::Inst_Nop, (nInstFlag::DEFAULT | nInstFlag::NOP), "No-operation; modifies other instructions"),
tInstLibEntry<tMethod>("nop-D", &cHardwareExperimental::Inst_Nop, (nInstFlag::DEFAULT | nInstFlag::NOP), "No-operation; modifies other instructions"),
-
+
+ tInstLibEntry<tMethod>("nop-E", &cHardwareExperimental::Inst_Nop, nInstFlag::NOP, "No-operation; modifies other instructions"),
+ tInstLibEntry<tMethod>("nop-F", &cHardwareExperimental::Inst_Nop, nInstFlag::NOP, "No-operation; modifies other instructions"),
+
tInstLibEntry<tMethod>("NULL", &cHardwareExperimental::Inst_Nop, 0, "True no-operation instruction: does nothing"),
tInstLibEntry<tMethod>("nop-X", &cHardwareExperimental::Inst_Nop, 0, "True no-operation instruction: does nothing"),
@@ -1643,7 +1649,7 @@
bool cHardwareExperimental::Inst_HeadSearchDirect(cAvidaContext& ctx)
{
ReadLabel();
- cHeadCPU found_pos = FindLabelStart(true);
+ cHeadCPU found_pos = FindLabelForward(true);
const int search_size = found_pos.GetPosition() - getIP().GetPosition();
setInternalValue(m_threads[m_cur_thread].reg[REG_BX], search_size);
setInternalValue(m_threads[m_cur_thread].reg[REG_CX], GetLabel().GetSize());
@@ -1655,7 +1661,7 @@
bool cHardwareExperimental::Inst_HeadSearchDirectLabel(cAvidaContext& ctx)
{
ReadLabel();
- cHeadCPU found_pos = FindLabelStart(true);
+ cHeadCPU found_pos = FindLabelForward(true);
getHead(nHardware::HEAD_FLOW).Set(found_pos);
getHead(nHardware::HEAD_FLOW).Advance();
return true;
Modified: development/source/cpu/cHardwareExperimental.h
===================================================================
--- development/source/cpu/cHardwareExperimental.h 2009-09-30 15:34:39 UTC (rev 3433)
+++ development/source/cpu/cHardwareExperimental.h 2009-09-30 20:15:51 UTC (rev 3434)
@@ -85,7 +85,7 @@
// -------- Structure Constants --------
static const int NUM_REGISTERS = 4;
static const int NUM_HEADS = nHardware::NUM_HEADS >= NUM_REGISTERS ? nHardware::NUM_HEADS : NUM_REGISTERS;
- enum tRegisters { REG_AX = 0, REG_BX, REG_CX, REG_DX };
+ enum tRegisters { REG_AX = 0, REG_BX, REG_CX, REG_DX, REG_EX, REG_FX };
static const int NUM_NOPS = NUM_REGISTERS;
More information about the Avida-cvs
mailing list