static_inst.cc (12104:edd63f9c6184) static_inst.cc (12106:7784fac1b159)
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
3 * Copyright (c) 2013 Advanced Micro Devices, Inc.
4 * All rights reserved.
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

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

127 {"", "%s", "%sx", "", "e%sx", "", "", "", "r%sx"};
128 static const char * piFormats[9] =
129 {"", "%s", "%s", "", "e%s", "", "", "", "r%s"};
130 static const char * longFormats[9] =
131 {"", "r%sb", "r%sw", "", "r%sd", "", "", "", "r%s"};
132 static const char * microFormats[9] =
133 {"", "t%db", "t%dw", "", "t%dd", "", "", "", "t%d"};
134
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
3 * Copyright (c) 2013 Advanced Micro Devices, Inc.
4 * All rights reserved.
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

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

127 {"", "%s", "%sx", "", "e%sx", "", "", "", "r%sx"};
128 static const char * piFormats[9] =
129 {"", "%s", "%s", "", "e%s", "", "", "", "r%s"};
130 static const char * longFormats[9] =
131 {"", "r%sb", "r%sw", "", "r%sd", "", "", "", "r%s"};
132 static const char * microFormats[9] =
133 {"", "t%db", "t%dw", "", "t%dd", "", "", "", "t%d"};
134
135 RegIndex reg_idx = reg.regIdx;
135 RegIndex reg_idx = reg.index();
136
136
137 switch (reg.regClass) {
138 case IntRegClass: {
137 if (reg.isIntReg()) {
139 const char * suffix = "";
140 bool fold = reg_idx & IntFoldBit;
141 reg_idx &= ~IntFoldBit;
142
143 if (fold)
144 suffix = "h";
145 else if (reg_idx < 8 && size == 1)
146 suffix = "l";

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

193 break;
194 case INTREG_R15W:
195 ccprintf(os, longFormats[size], "15");
196 break;
197 default:
198 ccprintf(os, microFormats[size], reg_idx - NUM_INTREGS);
199 }
200 ccprintf(os, suffix);
138 const char * suffix = "";
139 bool fold = reg_idx & IntFoldBit;
140 reg_idx &= ~IntFoldBit;
141
142 if (fold)
143 suffix = "h";
144 else if (reg_idx < 8 && size == 1)
145 suffix = "l";

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

192 break;
193 case INTREG_R15W:
194 ccprintf(os, longFormats[size], "15");
195 break;
196 default:
197 ccprintf(os, microFormats[size], reg_idx - NUM_INTREGS);
198 }
199 ccprintf(os, suffix);
201 break;
202 }
203
200
204 case FloatRegClass: {
201 } else if (reg.isFloatReg()) {
205 if (reg_idx < NumMMXRegs) {
206 ccprintf(os, "%%mmx%d", reg_idx);
207 return;
208 }
209 reg_idx -= NumMMXRegs;
210 if (reg_idx < NumXMMRegs * 2) {
211 ccprintf(os, "%%xmm%d_%s", reg_idx / 2,
212 (reg_idx % 2) ? "high": "low");
213 return;
214 }
215 reg_idx -= NumXMMRegs * 2;
216 if (reg_idx < NumMicroFpRegs) {
217 ccprintf(os, "%%ufp%d", reg_idx);
218 return;
219 }
220 reg_idx -= NumMicroFpRegs;
221 ccprintf(os, "%%st(%d)", reg_idx);
202 if (reg_idx < NumMMXRegs) {
203 ccprintf(os, "%%mmx%d", reg_idx);
204 return;
205 }
206 reg_idx -= NumMMXRegs;
207 if (reg_idx < NumXMMRegs * 2) {
208 ccprintf(os, "%%xmm%d_%s", reg_idx / 2,
209 (reg_idx % 2) ? "high": "low");
210 return;
211 }
212 reg_idx -= NumXMMRegs * 2;
213 if (reg_idx < NumMicroFpRegs) {
214 ccprintf(os, "%%ufp%d", reg_idx);
215 return;
216 }
217 reg_idx -= NumMicroFpRegs;
218 ccprintf(os, "%%st(%d)", reg_idx);
222 break;
223 }
224
219
225 case CCRegClass:
220 } else if (reg.isCCReg()) {
226 ccprintf(os, "%%cc%d", reg_idx);
221 ccprintf(os, "%%cc%d", reg_idx);
227 break;
228
222
229 case MiscRegClass:
223 } else if (reg.isMiscReg()) {
230 switch (reg_idx) {
231 default:
232 ccprintf(os, "%%ctrl%d", reg_idx);
233 }
224 switch (reg_idx) {
225 default:
226 ccprintf(os, "%%ctrl%d", reg_idx);
227 }
234 break;
235 }
236 }
237
238 void X86StaticInst::printMem(std::ostream &os, uint8_t segment,
239 uint8_t scale, RegIndex index, RegIndex base,
240 uint64_t disp, uint8_t addressSize, bool rip) const
241 {
242 bool someAddr = false;

--- 43 unchanged lines hidden ---
228 }
229 }
230
231 void X86StaticInst::printMem(std::ostream &os, uint8_t segment,
232 uint8_t scale, RegIndex index, RegIndex base,
233 uint64_t disp, uint8_t addressSize, bool rip) const
234 {
235 bool someAddr = false;

--- 43 unchanged lines hidden ---