• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2011 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "managed_register_x86.h"
18 
19 #include "base/globals.h"
20 #include "base/macros.h"
21 #include "gtest/gtest.h"
22 
23 namespace art HIDDEN {
24 namespace x86 {
25 
TEST(X86ManagedRegister,NoRegister)26 TEST(X86ManagedRegister, NoRegister) {
27   X86ManagedRegister reg = ManagedRegister::NoRegister().AsX86();
28   EXPECT_TRUE(reg.IsNoRegister());
29   EXPECT_TRUE(!reg.Overlaps(reg));
30 }
31 
TEST(X86ManagedRegister,CpuRegister)32 TEST(X86ManagedRegister, CpuRegister) {
33   X86ManagedRegister reg = X86ManagedRegister::FromCpuRegister(EAX);
34   EXPECT_TRUE(!reg.IsNoRegister());
35   EXPECT_TRUE(reg.IsCpuRegister());
36   EXPECT_TRUE(!reg.IsXmmRegister());
37   EXPECT_TRUE(!reg.IsX87Register());
38   EXPECT_TRUE(!reg.IsRegisterPair());
39   EXPECT_EQ(EAX, reg.AsCpuRegister());
40 
41   reg = X86ManagedRegister::FromCpuRegister(EBX);
42   EXPECT_TRUE(!reg.IsNoRegister());
43   EXPECT_TRUE(reg.IsCpuRegister());
44   EXPECT_TRUE(!reg.IsXmmRegister());
45   EXPECT_TRUE(!reg.IsX87Register());
46   EXPECT_TRUE(!reg.IsRegisterPair());
47   EXPECT_EQ(EBX, reg.AsCpuRegister());
48 
49   reg = X86ManagedRegister::FromCpuRegister(ECX);
50   EXPECT_TRUE(!reg.IsNoRegister());
51   EXPECT_TRUE(reg.IsCpuRegister());
52   EXPECT_TRUE(!reg.IsXmmRegister());
53   EXPECT_TRUE(!reg.IsX87Register());
54   EXPECT_TRUE(!reg.IsRegisterPair());
55   EXPECT_EQ(ECX, reg.AsCpuRegister());
56 
57   reg = X86ManagedRegister::FromCpuRegister(EDI);
58   EXPECT_TRUE(!reg.IsNoRegister());
59   EXPECT_TRUE(reg.IsCpuRegister());
60   EXPECT_TRUE(!reg.IsXmmRegister());
61   EXPECT_TRUE(!reg.IsX87Register());
62   EXPECT_TRUE(!reg.IsRegisterPair());
63   EXPECT_EQ(EDI, reg.AsCpuRegister());
64 }
65 
TEST(X86ManagedRegister,XmmRegister)66 TEST(X86ManagedRegister, XmmRegister) {
67   X86ManagedRegister reg = X86ManagedRegister::FromXmmRegister(XMM0);
68   EXPECT_TRUE(!reg.IsNoRegister());
69   EXPECT_TRUE(!reg.IsCpuRegister());
70   EXPECT_TRUE(reg.IsXmmRegister());
71   EXPECT_TRUE(!reg.IsX87Register());
72   EXPECT_TRUE(!reg.IsRegisterPair());
73   EXPECT_EQ(XMM0, reg.AsXmmRegister());
74 
75   reg = X86ManagedRegister::FromXmmRegister(XMM1);
76   EXPECT_TRUE(!reg.IsNoRegister());
77   EXPECT_TRUE(!reg.IsCpuRegister());
78   EXPECT_TRUE(reg.IsXmmRegister());
79   EXPECT_TRUE(!reg.IsX87Register());
80   EXPECT_TRUE(!reg.IsRegisterPair());
81   EXPECT_EQ(XMM1, reg.AsXmmRegister());
82 
83   reg = X86ManagedRegister::FromXmmRegister(XMM7);
84   EXPECT_TRUE(!reg.IsNoRegister());
85   EXPECT_TRUE(!reg.IsCpuRegister());
86   EXPECT_TRUE(reg.IsXmmRegister());
87   EXPECT_TRUE(!reg.IsX87Register());
88   EXPECT_TRUE(!reg.IsRegisterPair());
89   EXPECT_EQ(XMM7, reg.AsXmmRegister());
90 }
91 
TEST(X86ManagedRegister,X87Register)92 TEST(X86ManagedRegister, X87Register) {
93   X86ManagedRegister reg = X86ManagedRegister::FromX87Register(ST0);
94   EXPECT_TRUE(!reg.IsNoRegister());
95   EXPECT_TRUE(!reg.IsCpuRegister());
96   EXPECT_TRUE(!reg.IsXmmRegister());
97   EXPECT_TRUE(reg.IsX87Register());
98   EXPECT_TRUE(!reg.IsRegisterPair());
99   EXPECT_EQ(ST0, reg.AsX87Register());
100 
101   reg = X86ManagedRegister::FromX87Register(ST1);
102   EXPECT_TRUE(!reg.IsNoRegister());
103   EXPECT_TRUE(!reg.IsCpuRegister());
104   EXPECT_TRUE(!reg.IsXmmRegister());
105   EXPECT_TRUE(reg.IsX87Register());
106   EXPECT_TRUE(!reg.IsRegisterPair());
107   EXPECT_EQ(ST1, reg.AsX87Register());
108 
109   reg = X86ManagedRegister::FromX87Register(ST7);
110   EXPECT_TRUE(!reg.IsNoRegister());
111   EXPECT_TRUE(!reg.IsCpuRegister());
112   EXPECT_TRUE(!reg.IsXmmRegister());
113   EXPECT_TRUE(reg.IsX87Register());
114   EXPECT_TRUE(!reg.IsRegisterPair());
115   EXPECT_EQ(ST7, reg.AsX87Register());
116 }
117 
TEST(X86ManagedRegister,RegisterPair)118 TEST(X86ManagedRegister, RegisterPair) {
119   X86ManagedRegister reg = X86ManagedRegister::FromRegisterPair(EAX_EDX);
120   EXPECT_TRUE(!reg.IsNoRegister());
121   EXPECT_TRUE(!reg.IsCpuRegister());
122   EXPECT_TRUE(!reg.IsXmmRegister());
123   EXPECT_TRUE(!reg.IsX87Register());
124   EXPECT_TRUE(reg.IsRegisterPair());
125   EXPECT_EQ(EAX, reg.AsRegisterPairLow());
126   EXPECT_EQ(EDX, reg.AsRegisterPairHigh());
127 
128   reg = X86ManagedRegister::FromRegisterPair(EAX_ECX);
129   EXPECT_TRUE(!reg.IsNoRegister());
130   EXPECT_TRUE(!reg.IsCpuRegister());
131   EXPECT_TRUE(!reg.IsXmmRegister());
132   EXPECT_TRUE(!reg.IsX87Register());
133   EXPECT_TRUE(reg.IsRegisterPair());
134   EXPECT_EQ(EAX, reg.AsRegisterPairLow());
135   EXPECT_EQ(ECX, reg.AsRegisterPairHigh());
136 
137   reg = X86ManagedRegister::FromRegisterPair(EAX_EBX);
138   EXPECT_TRUE(!reg.IsNoRegister());
139   EXPECT_TRUE(!reg.IsCpuRegister());
140   EXPECT_TRUE(!reg.IsXmmRegister());
141   EXPECT_TRUE(!reg.IsX87Register());
142   EXPECT_TRUE(reg.IsRegisterPair());
143   EXPECT_EQ(EAX, reg.AsRegisterPairLow());
144   EXPECT_EQ(EBX, reg.AsRegisterPairHigh());
145 
146   reg = X86ManagedRegister::FromRegisterPair(EAX_EDI);
147   EXPECT_TRUE(!reg.IsNoRegister());
148   EXPECT_TRUE(!reg.IsCpuRegister());
149   EXPECT_TRUE(!reg.IsXmmRegister());
150   EXPECT_TRUE(!reg.IsX87Register());
151   EXPECT_TRUE(reg.IsRegisterPair());
152   EXPECT_EQ(EAX, reg.AsRegisterPairLow());
153   EXPECT_EQ(EDI, reg.AsRegisterPairHigh());
154 
155   reg = X86ManagedRegister::FromRegisterPair(EDX_ECX);
156   EXPECT_TRUE(!reg.IsNoRegister());
157   EXPECT_TRUE(!reg.IsCpuRegister());
158   EXPECT_TRUE(!reg.IsXmmRegister());
159   EXPECT_TRUE(!reg.IsX87Register());
160   EXPECT_TRUE(reg.IsRegisterPair());
161   EXPECT_EQ(EDX, reg.AsRegisterPairLow());
162   EXPECT_EQ(ECX, reg.AsRegisterPairHigh());
163 
164   reg = X86ManagedRegister::FromRegisterPair(EDX_EBX);
165   EXPECT_TRUE(!reg.IsNoRegister());
166   EXPECT_TRUE(!reg.IsCpuRegister());
167   EXPECT_TRUE(!reg.IsXmmRegister());
168   EXPECT_TRUE(!reg.IsX87Register());
169   EXPECT_TRUE(reg.IsRegisterPair());
170   EXPECT_EQ(EDX, reg.AsRegisterPairLow());
171   EXPECT_EQ(EBX, reg.AsRegisterPairHigh());
172 
173   reg = X86ManagedRegister::FromRegisterPair(EDX_EDI);
174   EXPECT_TRUE(!reg.IsNoRegister());
175   EXPECT_TRUE(!reg.IsCpuRegister());
176   EXPECT_TRUE(!reg.IsXmmRegister());
177   EXPECT_TRUE(!reg.IsX87Register());
178   EXPECT_TRUE(reg.IsRegisterPair());
179   EXPECT_EQ(EDX, reg.AsRegisterPairLow());
180   EXPECT_EQ(EDI, reg.AsRegisterPairHigh());
181 
182   reg = X86ManagedRegister::FromRegisterPair(ECX_EBX);
183   EXPECT_TRUE(!reg.IsNoRegister());
184   EXPECT_TRUE(!reg.IsCpuRegister());
185   EXPECT_TRUE(!reg.IsXmmRegister());
186   EXPECT_TRUE(!reg.IsX87Register());
187   EXPECT_TRUE(reg.IsRegisterPair());
188   EXPECT_EQ(ECX, reg.AsRegisterPairLow());
189   EXPECT_EQ(EBX, reg.AsRegisterPairHigh());
190 
191   reg = X86ManagedRegister::FromRegisterPair(ECX_EDI);
192   EXPECT_TRUE(!reg.IsNoRegister());
193   EXPECT_TRUE(!reg.IsCpuRegister());
194   EXPECT_TRUE(!reg.IsXmmRegister());
195   EXPECT_TRUE(!reg.IsX87Register());
196   EXPECT_TRUE(reg.IsRegisterPair());
197   EXPECT_EQ(ECX, reg.AsRegisterPairLow());
198   EXPECT_EQ(EDI, reg.AsRegisterPairHigh());
199 
200   reg = X86ManagedRegister::FromRegisterPair(EBX_EDI);
201   EXPECT_TRUE(!reg.IsNoRegister());
202   EXPECT_TRUE(!reg.IsCpuRegister());
203   EXPECT_TRUE(!reg.IsXmmRegister());
204   EXPECT_TRUE(!reg.IsX87Register());
205   EXPECT_TRUE(reg.IsRegisterPair());
206   EXPECT_EQ(EBX, reg.AsRegisterPairLow());
207   EXPECT_EQ(EDI, reg.AsRegisterPairHigh());
208 }
209 
TEST(X86ManagedRegister,Equals)210 TEST(X86ManagedRegister, Equals) {
211   X86ManagedRegister reg_eax = X86ManagedRegister::FromCpuRegister(EAX);
212   EXPECT_TRUE(reg_eax.Equals(X86ManagedRegister::FromCpuRegister(EAX)));
213   EXPECT_TRUE(!reg_eax.Equals(X86ManagedRegister::FromCpuRegister(EBX)));
214   EXPECT_TRUE(!reg_eax.Equals(X86ManagedRegister::FromCpuRegister(EDI)));
215   EXPECT_TRUE(!reg_eax.Equals(X86ManagedRegister::FromXmmRegister(XMM0)));
216   EXPECT_TRUE(!reg_eax.Equals(X86ManagedRegister::FromXmmRegister(XMM7)));
217   EXPECT_TRUE(!reg_eax.Equals(X86ManagedRegister::FromX87Register(ST0)));
218   EXPECT_TRUE(!reg_eax.Equals(X86ManagedRegister::FromX87Register(ST7)));
219   EXPECT_TRUE(!reg_eax.Equals(X86ManagedRegister::FromRegisterPair(EAX_EDX)));
220   EXPECT_TRUE(!reg_eax.Equals(X86ManagedRegister::FromRegisterPair(EBX_EDI)));
221 
222   X86ManagedRegister reg_xmm0 = X86ManagedRegister::FromXmmRegister(XMM0);
223   EXPECT_TRUE(!reg_xmm0.Equals(X86ManagedRegister::FromCpuRegister(EAX)));
224   EXPECT_TRUE(!reg_xmm0.Equals(X86ManagedRegister::FromCpuRegister(EBX)));
225   EXPECT_TRUE(!reg_xmm0.Equals(X86ManagedRegister::FromCpuRegister(EDI)));
226   EXPECT_TRUE(reg_xmm0.Equals(X86ManagedRegister::FromXmmRegister(XMM0)));
227   EXPECT_TRUE(!reg_xmm0.Equals(X86ManagedRegister::FromXmmRegister(XMM7)));
228   EXPECT_TRUE(!reg_xmm0.Equals(X86ManagedRegister::FromX87Register(ST0)));
229   EXPECT_TRUE(!reg_xmm0.Equals(X86ManagedRegister::FromX87Register(ST7)));
230   EXPECT_TRUE(!reg_xmm0.Equals(X86ManagedRegister::FromRegisterPair(EAX_EDX)));
231   EXPECT_TRUE(!reg_xmm0.Equals(X86ManagedRegister::FromRegisterPair(EBX_EDI)));
232 
233   X86ManagedRegister reg_st0 = X86ManagedRegister::FromX87Register(ST0);
234   EXPECT_TRUE(!reg_st0.Equals(X86ManagedRegister::FromCpuRegister(EAX)));
235   EXPECT_TRUE(!reg_st0.Equals(X86ManagedRegister::FromCpuRegister(EBX)));
236   EXPECT_TRUE(!reg_st0.Equals(X86ManagedRegister::FromCpuRegister(EDI)));
237   EXPECT_TRUE(!reg_st0.Equals(X86ManagedRegister::FromXmmRegister(XMM0)));
238   EXPECT_TRUE(!reg_st0.Equals(X86ManagedRegister::FromXmmRegister(XMM7)));
239   EXPECT_TRUE(reg_st0.Equals(X86ManagedRegister::FromX87Register(ST0)));
240   EXPECT_TRUE(!reg_st0.Equals(X86ManagedRegister::FromX87Register(ST7)));
241   EXPECT_TRUE(!reg_st0.Equals(X86ManagedRegister::FromRegisterPair(EAX_EDX)));
242   EXPECT_TRUE(!reg_st0.Equals(X86ManagedRegister::FromRegisterPair(EBX_EDI)));
243 
244   X86ManagedRegister reg_pair = X86ManagedRegister::FromRegisterPair(EAX_EDX);
245   EXPECT_TRUE(!reg_pair.Equals(X86ManagedRegister::FromCpuRegister(EAX)));
246   EXPECT_TRUE(!reg_pair.Equals(X86ManagedRegister::FromCpuRegister(EBX)));
247   EXPECT_TRUE(!reg_pair.Equals(X86ManagedRegister::FromCpuRegister(EDI)));
248   EXPECT_TRUE(!reg_pair.Equals(X86ManagedRegister::FromXmmRegister(XMM0)));
249   EXPECT_TRUE(!reg_pair.Equals(X86ManagedRegister::FromXmmRegister(XMM7)));
250   EXPECT_TRUE(!reg_pair.Equals(X86ManagedRegister::FromX87Register(ST0)));
251   EXPECT_TRUE(!reg_pair.Equals(X86ManagedRegister::FromX87Register(ST7)));
252   EXPECT_TRUE(reg_pair.Equals(X86ManagedRegister::FromRegisterPair(EAX_EDX)));
253   EXPECT_TRUE(!reg_pair.Equals(X86ManagedRegister::FromRegisterPair(EBX_EDI)));
254 }
255 
TEST(X86ManagedRegister,Overlaps)256 TEST(X86ManagedRegister, Overlaps) {
257   X86ManagedRegister reg = X86ManagedRegister::FromCpuRegister(EAX);
258   EXPECT_TRUE(reg.Overlaps(X86ManagedRegister::FromCpuRegister(EAX)));
259   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EBX)));
260   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EDI)));
261   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromXmmRegister(XMM0)));
262   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromXmmRegister(XMM7)));
263   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromX87Register(ST0)));
264   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromX87Register(ST7)));
265   EXPECT_TRUE(reg.Overlaps(X86ManagedRegister::FromRegisterPair(EAX_EDX)));
266   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromRegisterPair(EBX_EDI)));
267 
268   reg = X86ManagedRegister::FromCpuRegister(EDX);
269   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EAX)));
270   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EBX)));
271   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EDI)));
272   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromXmmRegister(XMM0)));
273   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromXmmRegister(XMM7)));
274   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromX87Register(ST0)));
275   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromX87Register(ST7)));
276   EXPECT_TRUE(reg.Overlaps(X86ManagedRegister::FromRegisterPair(EAX_EDX)));
277   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromRegisterPair(EBX_EDI)));
278 
279   reg = X86ManagedRegister::FromCpuRegister(EDI);
280   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EAX)));
281   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EBX)));
282   EXPECT_TRUE(reg.Overlaps(X86ManagedRegister::FromCpuRegister(EDI)));
283   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromXmmRegister(XMM0)));
284   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromXmmRegister(XMM7)));
285   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromX87Register(ST0)));
286   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromX87Register(ST7)));
287   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromRegisterPair(EAX_EDX)));
288   EXPECT_TRUE(reg.Overlaps(X86ManagedRegister::FromRegisterPair(EBX_EDI)));
289 
290   reg = X86ManagedRegister::FromCpuRegister(EBX);
291   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EAX)));
292   EXPECT_TRUE(reg.Overlaps(X86ManagedRegister::FromCpuRegister(EBX)));
293   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EDI)));
294   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromXmmRegister(XMM0)));
295   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromXmmRegister(XMM7)));
296   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromX87Register(ST0)));
297   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromX87Register(ST7)));
298   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromRegisterPair(EAX_EDX)));
299   EXPECT_TRUE(reg.Overlaps(X86ManagedRegister::FromRegisterPair(EBX_EDI)));
300 
301   reg = X86ManagedRegister::FromXmmRegister(XMM0);
302   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EAX)));
303   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EBX)));
304   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EDI)));
305   EXPECT_TRUE(reg.Overlaps(X86ManagedRegister::FromXmmRegister(XMM0)));
306   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromXmmRegister(XMM7)));
307   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromX87Register(ST0)));
308   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromX87Register(ST7)));
309   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromRegisterPair(EAX_EDX)));
310   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromRegisterPair(EBX_EDI)));
311 
312   reg = X86ManagedRegister::FromX87Register(ST0);
313   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EAX)));
314   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EBX)));
315   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EDI)));
316   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromXmmRegister(XMM0)));
317   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromXmmRegister(XMM7)));
318   EXPECT_TRUE(reg.Overlaps(X86ManagedRegister::FromX87Register(ST0)));
319   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromX87Register(ST7)));
320   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromRegisterPair(EAX_EDX)));
321   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromRegisterPair(EBX_EDI)));
322 
323   reg = X86ManagedRegister::FromRegisterPair(EAX_EDX);
324   EXPECT_TRUE(reg.Overlaps(X86ManagedRegister::FromCpuRegister(EAX)));
325   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EBX)));
326   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EDI)));
327   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromXmmRegister(XMM0)));
328   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromXmmRegister(XMM7)));
329   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromX87Register(ST0)));
330   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromX87Register(ST7)));
331   EXPECT_TRUE(reg.Overlaps(X86ManagedRegister::FromRegisterPair(EAX_EDX)));
332   EXPECT_TRUE(reg.Overlaps(X86ManagedRegister::FromRegisterPair(EDX_ECX)));
333   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromRegisterPair(EBX_EDI)));
334 
335   reg = X86ManagedRegister::FromRegisterPair(EBX_EDI);
336   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EAX)));
337   EXPECT_TRUE(reg.Overlaps(X86ManagedRegister::FromCpuRegister(EBX)));
338   EXPECT_TRUE(reg.Overlaps(X86ManagedRegister::FromCpuRegister(EDI)));
339   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromXmmRegister(XMM0)));
340   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromXmmRegister(XMM7)));
341   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromX87Register(ST0)));
342   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromX87Register(ST7)));
343   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromRegisterPair(EAX_EDX)));
344   EXPECT_TRUE(reg.Overlaps(X86ManagedRegister::FromRegisterPair(EBX_EDI)));
345   EXPECT_TRUE(reg.Overlaps(X86ManagedRegister::FromRegisterPair(EDX_EBX)));
346 
347   reg = X86ManagedRegister::FromRegisterPair(EDX_ECX);
348   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EAX)));
349   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EBX)));
350   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromCpuRegister(EDI)));
351   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromXmmRegister(XMM0)));
352   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromXmmRegister(XMM7)));
353   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromX87Register(ST0)));
354   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromX87Register(ST7)));
355   EXPECT_TRUE(reg.Overlaps(X86ManagedRegister::FromRegisterPair(EAX_EDX)));
356   EXPECT_TRUE(!reg.Overlaps(X86ManagedRegister::FromRegisterPair(EBX_EDI)));
357   EXPECT_TRUE(reg.Overlaps(X86ManagedRegister::FromRegisterPair(EDX_EBX)));
358 }
359 
360 }  // namespace x86
361 }  // namespace art
362