intmath.hh (7584:28ddf6d9e982) intmath.hh (9091:9b29b9a4dda6)
1/*
2 * Copyright (c) 2001, 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;

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

188
189template <class T>
190inline T
191ceilPow2(T n)
192{
193 return (T)1 << ceilLog2(n);
194}
195
1/*
2 * Copyright (c) 2001, 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;

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

188
189template <class T>
190inline T
191ceilPow2(T n)
192{
193 return (T)1 << ceilLog2(n);
194}
195
196template
196template <class T, class U>
197inline T
197inline T
198divCeil(T a, T b)
198divCeil(const T& a, const U& b)
199{
200 return (a + b - 1) / b;
201}
202
203template <class T>
204inline T
205roundUp(T val, int align)
206{

--- 48 unchanged lines hidden ---
199{
200 return (a + b - 1) / b;
201}
202
203template <class T>
204inline T
205roundUp(T val, int align)
206{

--- 48 unchanged lines hidden ---