static_inst.hh (7424:f5d721ddb509) static_inst.hh (7639:8c09b7ff5b57)
1/*
2 * Copyright (c) 2010 ARM Limited
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

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

246 {
247 if (big) {
248 return gtobe(val);
249 } else {
250 return gtole(val);
251 }
252 }
253
1/*
2 * Copyright (c) 2010 ARM Limited
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

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

246 {
247 if (big) {
248 return gtobe(val);
249 } else {
250 return gtole(val);
251 }
252 }
253
254 template<class T, class E>
255 static inline T
256 cSwap(T val, bool big)
257 {
258 const unsigned count = sizeof(T) / sizeof(E);
259 union {
260 T tVal;
261 E eVals[count];
262 } conv;
263 conv.tVal = htog(val);
264 if (big) {
265 for (unsigned i = 0; i < count; i++) {
266 conv.eVals[i] = gtobe(conv.eVals[i]);
267 }
268 } else {
269 for (unsigned i = 0; i < count; i++) {
270 conv.eVals[i] = gtole(conv.eVals[i]);
271 }
272 }
273 return gtoh(conv.tVal);
274 }
275
254 // Perform an interworking branch.
255 template<class XC>
256 static inline void
257 setIWNextPC(XC *xc, Addr val)
258 {
259 Addr stateBits = xc->readPC() & PcModeMask;
260 Addr jBit = (ULL(1) << PcJBitShift);
261 Addr tBit = (ULL(1) << PcTBitShift);

--- 42 unchanged lines hidden ---
276 // Perform an interworking branch.
277 template<class XC>
278 static inline void
279 setIWNextPC(XC *xc, Addr val)
280 {
281 Addr stateBits = xc->readPC() & PcModeMask;
282 Addr jBit = (ULL(1) << PcJBitShift);
283 Addr tBit = (ULL(1) << PcTBitShift);

--- 42 unchanged lines hidden ---