Deleted Added
sdiff udiff text old ( 7629:0f0c231e3e97 ) new ( 9913:7f43babfde6a )
full compact
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

--- 23 unchanged lines hidden (view full) ---

34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 *
37 * Authors: Gabe Black
38 */
39
40#include "arch/x86/insts/static_inst.hh"
41#include "arch/x86/regs/segment.hh"
42
43namespace X86ISA
44{
45 void X86StaticInst::printMnemonic(std::ostream &os,
46 const char * mnemonic) const
47 {
48 ccprintf(os, " %s ", mnemonic);
49 }

--- 74 unchanged lines hidden (view full) ---

124 {"", "%s", "%sx", "", "e%sx", "", "", "", "r%sx"};
125 static const char * piFormats[9] =
126 {"", "%s", "%s", "", "e%s", "", "", "", "r%s"};
127 static const char * longFormats[9] =
128 {"", "r%sb", "r%sw", "", "r%sd", "", "", "", "r%s"};
129 static const char * microFormats[9] =
130 {"", "t%db", "t%dw", "", "t%dd", "", "", "", "t%d"};
131
132 if (reg < FP_Base_DepTag) {
133 const char * suffix = "";
134 bool fold = reg & IntFoldBit;
135 reg &= ~IntFoldBit;
136
137 if(fold)
138 suffix = "h";
139 else if(reg < 8 && size == 1)
140 suffix = "l";
141
142 switch (reg) {
143 case INTREG_RAX:
144 ccprintf(os, abcdFormats[size], "a");
145 break;
146 case INTREG_RBX:
147 ccprintf(os, abcdFormats[size], "b");
148 break;
149 case INTREG_RCX:
150 ccprintf(os, abcdFormats[size], "c");

--- 33 unchanged lines hidden (view full) ---

184 break;
185 case INTREG_R14W:
186 ccprintf(os, longFormats[size], "14");
187 break;
188 case INTREG_R15W:
189 ccprintf(os, longFormats[size], "15");
190 break;
191 default:
192 ccprintf(os, microFormats[size], reg - NUM_INTREGS);
193 }
194 ccprintf(os, suffix);
195 } else if (reg < Ctrl_Base_DepTag) {
196 int fpindex = reg - FP_Base_DepTag;
197 if(fpindex < NumMMXRegs) {
198 ccprintf(os, "%%mmx%d", reg - FP_Base_DepTag);
199 return;
200 }
201 fpindex -= NumMMXRegs;
202 if(fpindex < NumXMMRegs * 2) {
203 ccprintf(os, "%%xmm%d_%s", fpindex / 2,
204 (fpindex % 2) ? "high": "low");
205 return;
206 }
207 fpindex -= NumXMMRegs * 2;
208 if(fpindex < NumMicroFpRegs) {
209 ccprintf(os, "%%ufp%d", fpindex);
210 return;
211 }
212 fpindex -= NumMicroFpRegs;
213 ccprintf(os, "%%st(%d)", fpindex);
214 } else {
215 switch (reg - Ctrl_Base_DepTag) {
216 default:
217 ccprintf(os, "%%ctrl%d", reg - Ctrl_Base_DepTag);
218 }
219 }
220 }
221
222 void X86StaticInst::printMem(std::ostream &os, uint8_t segment,
223 uint8_t scale, RegIndex index, RegIndex base,
224 uint64_t disp, uint8_t addressSize, bool rip) const
225 {
226 bool someAddr = false;

--- 43 unchanged lines hidden ---