xref: /dflybsd-src/contrib/gdb-7/gdb/features/i386/x32.c (revision de8e141f24382815c10a4012d209bbbf7abf1112)
1*ef5ccd6cSJohn Marino /* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
2*ef5ccd6cSJohn Marino   Original: x32.xml */
3*ef5ccd6cSJohn Marino 
4*ef5ccd6cSJohn Marino #include "defs.h"
5*ef5ccd6cSJohn Marino #include "osabi.h"
6*ef5ccd6cSJohn Marino #include "target-descriptions.h"
7*ef5ccd6cSJohn Marino 
8*ef5ccd6cSJohn Marino struct target_desc *tdesc_x32;
9*ef5ccd6cSJohn Marino static void
initialize_tdesc_x32(void)10*ef5ccd6cSJohn Marino initialize_tdesc_x32 (void)
11*ef5ccd6cSJohn Marino {
12*ef5ccd6cSJohn Marino   struct target_desc *result = allocate_target_description ();
13*ef5ccd6cSJohn Marino   struct tdesc_feature *feature;
14*ef5ccd6cSJohn Marino   struct tdesc_type *field_type;
15*ef5ccd6cSJohn Marino   struct tdesc_type *type;
16*ef5ccd6cSJohn Marino 
17*ef5ccd6cSJohn Marino   set_tdesc_architecture (result, bfd_scan_arch ("i386:x64-32"));
18*ef5ccd6cSJohn Marino 
19*ef5ccd6cSJohn Marino   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core");
20*ef5ccd6cSJohn Marino   field_type = tdesc_create_flags (feature, "i386_eflags", 4);
21*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 0, "CF");
22*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 1, "");
23*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 2, "PF");
24*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 4, "AF");
25*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 6, "ZF");
26*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 7, "SF");
27*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 8, "TF");
28*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 9, "IF");
29*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 10, "DF");
30*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 11, "OF");
31*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 14, "NT");
32*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 16, "RF");
33*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 17, "VM");
34*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 18, "AC");
35*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 19, "VIF");
36*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 20, "VIP");
37*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 21, "ID");
38*ef5ccd6cSJohn Marino 
39*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "rax", 0, 1, NULL, 64, "int64");
40*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "rbx", 1, 1, NULL, 64, "int64");
41*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "rcx", 2, 1, NULL, 64, "int64");
42*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "rdx", 3, 1, NULL, 64, "int64");
43*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "rsi", 4, 1, NULL, 64, "int64");
44*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "rdi", 5, 1, NULL, 64, "int64");
45*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "rbp", 6, 1, NULL, 64, "int64");
46*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "rsp", 7, 1, NULL, 64, "int64");
47*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "r8", 8, 1, NULL, 64, "int64");
48*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "r9", 9, 1, NULL, 64, "int64");
49*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "r10", 10, 1, NULL, 64, "int64");
50*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "r11", 11, 1, NULL, 64, "int64");
51*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "r12", 12, 1, NULL, 64, "int64");
52*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "r13", 13, 1, NULL, 64, "int64");
53*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "r14", 14, 1, NULL, 64, "int64");
54*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "r15", 15, 1, NULL, 64, "int64");
55*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "rip", 16, 1, NULL, 64, "uint64");
56*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "eflags", 17, 1, NULL, 32, "i386_eflags");
57*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "cs", 18, 1, NULL, 32, "int32");
58*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "ss", 19, 1, NULL, 32, "int32");
59*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "ds", 20, 1, NULL, 32, "int32");
60*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "es", 21, 1, NULL, 32, "int32");
61*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "fs", 22, 1, NULL, 32, "int32");
62*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "gs", 23, 1, NULL, 32, "int32");
63*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "st0", 24, 1, NULL, 80, "i387_ext");
64*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "st1", 25, 1, NULL, 80, "i387_ext");
65*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "st2", 26, 1, NULL, 80, "i387_ext");
66*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "st3", 27, 1, NULL, 80, "i387_ext");
67*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "st4", 28, 1, NULL, 80, "i387_ext");
68*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "st5", 29, 1, NULL, 80, "i387_ext");
69*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "st6", 30, 1, NULL, 80, "i387_ext");
70*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "st7", 31, 1, NULL, 80, "i387_ext");
71*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "fctrl", 32, 1, "float", 32, "int");
72*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "fstat", 33, 1, "float", 32, "int");
73*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "ftag", 34, 1, "float", 32, "int");
74*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "fiseg", 35, 1, "float", 32, "int");
75*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "fioff", 36, 1, "float", 32, "int");
76*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "foseg", 37, 1, "float", 32, "int");
77*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "fooff", 38, 1, "float", 32, "int");
78*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "fop", 39, 1, "float", 32, "int");
79*ef5ccd6cSJohn Marino 
80*ef5ccd6cSJohn Marino   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.sse");
81*ef5ccd6cSJohn Marino   field_type = tdesc_named_type (feature, "ieee_single");
82*ef5ccd6cSJohn Marino   tdesc_create_vector (feature, "v4f", field_type, 4);
83*ef5ccd6cSJohn Marino 
84*ef5ccd6cSJohn Marino   field_type = tdesc_named_type (feature, "ieee_double");
85*ef5ccd6cSJohn Marino   tdesc_create_vector (feature, "v2d", field_type, 2);
86*ef5ccd6cSJohn Marino 
87*ef5ccd6cSJohn Marino   field_type = tdesc_named_type (feature, "int8");
88*ef5ccd6cSJohn Marino   tdesc_create_vector (feature, "v16i8", field_type, 16);
89*ef5ccd6cSJohn Marino 
90*ef5ccd6cSJohn Marino   field_type = tdesc_named_type (feature, "int16");
91*ef5ccd6cSJohn Marino   tdesc_create_vector (feature, "v8i16", field_type, 8);
92*ef5ccd6cSJohn Marino 
93*ef5ccd6cSJohn Marino   field_type = tdesc_named_type (feature, "int32");
94*ef5ccd6cSJohn Marino   tdesc_create_vector (feature, "v4i32", field_type, 4);
95*ef5ccd6cSJohn Marino 
96*ef5ccd6cSJohn Marino   field_type = tdesc_named_type (feature, "int64");
97*ef5ccd6cSJohn Marino   tdesc_create_vector (feature, "v2i64", field_type, 2);
98*ef5ccd6cSJohn Marino 
99*ef5ccd6cSJohn Marino   type = tdesc_create_union (feature, "vec128");
100*ef5ccd6cSJohn Marino   field_type = tdesc_named_type (feature, "v4f");
101*ef5ccd6cSJohn Marino   tdesc_add_field (type, "v4_float", field_type);
102*ef5ccd6cSJohn Marino   field_type = tdesc_named_type (feature, "v2d");
103*ef5ccd6cSJohn Marino   tdesc_add_field (type, "v2_double", field_type);
104*ef5ccd6cSJohn Marino   field_type = tdesc_named_type (feature, "v16i8");
105*ef5ccd6cSJohn Marino   tdesc_add_field (type, "v16_int8", field_type);
106*ef5ccd6cSJohn Marino   field_type = tdesc_named_type (feature, "v8i16");
107*ef5ccd6cSJohn Marino   tdesc_add_field (type, "v8_int16", field_type);
108*ef5ccd6cSJohn Marino   field_type = tdesc_named_type (feature, "v4i32");
109*ef5ccd6cSJohn Marino   tdesc_add_field (type, "v4_int32", field_type);
110*ef5ccd6cSJohn Marino   field_type = tdesc_named_type (feature, "v2i64");
111*ef5ccd6cSJohn Marino   tdesc_add_field (type, "v2_int64", field_type);
112*ef5ccd6cSJohn Marino   field_type = tdesc_named_type (feature, "uint128");
113*ef5ccd6cSJohn Marino   tdesc_add_field (type, "uint128", field_type);
114*ef5ccd6cSJohn Marino 
115*ef5ccd6cSJohn Marino   field_type = tdesc_create_flags (feature, "i386_mxcsr", 4);
116*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 0, "IE");
117*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 1, "DE");
118*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 2, "ZE");
119*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 3, "OE");
120*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 4, "UE");
121*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 5, "PE");
122*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 6, "DAZ");
123*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 7, "IM");
124*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 8, "DM");
125*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 9, "ZM");
126*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 10, "OM");
127*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 11, "UM");
128*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 12, "PM");
129*ef5ccd6cSJohn Marino   tdesc_add_flag (field_type, 15, "FZ");
130*ef5ccd6cSJohn Marino 
131*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "xmm0", 40, 1, NULL, 128, "vec128");
132*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "xmm1", 41, 1, NULL, 128, "vec128");
133*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "xmm2", 42, 1, NULL, 128, "vec128");
134*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "xmm3", 43, 1, NULL, 128, "vec128");
135*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "xmm4", 44, 1, NULL, 128, "vec128");
136*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "xmm5", 45, 1, NULL, 128, "vec128");
137*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "xmm6", 46, 1, NULL, 128, "vec128");
138*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "xmm7", 47, 1, NULL, 128, "vec128");
139*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "xmm8", 48, 1, NULL, 128, "vec128");
140*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "xmm9", 49, 1, NULL, 128, "vec128");
141*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "xmm10", 50, 1, NULL, 128, "vec128");
142*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "xmm11", 51, 1, NULL, 128, "vec128");
143*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "xmm12", 52, 1, NULL, 128, "vec128");
144*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "xmm13", 53, 1, NULL, 128, "vec128");
145*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "xmm14", 54, 1, NULL, 128, "vec128");
146*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "xmm15", 55, 1, NULL, 128, "vec128");
147*ef5ccd6cSJohn Marino   tdesc_create_reg (feature, "mxcsr", 56, 1, "vector", 32, "i386_mxcsr");
148*ef5ccd6cSJohn Marino 
149*ef5ccd6cSJohn Marino   tdesc_x32 = result;
150*ef5ccd6cSJohn Marino }
151