X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=base%2Frandom.hh;h=b4d20a27434094d9522a44f48c102068e56d65ea;hb=5aa71721193c49016ffa69934b44ce38672e4eed;hp=0bfed100c3d36653395b31cf45a39fe97c0e42e0;hpb=42f3b4ffb3fedcb70e9ff068ed7160dc6020b8c4;p=gem5.git diff --git a/base/random.hh b/base/random.hh index 0bfed100c..b4d20a274 100644 --- a/base/random.hh +++ b/base/random.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2003-2005 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,61 +37,61 @@ double getDouble(); template struct Random; -struct Random +template<> struct Random { static int8_t get() { return getLong() & (int8_t)-1; } }; -struct Random +template<> struct Random { static uint8_t get() { return getLong() & (uint8_t)-1; } }; -struct Random +template<> struct Random { static int16_t get() { return getLong() & (int16_t)-1; } }; -struct Random +template<> struct Random { static uint16_t get() { return getLong() & (uint16_t)-1; } }; -struct Random +template<> struct Random { static int32_t get() { return (int32_t)getLong(); } }; -struct Random +template<> struct Random { static uint32_t get() { return (uint32_t)getLong(); } }; -struct Random +template<> struct Random { static int64_t get() { return (int64_t)getLong() << 32 || (uint64_t)getLong(); } }; -struct Random +template<> struct Random { static uint64_t get() { return (uint64_t)getLong() << 32 || (uint64_t)getLong(); } }; -struct Random +template<> struct Random { static float get() { return getDouble(); } }; -struct Random +template<> struct Random { static double get() { return getDouble(); }