+ distinguish between x86 flags subregisters: flags, eflags and rflags

git-svn-id: trunk@35953 -
This commit is contained in:
nickysn 2017-04-25 16:10:43 +00:00
parent 65977f9f27
commit 5f66f5cebb
47 changed files with 235 additions and 165 deletions

View File

@ -8,21 +8,21 @@
15,
6,
5,
39,
40,
41,
42,
43,
26,
7,
10,
19,
9,
33,
34,
35,
36,
37,
38,
39,
28,
11,
4,
@ -32,13 +32,13 @@
20,
12,
32,
33,
25,
18,
24,
31,
29,
30,
57,
58,
59,
60,
@ -46,11 +46,11 @@
62,
63,
64,
65,
17,
23,
27,
56,
48,
57,
49,
50,
51,
@ -58,12 +58,12 @@
53,
54,
55,
43,
56,
44,
45,
46,
47,
65,
48,
66,
67,
68,
@ -79,4 +79,5 @@
78,
79,
80,
81,
0

View File

@ -31,6 +31,7 @@
'%fs',
'%gs',
'%flags',
'%eflags',
'%eip',
'%dr0',
'%dr1',

View File

@ -30,7 +30,8 @@ NR_SS = tregister($05000002);
NR_DS = tregister($05000003);
NR_FS = tregister($05000004);
NR_GS = tregister($05000005);
NR_FLAGS = tregister($05000006);
NR_FLAGS = tregister($05030006);
NR_EFLAGS = tregister($05040006);
NR_EIP = tregister($05040007);
NR_DR0 = tregister($05000008);
NR_DR1 = tregister($05000009);

View File

@ -31,6 +31,7 @@
-1,
-1,
-1,
-1,
8,
-1,
-1,

View File

@ -31,6 +31,7 @@
'fs',
'gs',
'flags',
'eflags',
'eip',
'dr0',
'dr1',

View File

@ -9,21 +9,21 @@
15,
6,
5,
39,
40,
41,
42,
43,
26,
7,
10,
19,
9,
33,
34,
35,
36,
37,
38,
39,
28,
11,
4,
@ -33,13 +33,13 @@
20,
12,
32,
33,
25,
18,
24,
31,
29,
30,
57,
58,
59,
60,
@ -47,11 +47,11 @@
62,
63,
64,
65,
17,
23,
27,
56,
48,
57,
49,
50,
51,
@ -59,12 +59,12 @@
53,
54,
55,
43,
56,
44,
45,
46,
47,
65,
48,
66,
67,
68,
@ -79,4 +79,5 @@
77,
78,
79,
80
80,
81

View File

@ -31,6 +31,7 @@
'fs',
'gs',
'flags',
'eflags',
'eip',
'dr0',
'dr1',

View File

@ -1,2 +1,2 @@
{ don't edit, this file is generated from x86reg.dat }
81
82

View File

@ -9,21 +9,21 @@
15,
6,
5,
39,
40,
41,
42,
43,
26,
7,
10,
19,
9,
33,
34,
35,
36,
37,
38,
39,
28,
11,
4,
@ -33,13 +33,13 @@
20,
12,
32,
33,
25,
18,
24,
31,
29,
30,
57,
58,
59,
60,
@ -47,11 +47,11 @@
62,
63,
64,
65,
17,
23,
27,
56,
48,
57,
49,
50,
51,
@ -59,12 +59,12 @@
53,
54,
55,
43,
56,
44,
45,
46,
47,
65,
48,
66,
67,
68,
@ -79,4 +79,5 @@
77,
78,
79,
80
80,
81

View File

@ -30,7 +30,8 @@ tregister($05000002),
tregister($05000003),
tregister($05000004),
tregister($05000005),
tregister($05000006),
tregister($05030006),
tregister($05040006),
tregister($05040007),
tregister($05000008),
tregister($05000009),

View File

@ -32,6 +32,7 @@ OT_REG_FSGS,
OT_REG_FSGS,
OT_NONE,
OT_NONE,
OT_NONE,
OT_REG_DREG,
OT_REG_DREG,
OT_REG_DREG,

View File

@ -24,7 +24,6 @@
20,
22,
24,
48,
49,
50,
51,
@ -57,14 +56,13 @@
78,
79,
80,
81,
25,
26,
27,
28,
29,
30,
31,
33,
34,
35,
36,
@ -79,4 +77,7 @@
45,
46,
47,
32
48,
31,
32,
33

View File

@ -9,21 +9,21 @@
15,
6,
5,
39,
40,
41,
42,
43,
26,
7,
10,
19,
9,
33,
34,
35,
36,
37,
38,
39,
28,
11,
4,
@ -33,13 +33,13 @@
20,
12,
32,
33,
25,
18,
24,
31,
29,
30,
57,
58,
59,
60,
@ -47,11 +47,11 @@
62,
63,
64,
65,
17,
23,
27,
56,
48,
57,
49,
50,
51,
@ -59,12 +59,12 @@
53,
54,
55,
43,
56,
44,
45,
46,
47,
65,
48,
66,
67,
68,
@ -79,4 +79,5 @@
77,
78,
79,
80
80,
81

View File

@ -47,6 +47,7 @@
-1,
-1,
-1,
-1,
12,
13,
14,

View File

@ -31,6 +31,7 @@
'fs',
'gs',
'flags',
'eflags',
'eip',
'dr0',
'dr1',

View File

@ -8,21 +8,21 @@
15,
6,
5,
39,
40,
41,
42,
43,
26,
7,
10,
19,
9,
33,
34,
35,
36,
37,
38,
39,
28,
11,
4,
@ -32,13 +32,13 @@
20,
12,
32,
33,
25,
18,
24,
31,
29,
30,
57,
58,
59,
60,
@ -46,11 +46,11 @@
62,
63,
64,
65,
17,
23,
27,
56,
48,
57,
49,
50,
51,
@ -58,12 +58,12 @@
53,
54,
55,
43,
56,
44,
45,
46,
47,
65,
48,
66,
67,
68,
@ -79,4 +79,5 @@
78,
79,
80,
81,
0

View File

@ -31,6 +31,7 @@
'%fs',
'%gs',
'%flags',
'%eflags',
'%eip',
'%dr0',
'%dr1',

View File

@ -30,7 +30,8 @@ NR_SS = tregister($05000002);
NR_DS = tregister($05000003);
NR_FS = tregister($05000004);
NR_GS = tregister($05000005);
NR_FLAGS = tregister($05000006);
NR_FLAGS = tregister($05030006);
NR_EFLAGS = tregister($05040006);
NR_EIP = tregister($05040007);
NR_DR0 = tregister($05000008);
NR_DR1 = tregister($05000009);

View File

@ -31,6 +31,7 @@
-1,
-1,
-1,
-1,
8,
-1,
-1,

View File

@ -31,6 +31,7 @@
'fs',
'gs',
'flags',
'eflags',
'eip',
'dr0',
'dr1',

View File

@ -9,21 +9,21 @@
15,
6,
5,
39,
40,
41,
42,
43,
26,
7,
10,
19,
9,
33,
34,
35,
36,
37,
38,
39,
28,
11,
4,
@ -33,13 +33,13 @@
20,
12,
32,
33,
25,
18,
24,
31,
29,
30,
57,
58,
59,
60,
@ -47,11 +47,11 @@
62,
63,
64,
65,
17,
23,
27,
56,
48,
57,
49,
50,
51,
@ -59,12 +59,12 @@
53,
54,
55,
43,
56,
44,
45,
46,
47,
65,
48,
66,
67,
68,
@ -79,4 +79,5 @@
77,
78,
79,
80
80,
81

View File

@ -31,6 +31,7 @@
'fs',
'gs',
'flags',
'eflags',
'eip',
'dr0',
'dr1',

View File

@ -1,2 +1,2 @@
{ don't edit, this file is generated from x86reg.dat }
81
82

View File

@ -9,21 +9,21 @@
15,
6,
5,
39,
40,
41,
42,
43,
26,
7,
10,
19,
9,
33,
34,
35,
36,
37,
38,
39,
28,
11,
4,
@ -33,13 +33,13 @@
20,
12,
32,
33,
25,
18,
24,
31,
29,
30,
57,
58,
59,
60,
@ -47,11 +47,11 @@
62,
63,
64,
65,
17,
23,
27,
56,
48,
57,
49,
50,
51,
@ -59,12 +59,12 @@
53,
54,
55,
43,
56,
44,
45,
46,
47,
65,
48,
66,
67,
68,
@ -79,4 +79,5 @@
77,
78,
79,
80
80,
81

View File

@ -30,7 +30,8 @@ tregister($05000002),
tregister($05000003),
tregister($05000004),
tregister($05000005),
tregister($05000006),
tregister($05030006),
tregister($05040006),
tregister($05040007),
tregister($05000008),
tregister($05000009),

View File

@ -32,6 +32,7 @@ OT_REG_FSGS,
OT_REG_FSGS,
OT_NONE,
OT_NONE,
OT_NONE,
OT_REG_DREG,
OT_REG_DREG,
OT_REG_DREG,

View File

@ -24,7 +24,6 @@
20,
22,
24,
48,
49,
50,
51,
@ -57,14 +56,13 @@
78,
79,
80,
81,
25,
26,
27,
28,
29,
30,
31,
33,
34,
35,
36,
@ -79,4 +77,7 @@
45,
46,
47,
32
48,
31,
32,
33

View File

@ -9,21 +9,21 @@
15,
6,
5,
39,
40,
41,
42,
43,
26,
7,
10,
19,
9,
33,
34,
35,
36,
37,
38,
39,
28,
11,
4,
@ -33,13 +33,13 @@
20,
12,
32,
33,
25,
18,
24,
31,
29,
30,
57,
58,
59,
60,
@ -47,11 +47,11 @@
62,
63,
64,
65,
17,
23,
27,
56,
48,
57,
49,
50,
51,
@ -59,12 +59,12 @@
53,
54,
55,
43,
56,
44,
45,
46,
47,
65,
48,
66,
67,
68,
@ -79,4 +79,5 @@
77,
78,
79,
80
80,
81

View File

@ -47,6 +47,7 @@
-1,
-1,
-1,
-1,
12,
13,
14,

View File

@ -31,6 +31,7 @@
'fs',
'gs',
'flags',
'eflags',
'eip',
'dr0',
'dr1',

View File

@ -145,7 +145,13 @@ uses
RS_XMM14 = $0e;
RS_XMM15 = $0f;
RS_FLAGS = $07;
{$if defined(x86_64)}
RS_RFLAGS = $06;
{$elseif defined(i386)}
RS_EFLAGS = $06;
{$elseif defined(i8086)}
RS_FLAGS = $06;
{$endif}
{ Number of first imaginary register }
{$ifdef x86_64}
@ -219,8 +225,16 @@ uses
{$endif}
);
{$if defined(x86_64)}
RS_DEFAULTFLAGS = RS_RFLAGS;
NR_DEFAULTFLAGS = NR_RFLAGS;
{$elseif defined(i386)}
RS_DEFAULTFLAGS = RS_EFLAGS;
NR_DEFAULTFLAGS = NR_EFLAGS;
{$elseif defined(i8086)}
RS_DEFAULTFLAGS = RS_FLAGS;
NR_DEFAULTFLAGS = NR_FLAGS;
{$endif}
type
totherregisterset = set of tregisterindex;

View File

@ -229,7 +229,7 @@ Unit Rax86int;
is_register:=false;
actasmregister:=masm_regnum_search(lower(s));
{ don't acceps "flags" as register name in an instruction }
if actasmregister=NR_FLAGS then
if (getsupreg(actasmregister)=RS_DEFAULTFLAGS) and (getregtype(actasmregister)=getregtype(NR_DEFAULTFLAGS)) then
actasmregister:=NR_NO;
if (actasmregister=NR_NO) and
(current_procinfo.procdef.proccalloption=pocall_register) and

View File

@ -91,7 +91,9 @@ NR_DS,$05000003,ds,%ds,ds,ds,-1,-1,-1,OT_REG_DESS,3
NR_FS,$05000004,fs,%fs,fs,fs,-1,-1,-1,OT_REG_FSGS,4
NR_GS,$05000005,gs,%gs,gs,gs,-1,-1,-1,OT_REG_FSGS,5
NR_FLAGS,$05000006,flags,%flags,flags,flags,-1,-1,-1,OT_NONE,0
NR_FLAGS,$05030006,flags,%flags,flags,flags,-1,-1,-1,OT_NONE,0
NR_EFLAGS,$05040006,eflags,%eflags,eflags,eflags,-1,-1,-1,OT_NONE,0
NR_RFLAGS,$05050006,rflags,%rflags,rflags,rflags,-1,-1,-1,OT_NONE,0,64
; EIP is needed for DWARF call frame info return address (RA)
NR_RIP,$05050007,rip,%rip,rip,rip,-1,8,16,OT_NONE,0,64
NR_EIP,$05040007,eip,%eip,eip,eip,-1,8,16,OT_NONE,0

View File

@ -9,22 +9,22 @@
18,
7,
6,
84,
85,
86,
87,
88,
89,
70,
8,
12,
26,
25,
11,
78,
79,
80,
81,
82,
83,
84,
85,
72,
13,
4,
@ -33,21 +33,22 @@
9,
27,
14,
77,
76,
79,
69,
23,
35,
75,
73,
74,
102,
103,
104,
105,
106,
107,
108,
109,
110,
111,
45,
46,
48,
@ -86,7 +87,8 @@
10,
28,
15,
76,
77,
78,
24,
36,
22,
@ -94,50 +96,50 @@
34,
33,
71,
101,
93,
94,
103,
95,
96,
97,
98,
99,
100,
88,
89,
101,
102,
90,
91,
92,
110,
111,
120,
121,
93,
94,
112,
113,
122,
123,
124,
125,
112,
113,
126,
127,
114,
115,
116,
117,
118,
119,
126,
127,
136,
137,
120,
121,
128,
129,
138,
139,
140,
141,
128,
129,
142,
143,
130,
131,
132,
133,
134,
135,
136,
137,
0

View File

@ -75,6 +75,8 @@
'%fs',
'%gs',
'%flags',
'%eflags',
'%rflags',
'%rip',
'%eip',
'%dr0',

View File

@ -74,7 +74,9 @@ NR_SS = tregister($05000002);
NR_DS = tregister($05000003);
NR_FS = tregister($05000004);
NR_GS = tregister($05000005);
NR_FLAGS = tregister($05000006);
NR_FLAGS = tregister($05030006);
NR_EFLAGS = tregister($05040006);
NR_RFLAGS = tregister($05050006);
NR_RIP = tregister($05050007);
NR_EIP = tregister($05040007);
NR_DR0 = tregister($05000008);

View File

@ -75,6 +75,8 @@
-1,
-1,
-1,
-1,
-1,
16,
16,
-1,

View File

@ -75,6 +75,8 @@
'fs',
'gs',
'flags',
'eflags',
'rflags',
'rip',
'eip',
'dr0',

View File

@ -10,22 +10,22 @@
18,
7,
6,
84,
85,
86,
87,
88,
89,
70,
8,
12,
26,
25,
11,
78,
79,
80,
81,
82,
83,
84,
85,
72,
13,
4,
@ -34,21 +34,22 @@
9,
27,
14,
77,
76,
79,
69,
23,
35,
75,
73,
74,
102,
103,
104,
105,
106,
107,
108,
109,
110,
111,
45,
46,
48,
@ -87,7 +88,8 @@
10,
28,
15,
76,
77,
78,
24,
36,
22,
@ -95,49 +97,49 @@
34,
33,
71,
101,
93,
94,
103,
95,
96,
97,
98,
99,
100,
88,
89,
101,
102,
90,
91,
92,
110,
111,
120,
121,
93,
94,
112,
113,
122,
123,
124,
125,
112,
113,
126,
127,
114,
115,
116,
117,
118,
119,
126,
127,
136,
137,
120,
121,
128,
129,
138,
139,
140,
141,
128,
129,
142,
143,
130,
131,
132,
133,
134,
135
135,
136,
137

View File

@ -75,6 +75,8 @@
'fs',
'gs',
'flags',
'eflags',
'rflags',
'rip',
'eip',
'dr0',

View File

@ -1,2 +1,2 @@
{ don't edit, this file is generated from x86reg.dat }
142
144

View File

@ -74,7 +74,9 @@ tregister($05000002),
tregister($05000003),
tregister($05000004),
tregister($05000005),
tregister($05000006),
tregister($05030006),
tregister($05040006),
tregister($05050006),
tregister($05050007),
tregister($05040007),
tregister($05000008),

View File

@ -77,6 +77,8 @@ OT_REG_FSGS,
OT_NONE,
OT_NONE,
OT_NONE,
OT_NONE,
OT_NONE,
OT_REG_DREG,
OT_REG_DREG,
OT_REG_DREG,

View File

@ -68,8 +68,6 @@
57,
61,
65,
93,
94,
95,
96,
97,
@ -117,15 +115,14 @@
139,
140,
141,
142,
143,
69,
70,
71,
72,
73,
74,
75,
78,
79,
80,
81,
82,
@ -139,5 +136,10 @@
90,
91,
92,
93,
94,
75,
76,
79,
77,
76
78

View File

@ -10,22 +10,22 @@
18,
7,
6,
84,
85,
86,
87,
88,
89,
70,
8,
12,
26,
25,
11,
78,
79,
80,
81,
82,
83,
84,
85,
72,
13,
4,
@ -34,21 +34,22 @@
9,
27,
14,
77,
76,
79,
69,
23,
35,
75,
73,
74,
102,
103,
104,
105,
106,
107,
108,
109,
110,
111,
45,
46,
48,
@ -87,7 +88,8 @@
10,
28,
15,
76,
77,
78,
24,
36,
22,
@ -95,49 +97,49 @@
34,
33,
71,
101,
93,
94,
103,
95,
96,
97,
98,
99,
100,
88,
89,
101,
102,
90,
91,
92,
110,
111,
120,
121,
93,
94,
112,
113,
122,
123,
124,
125,
112,
113,
126,
127,
114,
115,
116,
117,
118,
119,
126,
127,
136,
137,
120,
121,
128,
129,
138,
139,
140,
141,
128,
129,
142,
143,
130,
131,
132,
133,
134,
135
135,
136,
137

View File

@ -75,6 +75,8 @@
-1,
-1,
-1,
-1,
-1,
16,
16,
-1,

View File

@ -75,6 +75,8 @@
'fs',
'gs',
'flags',
'eflags',
'rflags',
'rip',
'eip',
'dr0',