Deleted Added
sdiff udiff text old ( 3931:de791fa53d04 ) new ( 3978:739bc3a17929 )
full compact
1// Copyright (c) 2006-2007 The Regents of The University of Michigan
2// All rights reserved.
3//
4// Redistribution and use in source and binary forms, with or without
5// modification, are permitted provided that the following conditions are
6// met: redistributions of source code must retain the above copyright
7// notice, this list of conditions and the following disclaimer;
8// redistributions in binary form must reproduce the above copyright

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

184
185 void
186 SparcStaticInst::printReg(std::ostream &os, int reg) const
187 {
188 const int MaxGlobal = 8;
189 const int MaxOutput = 16;
190 const int MaxLocal = 24;
191 const int MaxInput = 32;
192 const int MaxMicroReg = 33;
193 if (reg == FramePointerReg)
194 ccprintf(os, "%%fp");
195 else if (reg == StackPointerReg)
196 ccprintf(os, "%%sp");
197 else if(reg < MaxGlobal)
198 ccprintf(os, "%%g%d", reg);
199 else if(reg < MaxOutput)
200 ccprintf(os, "%%o%d", reg - MaxGlobal);
201 else if(reg < MaxLocal)
202 ccprintf(os, "%%l%d", reg - MaxOutput);
203 else if(reg < MaxInput)
204 ccprintf(os, "%%i%d", reg - MaxLocal);
205 else if(reg < MaxMicroReg)
206 ccprintf(os, "%%u%d", reg - MaxInput);
207 else {
208 ccprintf(os, "%%f%d", reg - MaxMicroReg);
209 }
210 }
211
212 std::string SparcStaticInst::generateDisassembly(Addr pc,
213 const SymbolTable *symtab) const
214 {
215 std::stringstream ss;
216

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

285 case OverflowSet:
286 return condCodes.v;
287 }
288 panic("Tried testing condition nonexistant "
289 "condition code %d", condition);
290 }
291}};
292
293output exec {{
294 /// Check "FP enabled" machine status bit. Called when executing any FP
295 /// instruction in full-system mode.
296 /// @retval Full-system mode: NoFault if FP is enabled, FpDisabled
297 /// if not. Non-full-system mode: always returns NoFault.
298#if FULL_SYSTEM
299 inline Fault checkFpEnableFault(%(CPU_exec_context)s *xc)
300 {
301 Fault fault = NoFault; // dummy... this ipr access should not fault
302 if (xc->readMiscRegWithEffect(MISCREG_PSTATE) & PSTATE::pef &&
303 xc->readMiscRegWithEffect(MISCREG_FPRS) & 0x4)
304 return NoFault;
305 else
306 return new FpDisabled;
307 }
308#else
309 inline Fault checkFpEnableFault(%(CPU_exec_context)s *xc)
310 {
311 return NoFault;
312 }
313#endif
314}};
315
316