/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/Sparc/Sparc.h
Line | Count | Source (jump to first uncovered line) |
1 | | //===-- Sparc.h - Top-level interface for Sparc representation --*- C++ -*-===// |
2 | | // |
3 | | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | | // See https://llvm.org/LICENSE.txt for license information. |
5 | | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | | // |
7 | | //===----------------------------------------------------------------------===// |
8 | | // |
9 | | // This file contains the entry points for global functions defined in the LLVM |
10 | | // Sparc back-end. |
11 | | // |
12 | | //===----------------------------------------------------------------------===// |
13 | | |
14 | | #ifndef LLVM_LIB_TARGET_SPARC_SPARC_H |
15 | | #define LLVM_LIB_TARGET_SPARC_SPARC_H |
16 | | |
17 | | #include "MCTargetDesc/SparcMCTargetDesc.h" |
18 | | #include "llvm/Support/ErrorHandling.h" |
19 | | #include "llvm/Target/TargetMachine.h" |
20 | | |
21 | | namespace llvm { |
22 | | class FunctionPass; |
23 | | class SparcTargetMachine; |
24 | | class formatted_raw_ostream; |
25 | | class AsmPrinter; |
26 | | class MCInst; |
27 | | class MachineInstr; |
28 | | |
29 | | FunctionPass *createSparcISelDag(SparcTargetMachine &TM); |
30 | | FunctionPass *createSparcDelaySlotFillerPass(); |
31 | | |
32 | | void LowerSparcMachineInstrToMCInst(const MachineInstr *MI, |
33 | | MCInst &OutMI, |
34 | | AsmPrinter &AP); |
35 | | } // end namespace llvm; |
36 | | |
37 | | namespace llvm { |
38 | | // Enums corresponding to Sparc condition codes, both icc's and fcc's. These |
39 | | // values must be kept in sync with the ones in the .td file. |
40 | | namespace SPCC { |
41 | | enum CondCodes { |
42 | | ICC_A = 8 , // Always |
43 | | ICC_N = 0 , // Never |
44 | | ICC_NE = 9 , // Not Equal |
45 | | ICC_E = 1 , // Equal |
46 | | ICC_G = 10 , // Greater |
47 | | ICC_LE = 2 , // Less or Equal |
48 | | ICC_GE = 11 , // Greater or Equal |
49 | | ICC_L = 3 , // Less |
50 | | ICC_GU = 12 , // Greater Unsigned |
51 | | ICC_LEU = 4 , // Less or Equal Unsigned |
52 | | ICC_CC = 13 , // Carry Clear/Great or Equal Unsigned |
53 | | ICC_CS = 5 , // Carry Set/Less Unsigned |
54 | | ICC_POS = 14 , // Positive |
55 | | ICC_NEG = 6 , // Negative |
56 | | ICC_VC = 15 , // Overflow Clear |
57 | | ICC_VS = 7 , // Overflow Set |
58 | | |
59 | | FCC_A = 8+16, // Always |
60 | | FCC_N = 0+16, // Never |
61 | | FCC_U = 7+16, // Unordered |
62 | | FCC_G = 6+16, // Greater |
63 | | FCC_UG = 5+16, // Unordered or Greater |
64 | | FCC_L = 4+16, // Less |
65 | | FCC_UL = 3+16, // Unordered or Less |
66 | | FCC_LG = 2+16, // Less or Greater |
67 | | FCC_NE = 1+16, // Not Equal |
68 | | FCC_E = 9+16, // Equal |
69 | | FCC_UE = 10+16, // Unordered or Equal |
70 | | FCC_GE = 11+16, // Greater or Equal |
71 | | FCC_UGE = 12+16, // Unordered or Greater or Equal |
72 | | FCC_LE = 13+16, // Less or Equal |
73 | | FCC_ULE = 14+16, // Unordered or Less or Equal |
74 | | FCC_O = 15+16, // Ordered |
75 | | |
76 | | CPCC_A = 8+32, // Always |
77 | | CPCC_N = 0+32, // Never |
78 | | CPCC_3 = 7+32, |
79 | | CPCC_2 = 6+32, |
80 | | CPCC_23 = 5+32, |
81 | | CPCC_1 = 4+32, |
82 | | CPCC_13 = 3+32, |
83 | | CPCC_12 = 2+32, |
84 | | CPCC_123 = 1+32, |
85 | | CPCC_0 = 9+32, |
86 | | CPCC_03 = 10+32, |
87 | | CPCC_02 = 11+32, |
88 | | CPCC_023 = 12+32, |
89 | | CPCC_01 = 13+32, |
90 | | CPCC_013 = 14+32, |
91 | | CPCC_012 = 15+32 |
92 | | }; |
93 | | } |
94 | | |
95 | 382 | inline static const char *SPARCCondCodeToString(SPCC::CondCodes CC) { |
96 | 382 | switch (CC) { |
97 | 382 | case SPCC::ICC_A: return "a"0 ; |
98 | 382 | case SPCC::ICC_N: return "n"0 ; |
99 | 382 | case SPCC::ICC_NE: return "ne"9 ; |
100 | 382 | case SPCC::ICC_E: return "e"9 ; |
101 | 382 | case SPCC::ICC_G: return "g"7 ; |
102 | 382 | case SPCC::ICC_LE: return "le"7 ; |
103 | 382 | case SPCC::ICC_GE: return "ge"7 ; |
104 | 382 | case SPCC::ICC_L: return "l"7 ; |
105 | 382 | case SPCC::ICC_GU: return "gu"8 ; |
106 | 382 | case SPCC::ICC_LEU: return "leu"7 ; |
107 | 382 | case SPCC::ICC_CC: return "cc"7 ; |
108 | 382 | case SPCC::ICC_CS: return "cs"7 ; |
109 | 382 | case SPCC::ICC_POS: return "pos"7 ; |
110 | 382 | case SPCC::ICC_NEG: return "neg"5 ; |
111 | 382 | case SPCC::ICC_VC: return "vc"5 ; |
112 | 382 | case SPCC::ICC_VS: return "vs"5 ; |
113 | 382 | case SPCC::FCC_A: return "a"6 ; |
114 | 382 | case SPCC::FCC_N: return "n"3 ; |
115 | 382 | case SPCC::FCC_U: return "u"10 ; |
116 | 382 | case SPCC::FCC_G: return "g"9 ; |
117 | 382 | case SPCC::FCC_UG: return "ug"10 ; |
118 | 382 | case SPCC::FCC_L: return "l"26 ; |
119 | 382 | case SPCC::FCC_UL: return "ul"12 ; |
120 | 382 | case SPCC::FCC_LG: return "lg"9 ; |
121 | 382 | case SPCC::FCC_NE: return "ne"20 ; |
122 | 382 | case SPCC::FCC_E: return "e"11 ; |
123 | 382 | case SPCC::FCC_UE: return "ue"9 ; |
124 | 382 | case SPCC::FCC_GE: return "ge"9 ; |
125 | 382 | case SPCC::FCC_UGE: return "uge"12 ; |
126 | 382 | case SPCC::FCC_LE: return "le"9 ; |
127 | 382 | case SPCC::FCC_ULE: return "ule"14 ; |
128 | 382 | case SPCC::FCC_O: return "o"11 ; |
129 | 382 | case SPCC::CPCC_A: return "a"5 ; |
130 | 382 | case SPCC::CPCC_N: return "n"3 ; |
131 | 382 | case SPCC::CPCC_3: return "3"7 ; |
132 | 382 | case SPCC::CPCC_2: return "2"7 ; |
133 | 382 | case SPCC::CPCC_23: return "23"7 ; |
134 | 382 | case SPCC::CPCC_1: return "1"7 ; |
135 | 382 | case SPCC::CPCC_13: return "13"7 ; |
136 | 382 | case SPCC::CPCC_12: return "12"7 ; |
137 | 382 | case SPCC::CPCC_123: return "123"7 ; |
138 | 382 | case SPCC::CPCC_0: return "0"6 ; |
139 | 382 | case SPCC::CPCC_03: return "03"7 ; |
140 | 382 | case SPCC::CPCC_02: return "02"7 ; |
141 | 382 | case SPCC::CPCC_023: return "023"7 ; |
142 | 382 | case SPCC::CPCC_01: return "01"7 ; |
143 | 382 | case SPCC::CPCC_013: return "013"7 ; |
144 | 382 | case SPCC::CPCC_012: return "012"7 ; |
145 | 0 | } |
146 | 0 | llvm_unreachable("Invalid cond code"); |
147 | 0 | } Unexecuted instantiation: DelaySlotFiller.cpp:llvm::SPARCCondCodeToString(llvm::SPCC::CondCodes) Unexecuted instantiation: LeonPasses.cpp:llvm::SPARCCondCodeToString(llvm::SPCC::CondCodes) Unexecuted instantiation: SparcAsmPrinter.cpp:llvm::SPARCCondCodeToString(llvm::SPCC::CondCodes) Unexecuted instantiation: SparcInstrInfo.cpp:llvm::SPARCCondCodeToString(llvm::SPCC::CondCodes) Unexecuted instantiation: SparcISelDAGToDAG.cpp:llvm::SPARCCondCodeToString(llvm::SPCC::CondCodes) Unexecuted instantiation: SparcISelLowering.cpp:llvm::SPARCCondCodeToString(llvm::SPCC::CondCodes) Unexecuted instantiation: SparcFrameLowering.cpp:llvm::SPARCCondCodeToString(llvm::SPCC::CondCodes) Unexecuted instantiation: SparcRegisterInfo.cpp:llvm::SPARCCondCodeToString(llvm::SPCC::CondCodes) Unexecuted instantiation: SparcSubtarget.cpp:llvm::SPARCCondCodeToString(llvm::SPCC::CondCodes) Unexecuted instantiation: SparcTargetMachine.cpp:llvm::SPARCCondCodeToString(llvm::SPCC::CondCodes) Unexecuted instantiation: SparcMCInstLower.cpp:llvm::SPARCCondCodeToString(llvm::SPCC::CondCodes) SparcInstPrinter.cpp:llvm::SPARCCondCodeToString(llvm::SPCC::CondCodes) Line | Count | Source | 95 | 382 | inline static const char *SPARCCondCodeToString(SPCC::CondCodes CC) { | 96 | 382 | switch (CC) { | 97 | 382 | case SPCC::ICC_A: return "a"0 ; | 98 | 382 | case SPCC::ICC_N: return "n"0 ; | 99 | 382 | case SPCC::ICC_NE: return "ne"9 ; | 100 | 382 | case SPCC::ICC_E: return "e"9 ; | 101 | 382 | case SPCC::ICC_G: return "g"7 ; | 102 | 382 | case SPCC::ICC_LE: return "le"7 ; | 103 | 382 | case SPCC::ICC_GE: return "ge"7 ; | 104 | 382 | case SPCC::ICC_L: return "l"7 ; | 105 | 382 | case SPCC::ICC_GU: return "gu"8 ; | 106 | 382 | case SPCC::ICC_LEU: return "leu"7 ; | 107 | 382 | case SPCC::ICC_CC: return "cc"7 ; | 108 | 382 | case SPCC::ICC_CS: return "cs"7 ; | 109 | 382 | case SPCC::ICC_POS: return "pos"7 ; | 110 | 382 | case SPCC::ICC_NEG: return "neg"5 ; | 111 | 382 | case SPCC::ICC_VC: return "vc"5 ; | 112 | 382 | case SPCC::ICC_VS: return "vs"5 ; | 113 | 382 | case SPCC::FCC_A: return "a"6 ; | 114 | 382 | case SPCC::FCC_N: return "n"3 ; | 115 | 382 | case SPCC::FCC_U: return "u"10 ; | 116 | 382 | case SPCC::FCC_G: return "g"9 ; | 117 | 382 | case SPCC::FCC_UG: return "ug"10 ; | 118 | 382 | case SPCC::FCC_L: return "l"26 ; | 119 | 382 | case SPCC::FCC_UL: return "ul"12 ; | 120 | 382 | case SPCC::FCC_LG: return "lg"9 ; | 121 | 382 | case SPCC::FCC_NE: return "ne"20 ; | 122 | 382 | case SPCC::FCC_E: return "e"11 ; | 123 | 382 | case SPCC::FCC_UE: return "ue"9 ; | 124 | 382 | case SPCC::FCC_GE: return "ge"9 ; | 125 | 382 | case SPCC::FCC_UGE: return "uge"12 ; | 126 | 382 | case SPCC::FCC_LE: return "le"9 ; | 127 | 382 | case SPCC::FCC_ULE: return "ule"14 ; | 128 | 382 | case SPCC::FCC_O: return "o"11 ; | 129 | 382 | case SPCC::CPCC_A: return "a"5 ; | 130 | 382 | case SPCC::CPCC_N: return "n"3 ; | 131 | 382 | case SPCC::CPCC_3: return "3"7 ; | 132 | 382 | case SPCC::CPCC_2: return "2"7 ; | 133 | 382 | case SPCC::CPCC_23: return "23"7 ; | 134 | 382 | case SPCC::CPCC_1: return "1"7 ; | 135 | 382 | case SPCC::CPCC_13: return "13"7 ; | 136 | 382 | case SPCC::CPCC_12: return "12"7 ; | 137 | 382 | case SPCC::CPCC_123: return "123"7 ; | 138 | 382 | case SPCC::CPCC_0: return "0"6 ; | 139 | 382 | case SPCC::CPCC_03: return "03"7 ; | 140 | 382 | case SPCC::CPCC_02: return "02"7 ; | 141 | 382 | case SPCC::CPCC_023: return "023"7 ; | 142 | 382 | case SPCC::CPCC_01: return "01"7 ; | 143 | 382 | case SPCC::CPCC_013: return "013"7 ; | 144 | 382 | case SPCC::CPCC_012: return "012"7 ; | 145 | 0 | } | 146 | 0 | llvm_unreachable("Invalid cond code"); | 147 | 0 | } |
|
148 | | |
149 | 24 | inline static unsigned HI22(int64_t imm) { |
150 | 24 | return (unsigned)((imm >> 10) & ((1 << 22)-1)); |
151 | 24 | } Unexecuted instantiation: DelaySlotFiller.cpp:llvm::HI22(long long) Unexecuted instantiation: LeonPasses.cpp:llvm::HI22(long long) Unexecuted instantiation: SparcAsmPrinter.cpp:llvm::HI22(long long) Unexecuted instantiation: SparcInstrInfo.cpp:llvm::HI22(long long) Unexecuted instantiation: SparcISelDAGToDAG.cpp:llvm::HI22(long long) Unexecuted instantiation: SparcISelLowering.cpp:llvm::HI22(long long) SparcFrameLowering.cpp:llvm::HI22(long long) Line | Count | Source | 149 | 6 | inline static unsigned HI22(int64_t imm) { | 150 | 6 | return (unsigned)((imm >> 10) & ((1 << 22)-1)); | 151 | 6 | } |
SparcRegisterInfo.cpp:llvm::HI22(long long) Line | Count | Source | 149 | 18 | inline static unsigned HI22(int64_t imm) { | 150 | 18 | return (unsigned)((imm >> 10) & ((1 << 22)-1)); | 151 | 18 | } |
Unexecuted instantiation: SparcSubtarget.cpp:llvm::HI22(long long) Unexecuted instantiation: SparcTargetMachine.cpp:llvm::HI22(long long) Unexecuted instantiation: SparcMCInstLower.cpp:llvm::HI22(long long) Unexecuted instantiation: SparcInstPrinter.cpp:llvm::HI22(long long) |
152 | | |
153 | 24 | inline static unsigned LO10(int64_t imm) { |
154 | 24 | return (unsigned)(imm & 0x3FF); |
155 | 24 | } Unexecuted instantiation: DelaySlotFiller.cpp:llvm::LO10(long long) Unexecuted instantiation: LeonPasses.cpp:llvm::LO10(long long) Unexecuted instantiation: SparcAsmPrinter.cpp:llvm::LO10(long long) Unexecuted instantiation: SparcInstrInfo.cpp:llvm::LO10(long long) Unexecuted instantiation: SparcISelDAGToDAG.cpp:llvm::LO10(long long) Unexecuted instantiation: SparcISelLowering.cpp:llvm::LO10(long long) SparcFrameLowering.cpp:llvm::LO10(long long) Line | Count | Source | 153 | 6 | inline static unsigned LO10(int64_t imm) { | 154 | 6 | return (unsigned)(imm & 0x3FF); | 155 | 6 | } |
SparcRegisterInfo.cpp:llvm::LO10(long long) Line | Count | Source | 153 | 18 | inline static unsigned LO10(int64_t imm) { | 154 | 18 | return (unsigned)(imm & 0x3FF); | 155 | 18 | } |
Unexecuted instantiation: SparcSubtarget.cpp:llvm::LO10(long long) Unexecuted instantiation: SparcTargetMachine.cpp:llvm::LO10(long long) Unexecuted instantiation: SparcMCInstLower.cpp:llvm::LO10(long long) Unexecuted instantiation: SparcInstPrinter.cpp:llvm::LO10(long long) |
156 | | |
157 | 8 | inline static unsigned HIX22(int64_t imm) { |
158 | 8 | return HI22(~imm); |
159 | 8 | } Unexecuted instantiation: DelaySlotFiller.cpp:llvm::HIX22(long long) Unexecuted instantiation: LeonPasses.cpp:llvm::HIX22(long long) Unexecuted instantiation: SparcAsmPrinter.cpp:llvm::HIX22(long long) Unexecuted instantiation: SparcInstrInfo.cpp:llvm::HIX22(long long) Unexecuted instantiation: SparcISelDAGToDAG.cpp:llvm::HIX22(long long) Unexecuted instantiation: SparcISelLowering.cpp:llvm::HIX22(long long) SparcFrameLowering.cpp:llvm::HIX22(long long) Line | Count | Source | 157 | 6 | inline static unsigned HIX22(int64_t imm) { | 158 | 6 | return HI22(~imm); | 159 | 6 | } |
SparcRegisterInfo.cpp:llvm::HIX22(long long) Line | Count | Source | 157 | 2 | inline static unsigned HIX22(int64_t imm) { | 158 | 2 | return HI22(~imm); | 159 | 2 | } |
Unexecuted instantiation: SparcSubtarget.cpp:llvm::HIX22(long long) Unexecuted instantiation: SparcTargetMachine.cpp:llvm::HIX22(long long) Unexecuted instantiation: SparcMCInstLower.cpp:llvm::HIX22(long long) Unexecuted instantiation: SparcInstPrinter.cpp:llvm::HIX22(long long) |
160 | | |
161 | 8 | inline static unsigned LOX10(int64_t imm) { |
162 | 8 | return ~LO10(~imm); |
163 | 8 | } Unexecuted instantiation: DelaySlotFiller.cpp:llvm::LOX10(long long) Unexecuted instantiation: LeonPasses.cpp:llvm::LOX10(long long) Unexecuted instantiation: SparcAsmPrinter.cpp:llvm::LOX10(long long) Unexecuted instantiation: SparcInstrInfo.cpp:llvm::LOX10(long long) Unexecuted instantiation: SparcISelDAGToDAG.cpp:llvm::LOX10(long long) Unexecuted instantiation: SparcISelLowering.cpp:llvm::LOX10(long long) SparcFrameLowering.cpp:llvm::LOX10(long long) Line | Count | Source | 161 | 6 | inline static unsigned LOX10(int64_t imm) { | 162 | 6 | return ~LO10(~imm); | 163 | 6 | } |
SparcRegisterInfo.cpp:llvm::LOX10(long long) Line | Count | Source | 161 | 2 | inline static unsigned LOX10(int64_t imm) { | 162 | 2 | return ~LO10(~imm); | 163 | 2 | } |
Unexecuted instantiation: SparcSubtarget.cpp:llvm::LOX10(long long) Unexecuted instantiation: SparcTargetMachine.cpp:llvm::LOX10(long long) Unexecuted instantiation: SparcMCInstLower.cpp:llvm::LOX10(long long) Unexecuted instantiation: SparcInstPrinter.cpp:llvm::LOX10(long long) |
164 | | |
165 | | } // end namespace llvm |
166 | | #endif |