xref: /dflybsd-src/contrib/gdb-7/gdb/common/i386-xstate.h (revision de8e141f24382815c10a4012d209bbbf7abf1112)
1cf7f2e2dSJohn Marino /* Common code for i386 XSAVE extended state.
2cf7f2e2dSJohn Marino 
3*ef5ccd6cSJohn Marino    Copyright (C) 2010-2013 Free Software Foundation, Inc.
4cf7f2e2dSJohn Marino 
5cf7f2e2dSJohn Marino    This file is part of GDB.
6cf7f2e2dSJohn Marino 
7cf7f2e2dSJohn Marino    This program is free software; you can redistribute it and/or modify
8cf7f2e2dSJohn Marino    it under the terms of the GNU General Public License as published by
9cf7f2e2dSJohn Marino    the Free Software Foundation; either version 3 of the License, or
10cf7f2e2dSJohn Marino    (at your option) any later version.
11cf7f2e2dSJohn Marino 
12cf7f2e2dSJohn Marino    This program is distributed in the hope that it will be useful,
13cf7f2e2dSJohn Marino    but WITHOUT ANY WARRANTY; without even the implied warranty of
14cf7f2e2dSJohn Marino    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15cf7f2e2dSJohn Marino    GNU General Public License for more details.
16cf7f2e2dSJohn Marino 
17cf7f2e2dSJohn Marino    You should have received a copy of the GNU General Public License
18cf7f2e2dSJohn Marino    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19cf7f2e2dSJohn Marino 
20cf7f2e2dSJohn Marino #ifndef I386_XSTATE_H
21cf7f2e2dSJohn Marino #define I386_XSTATE_H 1
22cf7f2e2dSJohn Marino 
23cf7f2e2dSJohn Marino /* The extended state feature bits.  */
24cf7f2e2dSJohn Marino #define I386_XSTATE_X87		(1ULL << 0)
25cf7f2e2dSJohn Marino #define I386_XSTATE_SSE		(1ULL << 1)
26cf7f2e2dSJohn Marino #define I386_XSTATE_AVX		(1ULL << 2)
27cf7f2e2dSJohn Marino 
28cf7f2e2dSJohn Marino /* Supported mask and size of the extended state.  */
29cf7f2e2dSJohn Marino #define I386_XSTATE_X87_MASK	I386_XSTATE_X87
30cf7f2e2dSJohn Marino #define I386_XSTATE_SSE_MASK	(I386_XSTATE_X87 | I386_XSTATE_SSE)
31cf7f2e2dSJohn Marino #define I386_XSTATE_AVX_MASK	(I386_XSTATE_SSE_MASK | I386_XSTATE_AVX)
32cf7f2e2dSJohn Marino 
33cf7f2e2dSJohn Marino #define I386_XSTATE_SSE_SIZE	576
34cf7f2e2dSJohn Marino #define I386_XSTATE_AVX_SIZE	832
35cf7f2e2dSJohn Marino #define I386_XSTATE_MAX_SIZE	832
36cf7f2e2dSJohn Marino 
37cf7f2e2dSJohn Marino /* Get I386 XSAVE extended state size.  */
38cf7f2e2dSJohn Marino #define I386_XSTATE_SIZE(XCR0)	\
39cf7f2e2dSJohn Marino   (((XCR0) & I386_XSTATE_AVX) != 0 \
40cf7f2e2dSJohn Marino    ? I386_XSTATE_AVX_SIZE : I386_XSTATE_SSE_SIZE)
41cf7f2e2dSJohn Marino 
42cf7f2e2dSJohn Marino #endif /* I386_XSTATE_H */
43