types.hh (13385:5295c5bf5fa6) types.hh (13446:4d742ab7b70f)
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

163 return MicroPCRomBit & upc;
164}
165
166const Addr MaxAddr = (Addr)-1;
167
168typedef uint64_t RegVal;
169typedef double FloatRegVal;
170
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

163 return MicroPCRomBit & upc;
164}
165
166const Addr MaxAddr = (Addr)-1;
167
168typedef uint64_t RegVal;
169typedef double FloatRegVal;
170
171static inline uint32_t
172floatToBits32(float val)
173{
174 union
175 {
176 float f;
177 uint32_t i;
178 } u;
179 u.f = val;
180 return u.i;
181}
182
183static inline uint64_t
184floatToBits64(double val)
185{
186 union
187 {
188 double f;
189 uint64_t i;
190 } u;
191 u.f = val;
192 return u.i;
193}
194
195static inline uint64_t floatToBits(double val) { return floatToBits64(val); }
196static inline uint32_t floatToBits(float val) { return floatToBits32(val); }
197
198static inline float
199bitsToFloat32(uint32_t val)
200{
201 union
202 {
203 float f;
204 uint32_t i;
205 } u;
206 u.i = val;
207 return u.f;
208}
209
210static inline double
211bitsToFloat64(uint64_t val)
212{
213 union
214 {
215 double f;
216 uint64_t i;
217 } u;
218 u.i = val;
219 return u.f;
220}
221
222static inline double bitsToFloat(uint64_t val) { return bitsToFloat64(val); }
223static inline float bitsToFloat(uint32_t val) { return bitsToFloat32(val); }
224
171/**
172 * Thread index/ID type
173 */
174typedef int16_t ThreadID;
175const ThreadID InvalidThreadID = (ThreadID)-1;
176
177/** Globally unique thread context ID */
178typedef int ContextID;

--- 36 unchanged lines hidden ---
225/**
226 * Thread index/ID type
227 */
228typedef int16_t ThreadID;
229const ThreadID InvalidThreadID = (ThreadID)-1;
230
231/** Globally unique thread context ID */
232typedef int ContextID;

--- 36 unchanged lines hidden ---