Blame util_math.h

Packit Service 103f6b
/*
Packit Service 103f6b
 * Copyright 2014 Advanced Micro Devices, Inc.
Packit Service 103f6b
 *
Packit Service 103f6b
 * Permission is hereby granted, free of charge, to any person obtaining a
Packit Service 103f6b
 * copy of this software and associated documentation files (the "Software"),
Packit Service 103f6b
 * to deal in the Software without restriction, including without limitation
Packit Service 103f6b
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
Packit Service 103f6b
 * and/or sell copies of the Software, and to permit persons to whom the
Packit Service 103f6b
 * Software is furnished to do so, subject to the following conditions:
Packit Service 103f6b
 *
Packit Service 103f6b
 * The above copyright notice and this permission notice shall be included in
Packit Service 103f6b
 * all copies or substantial portions of the Software.
Packit Service 103f6b
 *
Packit Service 103f6b
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Packit Service 103f6b
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Packit Service 103f6b
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
Packit Service 103f6b
 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
Packit Service 103f6b
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
Packit Service 103f6b
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
Packit Service 103f6b
 * OTHER DEALINGS IN THE SOFTWARE.
Packit Service 103f6b
 *
Packit Service 103f6b
*/
Packit Service 103f6b
Packit Service 103f6b
#ifndef _UTIL_MATH_H_
Packit Service 103f6b
#define _UTIL_MATH_H_
Packit Service 103f6b
Packit Service 103f6b
#define MIN2( A, B )   ( (A)<(B) ? (A) : (B) )
Packit Service 103f6b
#define MAX2( A, B )   ( (A)>(B) ? (A) : (B) )
Packit Service 103f6b
#define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C))
Packit Service 103f6b
Packit Service 103f6b
#define __align_mask(value, mask)  (((value) + (mask)) & ~(mask))
Packit Service 103f6b
#define ALIGN(value, alignment)    __align_mask(value, (__typeof__(value))((alignment) - 1))
Packit Service 103f6b
Packit Service 103f6b
#endif /*_UTIL_MATH_H_*/