2 * Copyright 2017 Tilera Corporation. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
18 * Provide types and defines for the type that can hold a register,
19 * in the implementation namespace.
22 #ifndef __ARCH_INTREG_H__
23 #define __ARCH_INTREG_H__
26 * Get number of bits in a register. __INT_REG_BITS may be defined
27 * prior to including this header to force a particular bit width.
30 #ifndef __INT_REG_BITS
31 # if defined __tilegx__
32 # define __INT_REG_BITS 64
33 # elif defined __tilepro__
34 # define __INT_REG_BITS 32
36 # error Unrecognized architecture
40 #if __INT_REG_BITS == 64
42 # ifndef __ASSEMBLER__
43 /** Unsigned type that can hold a register. */
44 typedef unsigned long long __uint_reg_t;
46 /** Signed type that can hold a register. */
47 typedef long long __int_reg_t;
50 /** String prefix to use for printf(). */
51 # define __INT_REG_FMT "ll"
53 #elif __INT_REG_BITS == 32
55 # ifndef __ASSEMBLER__
56 /** Unsigned type that can hold a register. */
57 typedef unsigned long __uint_reg_t;
59 /** Signed type that can hold a register. */
60 typedef long __int_reg_t;
63 /** String prefix to use for printf(). */
64 # define __INT_REG_FMT "l"
67 # error Unrecognized value of __INT_REG_BITS
70 #endif /* !__ARCH_INTREG_H__ */