2 local _sort
= table.sort
4 -----------------------------------------
6 -----------------------------------------
10 {name
= "FLAGSR", resclass
= "FLAGRSC", subres
= "0x01", regbase
= 1},
11 {name
= "GR8L", partial
= "true", subres
= "0x01", resclass
= "GRRSC", restrictres
= "0-3", regbase
= 32},
12 {name
= "GR8H", partial
= "true", subres
= "0x02", resclass
= "GRRSC", restrictres
= "0-3", regbase
= 36},
13 {name
= "GR16", partial
= "true", subres
= "0x03", resclass
= "GRRSC", regbase
= 64},
14 {name
= "GR32", subres
= "0x07", resclass
= "GRRSC", regbase
= 16},
15 {name
= "VR128", subres
= "0x01", resclass
= "VRRSC", regbase
= 96, restrictres_64
= "0-31"},
16 {name
= "VR256", subres
= "0x03", resclass
= "VRRSC", regbase
= 128, restrictres_64
= "0-31"},
17 {name
= "VR512", subres
= "0x07", resclass
= "VRRSC", regbase
= 160, restrictres_64
= "0-31"},
18 {name
= "GR8X", partial
= "true", subres
= "0x01", x64
= true
, resclass
= "GRRSC", restrictres
= "4-15", regbase
= 48},
19 {name
= "GR64", subres
= "0x07", x64
= true
, resclass
= "GRRSC", regbase
= 80},
22 {name
= "GR", dest
= "GR32", x32
= true
},
23 {name
= "GR", dest
= "GR64", x64
= true
},
26 {name
= "GRRSC", cnt
= 8, resbits
= 4, x32
= true
},
27 {name
= "VRRSC", cnt
= 8, resbits
= 4, x32
= true
},
28 {name
= "GRRSC", cnt
= 16, resbits
= 4, x64
= true
},
29 {name
= "VRRSC", cnt
= 32, resbits
= 4, x64
= true
},
30 {name
= "FLAGRSC", cnt
= 1, resbits
= 1},
33 {name
= "FLAGS", class
= "FLAGSR", id
= 1, refclass
= "FLAGS", resindex
= 0},
35 local r
= data.registers
36 for k
,v
in _pairs
({ A
= 0, C
= 1, D
= 2, B
= 3}) do
37 r
[#r+1] = {name = k.."L", id = 32+v, class = "GR8L", refclass = "GR8", resindex = v}
38 r
[#r+1] = {name = k.."H", id = 32+4+v, class = "GR8H", refclass = "GR8", resindex = v}
39 r
[#r+1] = {name = k.."X", id = 64+v, class = "GR16", refclass = "GR16", resindex = v}
40 r
[#r+1] = {name = "E"..k.."X", id = 16+v, class = "GR32", refclass = "GR32", resindex = v}
41 r
[#r+1] = {name = "R"..k.."X", id = 80+v, class = "GR64", refclass = "GR64", resindex = v, x64 = true}
43 for k
,v
in _pairs
({ SP
= 4, BP
= 5, SI
= 6, DI
= 7}) do
44 r
[#r+1] = {name = k.."L", id = 48+v, class = "GR8X", refclass = "GR8", resindex = v, x64 = true}
45 r
[#r+1] = {name = k, id = 64+v, class = "GR16", refclass = "GR16", resindex = v}
46 r
[#r+1] = {name = "E"..k, id = 16+v, class = "GR32", refclass = "GR32", resindex = v}
47 r
[#r+1] = {name = "R"..k, id = 80+v, class = "GR64", refclass = "GR64", resindex = v, x64 = true}
50 r
[#r+1] = {name = "XMM"..v, namemask = "XMM%d", id = 96+v, class = "VR128", refclass = "VR128", resindex = v}
51 r
[#r+1] = {name = "YMM"..v, namemask = "YMM%d", id = 128+v, class = "VR256", refclass = "VR256", resindex = v}
52 r
[#r+1] = {name = "ZMM"..v, namemask = "ZMM%d", id = 160+v, class = "VR512", refclass = "VR512", resindex = v}
56 r
[#r+1] = {name = "R"..v.."L", namemask = "R%dL", id = 48+v, class = "GR8X", refclass = "GR8", resindex = v, x64 = true}
57 r
[#r+1] = {name = "R"..v.."W", namemask = "R%dW", id = 64+v, class = "GR16", refclass = "GR16", resindex = v, x64 = true}
58 r
[#r+1] = {name = "R"..v.."D", namemask = "R%dD", id = 16+v, class = "GR32", refclass = "GR32", resindex = v, x64 = true}
59 r
[#r+1] = {name = "R"..v, namemask = "R%d", id = 80+v, class = "GR64", refclass = "GR64", resindex = v, x64 = true}
61 r
[#r+1] = {name = "XMM"..v, namemask = "XMM%d", id = 96+v, class = "VR128", refclass = "VR128", resindex = v, x64 = true}
62 r
[#r+1] = {name = "YMM"..v, namemask = "YMM%d", id = 128+v, class = "VR256", refclass = "VR256", resindex = v, x64 = true}
63 r
[#r+1] = {name = "ZMM"..v, namemask = "ZMM%d", id = 160+v, class = "VR512", refclass = "VR512", resindex = v, x64 = true}
66 if a.x64 ~
= b.x64
then return b.x64
end
67 if a.x32 ~
= b.x32
then return b.x32
end
71 data.registeraliases
= {
73 r
= data.registeraliases
74 for k
,v
in _pairs
({ A
= 0, C
= 1, D
= 2, B
= 3}) do
75 r
[#r+1] = {name = "R"..v.."L", dest = k.."L"}
76 r
[#r+1] = {name = "R"..v.."H", dest = k.."H"}
77 r
[#r+1] = {name = "R"..v.."W", dest = k.."X"}
78 r
[#r+1] = {name = "R"..v.."D", dest = "E"..k.."X"}
79 r
[#r+1] = {name = "R"..v, dest = "R"..k.."X", x64 = true}
80 r
[#r+1] = {name = "R"..v, dest = "E"..k.."X", x32 = true}
81 r
[#r+1] = {name = "R"..k.."X", dest = "E"..k.."X", x32 = true}
83 for k
,v
in _pairs
({ SP
= 4, BP
= 5, SI
= 6, DI
= 7}) do
84 r
[#r+1] = {name = "R"..v.."L", dest = k.."L", x64 = true}
85 r
[#r+1] = {name = "R"..v.."W", dest = k}
86 r
[#r+1] = {name = "R"..v.."D", dest = "E"..k}
87 r
[#r+1] = {name = "R"..v, dest = "R"..k, x64 = true}
88 r
[#r+1] = {name = "R"..v, dest = "E"..k, x32 = true}
89 r
[#r+1] = {name = "R"..k, dest = "E"..k, x32 = true}
92 if a.x64 ~
= b.x64
then return b.x64
end
93 if a.x32 ~
= b.x32
then return b.x32
end
97 {name
= "GR8", classes
= {"GR8L", "GR8H", "GR8X"}, dontalloc
="4-7", defsz
= 1},
98 {name
= "GR16", classes
= {"GR16", "GR32", "GR64"}, superrefclasses
= {"GR32", "GR64"}, defsz
= 2},
99 {name
= "GR32", classes
= {"GR32", "GR64"}, superrefclasses
= {"GR64"}, defsz
= 4},
100 {name
= "VR128", classes
= {"VR128", "VR256","VR512"}, superrefclasses
= {"VR256","VR512"}, defsz
= 16},
101 {name
= "VR256", classes
= {"VR256","VR512"}, superrefclasses
= {"VR512"}, defsz
= 32},
102 {name
= "VR512", classes
= {"VR512"}, defsz
= 64},
103 {name
= "GR64", x64
= true
, classes
= {"GR64"}, defsz
= 8},
104 {name
= "FLAGS", classes
= {"FLAGSR"}, defsz
= 0},
106 data.refclassaliases
= {
107 {name
= "GR", dest
= "GR32", x32
= true
},
108 {name
= "GR", dest
= "GR64", x64
= true
},