source: rtems-tools/tester/covoar/Target_sparc.cc @ 0c4884a

Last change on this file since 0c4884a was fcef37b, checked in by Joel Sherrill <joel@…>, on 04/06/21 at 20:24:08

covoar: Remove training white spaces

  • Property mode set to 100644
File size: 2.8 KB
Line 
1/*! @file Target_sparc.cc
2 *  @brief Target_sparc Implementation
3 *
4 *  This file contains the implementation of the base class for
5 *  functions supporting target unique functionallity.
6 */
7#include "Target_sparc.h"
8#include <stdio.h>
9#include <stdlib.h>
10#include <string.h>
11#include <unistd.h>
12
13namespace Target {
14
15  Target_sparc::Target_sparc( std::string targetName ):
16    TargetBase( targetName )
17  {
18    conditionalBranchInstructions.push_back("bn");
19    conditionalBranchInstructions.push_back("bn,a");
20    conditionalBranchInstructions.push_back("be");
21    conditionalBranchInstructions.push_back("be,a");
22    conditionalBranchInstructions.push_back("ble");
23    conditionalBranchInstructions.push_back("ble,a");
24    conditionalBranchInstructions.push_back("bl");
25    conditionalBranchInstructions.push_back("bl,a");
26    conditionalBranchInstructions.push_back("bleu");
27    conditionalBranchInstructions.push_back("bleu,a");
28    conditionalBranchInstructions.push_back("bcs");
29    conditionalBranchInstructions.push_back("bcs,a");
30    conditionalBranchInstructions.push_back("bneg");
31    conditionalBranchInstructions.push_back("bneg,a");
32    conditionalBranchInstructions.push_back("bvs");
33    conditionalBranchInstructions.push_back("bvs,a");
34    conditionalBranchInstructions.push_back("ba");
35    conditionalBranchInstructions.push_back("ba,a");
36    conditionalBranchInstructions.push_back("bne");
37    conditionalBranchInstructions.push_back("bne,a");
38    conditionalBranchInstructions.push_back("bg");
39    conditionalBranchInstructions.push_back("bg,a");
40    conditionalBranchInstructions.push_back("bge");
41    conditionalBranchInstructions.push_back("bge,a");
42    conditionalBranchInstructions.push_back("bgu");
43    conditionalBranchInstructions.push_back("bgu,a");
44    conditionalBranchInstructions.push_back("bcc");
45    conditionalBranchInstructions.push_back("bcc,a");
46    conditionalBranchInstructions.push_back("bpos");
47    conditionalBranchInstructions.push_back("bpos,a");
48    conditionalBranchInstructions.push_back("bvc");
49    conditionalBranchInstructions.push_back("bvc,a");
50
51    conditionalBranchInstructions.sort();
52  }
53
54  Target_sparc::~Target_sparc()
55  {
56  }
57
58  bool Target_sparc::isNopLine(
59    const char* const line,
60    int&              size
61  )
62  {
63    if (!strcmp( &line[strlen(line)-3], "nop")) {
64      size = 4;
65      return true;
66    }
67
68    if (!strcmp( &line[strlen(line)-7], "unknown")) {
69      size = 4;
70      return true;
71    }
72    #define GNU_LD_FILLS_ALIGNMENT_WITH_RTS
73    #if defined(GNU_LD_FILLS_ALIGNMENT_WITH_RTS)
74      // Until binutils 2.20, binutils would fill with rts not nop
75      if (!strcmp( &line[strlen(line)-3], "rts")) {
76        size = 4;
77        return true;
78      }
79    #endif
80
81    return false;
82  }
83
84
85  TargetBase *Target_sparc_Constructor(
86    std::string          targetName
87  )
88  {
89    return new Target_sparc( targetName );
90  }
91}
Note: See TracBrowser for help on using the repository browser.