[PATCH 03/22] covoar/TargetBase: Update branchInstructions variable name

Alex White alexanderjwhite at gmail.com
Mon Mar 1 20:01:10 UTC 2021


The TargetBase class contains a member variable named
branchInstructions. The name omits the fact that it is only meant to
contain conditional branch instructions. Its name has been changed to
conditionalBranchInstructions to avoid confusion.
---
 tester/covoar/TargetBase.cc     | 10 +++-
 tester/covoar/TargetBase.h      |  4 +-
 tester/covoar/Target_arm.cc     | 34 ++++++------
 tester/covoar/Target_i386.cc    | 64 ++++++++++-----------
 tester/covoar/Target_lm32.cc    | 12 ++--
 tester/covoar/Target_m68k.cc    | 98 ++++++++++++++++-----------------
 tester/covoar/Target_powerpc.cc | 56 +++++++++----------
 tester/covoar/Target_riscv.cc   | 22 ++++----
 tester/covoar/Target_sparc.cc   | 66 +++++++++++-----------
 9 files changed, 185 insertions(+), 181 deletions(-)

diff --git a/tester/covoar/TargetBase.cc b/tester/covoar/TargetBase.cc
index 354a580..4474fad 100644
--- a/tester/covoar/TargetBase.cc
+++ b/tester/covoar/TargetBase.cc
@@ -66,15 +66,19 @@ namespace Target {
   {
     std::list <std::string>::iterator i;
 
-    if (branchInstructions.empty()) {
+    if (conditionalBranchInstructions.empty()) {
       throw rld::error(
         "DETERMINE BRANCH INSTRUCTIONS FOR THIS ARCHITECTURE! -- fix me",
         "TargetBase::isBranch"
       );
     }
 
-    i = find(branchInstructions.begin(), branchInstructions.end(), instruction);
-    if ( i  == branchInstructions.end() )
+    i = find(
+      conditionalBranchInstructions.begin(),
+      conditionalBranchInstructions.end(),
+      instruction
+    );
+    if ( i  == conditionalBranchInstructions.end() )
       return false;
 
     return true;
diff --git a/tester/covoar/TargetBase.h b/tester/covoar/TargetBase.h
index 14cd6f2..e566c15 100644
--- a/tester/covoar/TargetBase.h
+++ b/tester/covoar/TargetBase.h
@@ -135,10 +135,10 @@ namespace Target {
     bool objdumpHasTabs;
 
     /*!
-     * This member variable is an array of all branch instructions
+     * This member variable is an array of all conditional branch instructions
      * for this target.
      */
-    std::list <std::string> branchInstructions;
+    std::list <std::string> conditionalBranchInstructions;
 
   private:
 
diff --git a/tester/covoar/Target_arm.cc b/tester/covoar/Target_arm.cc
index a33ec80..4b7b2e1 100644
--- a/tester/covoar/Target_arm.cc
+++ b/tester/covoar/Target_arm.cc
@@ -19,24 +19,24 @@ namespace Target {
   Target_arm::Target_arm( std::string targetName ):
     TargetBase( targetName )
   {
-    branchInstructions.push_back("bcc");
-    branchInstructions.push_back("bcs");
-    branchInstructions.push_back("beq");
-    branchInstructions.push_back("bge");
-    branchInstructions.push_back("bgt");
-    branchInstructions.push_back("bhi");
-    branchInstructions.push_back("bl-hi");
-    branchInstructions.push_back("bl-lo");
-    branchInstructions.push_back("ble");
-    branchInstructions.push_back("bls");
-    branchInstructions.push_back("blt");
-    branchInstructions.push_back("bmi");
-    branchInstructions.push_back("bne");
-    branchInstructions.push_back("bpl");
-    branchInstructions.push_back("bvc");
-    branchInstructions.push_back("bvs");
+    conditionalBranchInstructions.push_back("bcc");
+    conditionalBranchInstructions.push_back("bcs");
+    conditionalBranchInstructions.push_back("beq");
+    conditionalBranchInstructions.push_back("bge");
+    conditionalBranchInstructions.push_back("bgt");
+    conditionalBranchInstructions.push_back("bhi");
+    conditionalBranchInstructions.push_back("bl-hi");
+    conditionalBranchInstructions.push_back("bl-lo");
+    conditionalBranchInstructions.push_back("ble");
+    conditionalBranchInstructions.push_back("bls");
+    conditionalBranchInstructions.push_back("blt");
+    conditionalBranchInstructions.push_back("bmi");
+    conditionalBranchInstructions.push_back("bne");
+    conditionalBranchInstructions.push_back("bpl");
+    conditionalBranchInstructions.push_back("bvc");
+    conditionalBranchInstructions.push_back("bvs");
 
-    branchInstructions.sort();
+    conditionalBranchInstructions.sort();
 
   }
 
diff --git a/tester/covoar/Target_i386.cc b/tester/covoar/Target_i386.cc
index 0f82f18..e0c9c0f 100644
--- a/tester/covoar/Target_i386.cc
+++ b/tester/covoar/Target_i386.cc
@@ -16,39 +16,39 @@ namespace Target {
   Target_i386::Target_i386( std::string targetName ):
     TargetBase( targetName )
   {
-    branchInstructions.push_back("ja");
-    branchInstructions.push_back("jb");
-    branchInstructions.push_back("jc");
-    branchInstructions.push_back("je");
-    branchInstructions.push_back("jg");
-    branchInstructions.push_back("jl");
-    branchInstructions.push_back("jo");
-    branchInstructions.push_back("jp");
-    branchInstructions.push_back("js");
-    branchInstructions.push_back("jz");
-    branchInstructions.push_back("jae");
-    branchInstructions.push_back("jbe");
-    branchInstructions.push_back("jge");
-    branchInstructions.push_back("jle");
-    branchInstructions.push_back("jne");
-    branchInstructions.push_back("jna");
-    branchInstructions.push_back("jnb");
-    branchInstructions.push_back("jnc");
-    branchInstructions.push_back("jne");
-    branchInstructions.push_back("jng");
-    branchInstructions.push_back("jnl");
-    branchInstructions.push_back("jno");
-    branchInstructions.push_back("jnp");
-    branchInstructions.push_back("jns");
-    branchInstructions.push_back("jnz");
-    branchInstructions.push_back("jpe");
-    branchInstructions.push_back("jpo");
-    branchInstructions.push_back("jnbe");
-    branchInstructions.push_back("jnae");
-    branchInstructions.push_back("jnle");
-    branchInstructions.push_back("jnge");
+    conditionalBranchInstructions.push_back("ja");
+    conditionalBranchInstructions.push_back("jb");
+    conditionalBranchInstructions.push_back("jc");
+    conditionalBranchInstructions.push_back("je");
+    conditionalBranchInstructions.push_back("jg");
+    conditionalBranchInstructions.push_back("jl");
+    conditionalBranchInstructions.push_back("jo");
+    conditionalBranchInstructions.push_back("jp");
+    conditionalBranchInstructions.push_back("js");
+    conditionalBranchInstructions.push_back("jz");
+    conditionalBranchInstructions.push_back("jae");
+    conditionalBranchInstructions.push_back("jbe");
+    conditionalBranchInstructions.push_back("jge");
+    conditionalBranchInstructions.push_back("jle");
+    conditionalBranchInstructions.push_back("jne");
+    conditionalBranchInstructions.push_back("jna");
+    conditionalBranchInstructions.push_back("jnb");
+    conditionalBranchInstructions.push_back("jnc");
+    conditionalBranchInstructions.push_back("jne");
+    conditionalBranchInstructions.push_back("jng");
+    conditionalBranchInstructions.push_back("jnl");
+    conditionalBranchInstructions.push_back("jno");
+    conditionalBranchInstructions.push_back("jnp");
+    conditionalBranchInstructions.push_back("jns");
+    conditionalBranchInstructions.push_back("jnz");
+    conditionalBranchInstructions.push_back("jpe");
+    conditionalBranchInstructions.push_back("jpo");
+    conditionalBranchInstructions.push_back("jnbe");
+    conditionalBranchInstructions.push_back("jnae");
+    conditionalBranchInstructions.push_back("jnle");
+    conditionalBranchInstructions.push_back("jnge");
 
-    branchInstructions.sort();
+    conditionalBranchInstructions.sort();
 
   }
 
diff --git a/tester/covoar/Target_lm32.cc b/tester/covoar/Target_lm32.cc
index 988c735..93184ec 100644
--- a/tester/covoar/Target_lm32.cc
+++ b/tester/covoar/Target_lm32.cc
@@ -17,12 +17,12 @@ namespace Target {
   Target_lm32::Target_lm32( std::string targetName ):
     TargetBase( targetName )
   {
-    branchInstructions.push_back("be");
-    branchInstructions.push_back("bge");
-    branchInstructions.push_back("bgeu");
-    branchInstructions.push_back("bg");
-    branchInstructions.push_back("bgu");
-    branchInstructions.push_back("bne");
+    conditionalBranchInstructions.push_back("be");
+    conditionalBranchInstructions.push_back("bge");
+    conditionalBranchInstructions.push_back("bgeu");
+    conditionalBranchInstructions.push_back("bg");
+    conditionalBranchInstructions.push_back("bgu");
+    conditionalBranchInstructions.push_back("bne");
   }
 
   Target_lm32::~Target_lm32()
diff --git a/tester/covoar/Target_m68k.cc b/tester/covoar/Target_m68k.cc
index 5dc7993..536ae80 100644
--- a/tester/covoar/Target_m68k.cc
+++ b/tester/covoar/Target_m68k.cc
@@ -19,56 +19,56 @@ namespace Target {
   Target_m68k::Target_m68k( std::string targetName ):
     TargetBase( targetName )
   {
-    branchInstructions.push_back("bcc");
-    branchInstructions.push_back("bccs");
-    branchInstructions.push_back("bccl");
-    branchInstructions.push_back("bcs");
-    branchInstructions.push_back("bcss");
-    branchInstructions.push_back("bcsl");
-    branchInstructions.push_back("beq");
-    branchInstructions.push_back("beqs");
-    branchInstructions.push_back("beql");
-    branchInstructions.push_back("bge");
-    branchInstructions.push_back("bges");
-    branchInstructions.push_back("bgel");
-    branchInstructions.push_back("bgt");
-    branchInstructions.push_back("bgts");
-    branchInstructions.push_back("bgtl");
-    branchInstructions.push_back("bhi");
-    branchInstructions.push_back("bhis");
-    branchInstructions.push_back("bhil");
-    branchInstructions.push_back("bhs");
-    branchInstructions.push_back("bhss");
-    branchInstructions.push_back("bhsl");
-    branchInstructions.push_back("ble");
-    branchInstructions.push_back("bles");
-    branchInstructions.push_back("blel");
-    branchInstructions.push_back("blo");
-    branchInstructions.push_back("blos");
-    branchInstructions.push_back("blol");
-    branchInstructions.push_back("bls");
-    branchInstructions.push_back("blss");
-    branchInstructions.push_back("blsl");
-    branchInstructions.push_back("blt");
-    branchInstructions.push_back("blts");
-    branchInstructions.push_back("bltl");
-    branchInstructions.push_back("bmi");
-    branchInstructions.push_back("bmis");
-    branchInstructions.push_back("bmil");
-    branchInstructions.push_back("bne");
-    branchInstructions.push_back("bnes");
-    branchInstructions.push_back("bnel");
-    branchInstructions.push_back("bpl");
-    branchInstructions.push_back("bpls");
-    branchInstructions.push_back("bpll");
-    branchInstructions.push_back("bvc");
-    branchInstructions.push_back("bvcs");
-    branchInstructions.push_back("bvcl");
-    branchInstructions.push_back("bvs");
-    branchInstructions.push_back("bvss");
-    branchInstructions.push_back("bvsl");
+    conditionalBranchInstructions.push_back("bcc");
+    conditionalBranchInstructions.push_back("bccs");
+    conditionalBranchInstructions.push_back("bccl");
+    conditionalBranchInstructions.push_back("bcs");
+    conditionalBranchInstructions.push_back("bcss");
+    conditionalBranchInstructions.push_back("bcsl");
+    conditionalBranchInstructions.push_back("beq");
+    conditionalBranchInstructions.push_back("beqs");
+    conditionalBranchInstructions.push_back("beql");
+    conditionalBranchInstructions.push_back("bge");
+    conditionalBranchInstructions.push_back("bges");
+    conditionalBranchInstructions.push_back("bgel");
+    conditionalBranchInstructions.push_back("bgt");
+    conditionalBranchInstructions.push_back("bgts");
+    conditionalBranchInstructions.push_back("bgtl");
+    conditionalBranchInstructions.push_back("bhi");
+    conditionalBranchInstructions.push_back("bhis");
+    conditionalBranchInstructions.push_back("bhil");
+    conditionalBranchInstructions.push_back("bhs");
+    conditionalBranchInstructions.push_back("bhss");
+    conditionalBranchInstructions.push_back("bhsl");
+    conditionalBranchInstructions.push_back("ble");
+    conditionalBranchInstructions.push_back("bles");
+    conditionalBranchInstructions.push_back("blel");
+    conditionalBranchInstructions.push_back("blo");
+    conditionalBranchInstructions.push_back("blos");
+    conditionalBranchInstructions.push_back("blol");
+    conditionalBranchInstructions.push_back("bls");
+    conditionalBranchInstructions.push_back("blss");
+    conditionalBranchInstructions.push_back("blsl");
+    conditionalBranchInstructions.push_back("blt");
+    conditionalBranchInstructions.push_back("blts");
+    conditionalBranchInstructions.push_back("bltl");
+    conditionalBranchInstructions.push_back("bmi");
+    conditionalBranchInstructions.push_back("bmis");
+    conditionalBranchInstructions.push_back("bmil");
+    conditionalBranchInstructions.push_back("bne");
+    conditionalBranchInstructions.push_back("bnes");
+    conditionalBranchInstructions.push_back("bnel");
+    conditionalBranchInstructions.push_back("bpl");
+    conditionalBranchInstructions.push_back("bpls");
+    conditionalBranchInstructions.push_back("bpll");
+    conditionalBranchInstructions.push_back("bvc");
+    conditionalBranchInstructions.push_back("bvcs");
+    conditionalBranchInstructions.push_back("bvcl");
+    conditionalBranchInstructions.push_back("bvs");
+    conditionalBranchInstructions.push_back("bvss");
+    conditionalBranchInstructions.push_back("bvsl");
 
-    branchInstructions.sort();
+    conditionalBranchInstructions.sort();
 
   }
 
diff --git a/tester/covoar/Target_powerpc.cc b/tester/covoar/Target_powerpc.cc
index 3444b3c..c62feb0 100644
--- a/tester/covoar/Target_powerpc.cc
+++ b/tester/covoar/Target_powerpc.cc
@@ -21,36 +21,36 @@ namespace Target {
     // bl is actually branch and link which is a call
     // branchInstructions.push_back("b");
     // branchInstructions.push_back("ba");
-    branchInstructions.push_back("beq");
-    branchInstructions.push_back("beq+");
-    branchInstructions.push_back("beq-");
-    branchInstructions.push_back("bne");
-    branchInstructions.push_back("bne+");
-    branchInstructions.push_back("bne-");
-    branchInstructions.push_back("bge");
-    branchInstructions.push_back("bge+");
-    branchInstructions.push_back("bge-");
-    branchInstructions.push_back("bgt");
-    branchInstructions.push_back("bgt+");
-    branchInstructions.push_back("bgt-");
-    branchInstructions.push_back("ble");
-    branchInstructions.push_back("ble+");
-    branchInstructions.push_back("ble-");
-    branchInstructions.push_back("blt");
-    branchInstructions.push_back("blt+");
-    branchInstructions.push_back("blt-");
-    branchInstructions.push_back("bla");
-    branchInstructions.push_back("bc");
-    branchInstructions.push_back("bca");
-    branchInstructions.push_back("bcl");
-    branchInstructions.push_back("bcla");
-    branchInstructions.push_back("bcctr");
-    branchInstructions.push_back("bcctrl");
-    branchInstructions.push_back("bclr");
-    branchInstructions.push_back("bclrl");
+    conditionalBranchInstructions.push_back("beq");
+    conditionalBranchInstructions.push_back("beq+");
+    conditionalBranchInstructions.push_back("beq-");
+    conditionalBranchInstructions.push_back("bne");
+    conditionalBranchInstructions.push_back("bne+");
+    conditionalBranchInstructions.push_back("bne-");
+    conditionalBranchInstructions.push_back("bge");
+    conditionalBranchInstructions.push_back("bge+");
+    conditionalBranchInstructions.push_back("bge-");
+    conditionalBranchInstructions.push_back("bgt");
+    conditionalBranchInstructions.push_back("bgt+");
+    conditionalBranchInstructions.push_back("bgt-");
+    conditionalBranchInstructions.push_back("ble");
+    conditionalBranchInstructions.push_back("ble+");
+    conditionalBranchInstructions.push_back("ble-");
+    conditionalBranchInstructions.push_back("blt");
+    conditionalBranchInstructions.push_back("blt+");
+    conditionalBranchInstructions.push_back("blt-");
+    conditionalBranchInstructions.push_back("bla");
+    conditionalBranchInstructions.push_back("bc");
+    conditionalBranchInstructions.push_back("bca");
+    conditionalBranchInstructions.push_back("bcl");
+    conditionalBranchInstructions.push_back("bcla");
+    conditionalBranchInstructions.push_back("bcctr");
+    conditionalBranchInstructions.push_back("bcctrl");
+    conditionalBranchInstructions.push_back("bclr");
+    conditionalBranchInstructions.push_back("bclrl");
 
 
-    branchInstructions.sort();
+    conditionalBranchInstructions.sort();
   }
 
   Target_powerpc::~Target_powerpc()
diff --git a/tester/covoar/Target_riscv.cc b/tester/covoar/Target_riscv.cc
index 279dc6a..13c81c5 100644
--- a/tester/covoar/Target_riscv.cc
+++ b/tester/covoar/Target_riscv.cc
@@ -43,18 +43,18 @@ namespace Target {
   Target_riscv::Target_riscv( std::string targetName ):
     TargetBase( targetName )
   {
-    branchInstructions.push_back("beqz");
-    branchInstructions.push_back("bnez");
-    branchInstructions.push_back("blez");
-    branchInstructions.push_back("bgez");
-    branchInstructions.push_back("bltz");
-    branchInstructions.push_back("bgt");
-    branchInstructions.push_back("bgtz");
-    branchInstructions.push_back("ble");
-    branchInstructions.push_back("bgtu");
-    branchInstructions.push_back("bleu");
+    conditionalBranchInstructions.push_back("beqz");
+    conditionalBranchInstructions.push_back("bnez");
+    conditionalBranchInstructions.push_back("blez");
+    conditionalBranchInstructions.push_back("bgez");
+    conditionalBranchInstructions.push_back("bltz");
+    conditionalBranchInstructions.push_back("bgt");
+    conditionalBranchInstructions.push_back("bgtz");
+    conditionalBranchInstructions.push_back("ble");
+    conditionalBranchInstructions.push_back("bgtu");
+    conditionalBranchInstructions.push_back("bleu");
 
-    branchInstructions.sort();
+    conditionalBranchInstructions.sort();
    }
 
   Target_riscv::~Target_riscv()
diff --git a/tester/covoar/Target_sparc.cc b/tester/covoar/Target_sparc.cc
index 0e4ab2e..eab2684 100644
--- a/tester/covoar/Target_sparc.cc
+++ b/tester/covoar/Target_sparc.cc
@@ -15,40 +15,40 @@ namespace Target {
   Target_sparc::Target_sparc( std::string targetName ):
     TargetBase( targetName )
   {
-    branchInstructions.push_back("bn");
-    branchInstructions.push_back("bn,a");
-    branchInstructions.push_back("be");
-    branchInstructions.push_back("be,a");
-    branchInstructions.push_back("ble");
-    branchInstructions.push_back("ble,a");
-    branchInstructions.push_back("bl");
-    branchInstructions.push_back("bl,a");
-    branchInstructions.push_back("bleu");
-    branchInstructions.push_back("bleu,a");
-    branchInstructions.push_back("bcs");
-    branchInstructions.push_back("bcs,a");
-    branchInstructions.push_back("bneg");
-    branchInstructions.push_back("bneg,a");
-    branchInstructions.push_back("bvs");
-    branchInstructions.push_back("bvs,a");
-    branchInstructions.push_back("ba");
-    branchInstructions.push_back("ba,a");
-    branchInstructions.push_back("bne");
-    branchInstructions.push_back("bne,a");
-    branchInstructions.push_back("bg");
-    branchInstructions.push_back("bg,a");
-    branchInstructions.push_back("bge");
-    branchInstructions.push_back("bge,a");
-    branchInstructions.push_back("bgu");
-    branchInstructions.push_back("bgu,a");
-    branchInstructions.push_back("bcc");
-    branchInstructions.push_back("bcc,a");
-    branchInstructions.push_back("bpos");
-    branchInstructions.push_back("bpos,a");
-    branchInstructions.push_back("bvc");
-    branchInstructions.push_back("bvc,a");
+    conditionalBranchInstructions.push_back("bn");
+    conditionalBranchInstructions.push_back("bn,a");
+    conditionalBranchInstructions.push_back("be");
+    conditionalBranchInstructions.push_back("be,a");
+    conditionalBranchInstructions.push_back("ble");
+    conditionalBranchInstructions.push_back("ble,a");
+    conditionalBranchInstructions.push_back("bl");
+    conditionalBranchInstructions.push_back("bl,a");
+    conditionalBranchInstructions.push_back("bleu");
+    conditionalBranchInstructions.push_back("bleu,a");
+    conditionalBranchInstructions.push_back("bcs");
+    conditionalBranchInstructions.push_back("bcs,a");
+    conditionalBranchInstructions.push_back("bneg");
+    conditionalBranchInstructions.push_back("bneg,a");
+    conditionalBranchInstructions.push_back("bvs");
+    conditionalBranchInstructions.push_back("bvs,a");
+    conditionalBranchInstructions.push_back("ba");
+    conditionalBranchInstructions.push_back("ba,a");
+    conditionalBranchInstructions.push_back("bne");
+    conditionalBranchInstructions.push_back("bne,a");
+    conditionalBranchInstructions.push_back("bg");
+    conditionalBranchInstructions.push_back("bg,a");
+    conditionalBranchInstructions.push_back("bge");
+    conditionalBranchInstructions.push_back("bge,a");
+    conditionalBranchInstructions.push_back("bgu");
+    conditionalBranchInstructions.push_back("bgu,a");
+    conditionalBranchInstructions.push_back("bcc");
+    conditionalBranchInstructions.push_back("bcc,a");
+    conditionalBranchInstructions.push_back("bpos");
+    conditionalBranchInstructions.push_back("bpos,a");
+    conditionalBranchInstructions.push_back("bvc");
+    conditionalBranchInstructions.push_back("bvc,a");
   
-    branchInstructions.sort();    
+    conditionalBranchInstructions.sort();    
   }
 
   Target_sparc::~Target_sparc()
-- 
2.27.0



More information about the devel mailing list