1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2  * vim: set ts=8 sts=2 et sw=2 tw=80:
3  */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 
8 #if defined(JS_SIMULATOR_MIPS32)
9 #  include "jit/Linker.h"
10 #  include "jit/MacroAssembler.h"
11 #  include "jit/mips32/Assembler-mips32.h"
12 #  include "jit/mips32/MoveEmitter-mips32.h"
13 #  include "jit/mips32/Simulator-mips32.h"
14 #  include "jit/MoveResolver.h"
15 
16 #  include "jsapi-tests/tests.h"
17 
18 #  include "vm/Runtime.h"
19 
20 static const int LIFO_ALLOC_PRIMARY_CHUNK_SIZE = 4 * 1024;
21 
22 static constexpr js::jit::FloatRegister single0(0,
23                                                 js::jit::FloatRegister::Single);
24 static constexpr js::jit::FloatRegister single1(1,
25                                                 js::jit::FloatRegister::Single);
26 static constexpr js::jit::FloatRegister single2(2,
27                                                 js::jit::FloatRegister::Single);
28 static constexpr js::jit::FloatRegister single3(3,
29                                                 js::jit::FloatRegister::Single);
30 static constexpr js::jit::FloatRegister single4(4,
31                                                 js::jit::FloatRegister::Single);
32 static constexpr js::jit::FloatRegister single5(5,
33                                                 js::jit::FloatRegister::Single);
34 static constexpr js::jit::FloatRegister single6(6,
35                                                 js::jit::FloatRegister::Single);
36 static constexpr js::jit::FloatRegister single7(7,
37                                                 js::jit::FloatRegister::Single);
38 static constexpr js::jit::FloatRegister single8(8,
39                                                 js::jit::FloatRegister::Single);
40 static constexpr js::jit::FloatRegister single9(9,
41                                                 js::jit::FloatRegister::Single);
42 static constexpr js::jit::FloatRegister single10(
43     10, js::jit::FloatRegister::Single);
44 static constexpr js::jit::FloatRegister single11(
45     11, js::jit::FloatRegister::Single);
46 static constexpr js::jit::FloatRegister single12(
47     12, js::jit::FloatRegister::Single);
48 static constexpr js::jit::FloatRegister single13(
49     13, js::jit::FloatRegister::Single);
50 static constexpr js::jit::FloatRegister single14(
51     14, js::jit::FloatRegister::Single);
52 static constexpr js::jit::FloatRegister single15(
53     15, js::jit::FloatRegister::Single);
54 static constexpr js::jit::FloatRegister single16(
55     16, js::jit::FloatRegister::Single);
56 static constexpr js::jit::FloatRegister single17(
57     17, js::jit::FloatRegister::Single);
58 static constexpr js::jit::FloatRegister single18(
59     18, js::jit::FloatRegister::Single);
60 static constexpr js::jit::FloatRegister single19(
61     19, js::jit::FloatRegister::Single);
62 static constexpr js::jit::FloatRegister single20(
63     20, js::jit::FloatRegister::Single);
64 static constexpr js::jit::FloatRegister single21(
65     21, js::jit::FloatRegister::Single);
66 static constexpr js::jit::FloatRegister single22(
67     22, js::jit::FloatRegister::Single);
68 static constexpr js::jit::FloatRegister single23(
69     23, js::jit::FloatRegister::Single);
70 static constexpr js::jit::FloatRegister single24(
71     24, js::jit::FloatRegister::Single);
72 static constexpr js::jit::FloatRegister single25(
73     25, js::jit::FloatRegister::Single);
74 static constexpr js::jit::FloatRegister single26(
75     26, js::jit::FloatRegister::Single);
76 static constexpr js::jit::FloatRegister single27(
77     27, js::jit::FloatRegister::Single);
78 static constexpr js::jit::FloatRegister single28(
79     28, js::jit::FloatRegister::Single);
80 static constexpr js::jit::FloatRegister single29(
81     29, js::jit::FloatRegister::Single);
82 static constexpr js::jit::FloatRegister single30(
83     30, js::jit::FloatRegister::Single);
84 static constexpr js::jit::FloatRegister single31(
85     31, js::jit::FloatRegister::Single);
86 
87 static constexpr js::jit::FloatRegister double0(0,
88                                                 js::jit::FloatRegister::Double);
89 static constexpr js::jit::FloatRegister double1(2,
90                                                 js::jit::FloatRegister::Double);
91 static constexpr js::jit::FloatRegister double2(4,
92                                                 js::jit::FloatRegister::Double);
93 static constexpr js::jit::FloatRegister double3(6,
94                                                 js::jit::FloatRegister::Double);
95 static constexpr js::jit::FloatRegister double4(8,
96                                                 js::jit::FloatRegister::Double);
97 static constexpr js::jit::FloatRegister double5(10,
98                                                 js::jit::FloatRegister::Double);
99 static constexpr js::jit::FloatRegister double6(12,
100                                                 js::jit::FloatRegister::Double);
101 static constexpr js::jit::FloatRegister double7(14,
102                                                 js::jit::FloatRegister::Double);
103 static constexpr js::jit::FloatRegister double8(16,
104                                                 js::jit::FloatRegister::Double);
105 static constexpr js::jit::FloatRegister double9(18,
106                                                 js::jit::FloatRegister::Double);
107 static constexpr js::jit::FloatRegister double10(
108     20, js::jit::FloatRegister::Double);
109 static constexpr js::jit::FloatRegister double11(
110     22, js::jit::FloatRegister::Double);
111 static constexpr js::jit::FloatRegister double12(
112     24, js::jit::FloatRegister::Double);
113 static constexpr js::jit::FloatRegister double13(
114     26, js::jit::FloatRegister::Double);
115 static constexpr js::jit::FloatRegister double14(
116     28, js::jit::FloatRegister::Double);
117 static constexpr js::jit::FloatRegister double15(
118     30, js::jit::FloatRegister::Double);
119 
linkAndAllocate(JSContext * cx,js::jit::MacroAssembler * masm)120 static js::jit::JitCode* linkAndAllocate(JSContext* cx,
121                                          js::jit::MacroAssembler* masm) {
122   using namespace js;
123   using namespace js::jit;
124   Linker l(*masm);
125   return l.newCode(cx, CodeKind::Ion);
126 }
127 
128 #  define TRY(x) \
129     if (!(x)) return false;
130 
BEGIN_TEST(testJitMoveEmitterCycles_simple)131 BEGIN_TEST(testJitMoveEmitterCycles_simple) {
132   using namespace js;
133   using namespace js::jit;
134   LifoAlloc lifo(LIFO_ALLOC_PRIMARY_CHUNK_SIZE);
135   TempAllocator alloc(&lifo);
136   JitContext jc(cx, &alloc);
137 
138   StackMacroAssembler masm;
139   MoveEmitter mover(masm);
140   MoveResolver mr;
141   mr.setAllocator(alloc);
142   Simulator* sim = Simulator::Current();
143   TRY(mr.addMove(MoveOperand(double0), MoveOperand(double2), MoveOp::DOUBLE));
144   sim->setFpuRegisterDouble(double0.id(), 2.0);
145   TRY(mr.addMove(MoveOperand(double3), MoveOperand(double1), MoveOp::DOUBLE));
146   sim->setFpuRegisterDouble(double3.id(), 1.0);
147   TRY(mr.addMove(MoveOperand(single4), MoveOperand(single0), MoveOp::FLOAT32));
148   sim->setFpuRegisterFloat(single4.id(), 0.0f);
149   TRY(mr.addMove(MoveOperand(single5), MoveOperand(single6), MoveOp::FLOAT32));
150   sim->setFpuRegisterFloat(single5.id(), 6.0f);
151   TRY(mr.addMove(MoveOperand(single2), MoveOperand(single1), MoveOp::FLOAT32));
152   sim->setFpuRegisterFloat(single2.id(), 1.0f);
153   TRY(mr.addMove(MoveOperand(single3), MoveOperand(single7), MoveOp::FLOAT32));
154   sim->setFpuRegisterFloat(single3.id(), 7.0f);
155   // don't explode!
156   TRY(mr.resolve());
157   mover.emit(mr);
158   mover.finish();
159   masm.abiret();
160   JitCode* code = linkAndAllocate(cx, &masm);
161   sim->call(code->raw(), 1, 1);
162   CHECK(sim->getFpuRegisterDouble(double2.id()) == 2.0);
163   CHECK(int(sim->getFpuRegisterDouble(double1.id())) == 1.0);
164   CHECK(int(sim->getFpuRegisterFloat(single0.id())) == 0.0);
165   CHECK(int(sim->getFpuRegisterFloat(single6.id())) == 6.0);
166   CHECK(int(sim->getFpuRegisterFloat(single1.id())) == 1.0);
167   CHECK(int(sim->getFpuRegisterFloat(single7.id())) == 7.0);
168   return true;
169 }
170 END_TEST(testJitMoveEmitterCycles_simple)
BEGIN_TEST(testJitMoveEmitterCycles_autogen)171 BEGIN_TEST(testJitMoveEmitterCycles_autogen) {
172   using namespace js;
173   using namespace js::jit;
174   LifoAlloc lifo(LIFO_ALLOC_PRIMARY_CHUNK_SIZE);
175   TempAllocator alloc(&lifo);
176   JitContext jc(cx, &alloc);
177   StackMacroAssembler masm;
178   MoveEmitter mover(masm);
179   MoveResolver mr;
180   mr.setAllocator(alloc);
181   Simulator* sim = Simulator::Current();
182   sim->setFpuRegisterDouble(double9.id(), 9.0);
183   TRY(mr.addMove(MoveOperand(single24), MoveOperand(single25),
184                  MoveOp::FLOAT32));
185   sim->setFpuRegisterFloat(single24.id(), 24.0f);
186   TRY(mr.addMove(MoveOperand(double3), MoveOperand(double0), MoveOp::DOUBLE));
187   sim->setFpuRegisterDouble(double3.id(), 3.0);
188   TRY(mr.addMove(MoveOperand(single10), MoveOperand(single31),
189                  MoveOp::FLOAT32));
190   sim->setFpuRegisterFloat(single10.id(), 10.0f);
191   TRY(mr.addMove(MoveOperand(double1), MoveOperand(double10), MoveOp::DOUBLE));
192   sim->setFpuRegisterDouble(double1.id(), 1.0);
193   TRY(mr.addMove(MoveOperand(single8), MoveOperand(single10), MoveOp::FLOAT32));
194   sim->setFpuRegisterFloat(single8.id(), 8.0f);
195   TRY(mr.addMove(MoveOperand(double2), MoveOperand(double7), MoveOp::DOUBLE));
196   sim->setFpuRegisterDouble(double2.id(), 2.0);
197   TRY(mr.addMove(MoveOperand(single1), MoveOperand(single3), MoveOp::FLOAT32));
198   sim->setFpuRegisterFloat(single1.id(), 1.0f);
199   TRY(mr.addMove(MoveOperand(single17), MoveOperand(single11),
200                  MoveOp::FLOAT32));
201   sim->setFpuRegisterFloat(single17.id(), 17.0f);
202   TRY(mr.addMove(MoveOperand(single22), MoveOperand(single30),
203                  MoveOp::FLOAT32));
204   sim->setFpuRegisterFloat(single22.id(), 22.0f);
205   TRY(mr.addMove(MoveOperand(single31), MoveOperand(single7), MoveOp::FLOAT32));
206   sim->setFpuRegisterFloat(single31.id(), 31.0f);
207   TRY(mr.addMove(MoveOperand(double3), MoveOperand(double13), MoveOp::DOUBLE));
208   sim->setFpuRegisterDouble(double3.id(), 3.0);
209   TRY(mr.addMove(MoveOperand(single31), MoveOperand(single23),
210                  MoveOp::FLOAT32));
211   sim->setFpuRegisterFloat(single31.id(), 31.0f);
212   TRY(mr.addMove(MoveOperand(single13), MoveOperand(single8), MoveOp::FLOAT32));
213   sim->setFpuRegisterFloat(single13.id(), 13.0f);
214   TRY(mr.addMove(MoveOperand(single28), MoveOperand(single5), MoveOp::FLOAT32));
215   sim->setFpuRegisterFloat(single28.id(), 28.0f);
216   TRY(mr.addMove(MoveOperand(single20), MoveOperand(single6), MoveOp::FLOAT32));
217   sim->setFpuRegisterFloat(single20.id(), 20.0f);
218   TRY(mr.addMove(MoveOperand(single0), MoveOperand(single2), MoveOp::FLOAT32));
219   sim->setFpuRegisterFloat(single0.id(), 0.0f);
220   TRY(mr.addMove(MoveOperand(double7), MoveOperand(double6), MoveOp::DOUBLE));
221   sim->setFpuRegisterDouble(double7.id(), 7.0);
222   TRY(mr.addMove(MoveOperand(single13), MoveOperand(single9), MoveOp::FLOAT32));
223   sim->setFpuRegisterFloat(single13.id(), 13.0f);
224   TRY(mr.addMove(MoveOperand(single1), MoveOperand(single4), MoveOp::FLOAT32));
225   sim->setFpuRegisterFloat(single1.id(), 1.0f);
226   TRY(mr.addMove(MoveOperand(single29), MoveOperand(single22),
227                  MoveOp::FLOAT32));
228   sim->setFpuRegisterFloat(single29.id(), 29.0f);
229   TRY(mr.addMove(MoveOperand(single25), MoveOperand(single24),
230                  MoveOp::FLOAT32));
231   sim->setFpuRegisterFloat(single25.id(), 25.0f);
232   TRY(mr.resolve());
233   mover.emit(mr);
234   mover.finish();
235   masm.abiret();
236   JitCode* code = linkAndAllocate(cx, &masm);
237   sim->call(code->raw(), 1, 1);
238   CHECK(int(sim->getFpuRegisterFloat(single25.id())) == 24.0);
239   CHECK(int(sim->getFpuRegisterDouble(double0.id())) == 3.0);
240   CHECK(int(sim->getFpuRegisterFloat(single31.id())) == 10.0);
241   CHECK(int(sim->getFpuRegisterDouble(double10.id())) == 1.0);
242   CHECK(int(sim->getFpuRegisterFloat(single10.id())) == 8.0);
243   CHECK(int(sim->getFpuRegisterDouble(double7.id())) == 2.0);
244   CHECK(int(sim->getFpuRegisterFloat(single3.id())) == 1.0);
245   CHECK(int(sim->getFpuRegisterFloat(single11.id())) == 17.0);
246   CHECK(int(sim->getFpuRegisterFloat(single30.id())) == 22.0);
247   CHECK(int(sim->getFpuRegisterFloat(single7.id())) == 31.0);
248   CHECK(int(sim->getFpuRegisterDouble(double13.id())) == 3.0);
249   CHECK(int(sim->getFpuRegisterFloat(single23.id())) == 31.0);
250   CHECK(int(sim->getFpuRegisterFloat(single8.id())) == 13.0);
251   CHECK(int(sim->getFpuRegisterFloat(single5.id())) == 28.0);
252   CHECK(int(sim->getFpuRegisterFloat(single6.id())) == 20.0);
253   CHECK(int(sim->getFpuRegisterFloat(single2.id())) == 0.0);
254   CHECK(int(sim->getFpuRegisterDouble(double6.id())) == 7.0);
255   CHECK(int(sim->getFpuRegisterFloat(single9.id())) == 13.0);
256   CHECK(int(sim->getFpuRegisterFloat(single4.id())) == 1.0);
257   CHECK(int(sim->getFpuRegisterFloat(single22.id())) == 29.0);
258   CHECK(int(sim->getFpuRegisterFloat(single24.id())) == 25.0);
259   return true;
260 }
261 END_TEST(testJitMoveEmitterCycles_autogen)
262 
BEGIN_TEST(testJitMoveEmitterCycles_autogen2)263 BEGIN_TEST(testJitMoveEmitterCycles_autogen2) {
264   using namespace js;
265   using namespace js::jit;
266   LifoAlloc lifo(LIFO_ALLOC_PRIMARY_CHUNK_SIZE);
267   TempAllocator alloc(&lifo);
268   JitContext jc(cx, &alloc);
269   StackMacroAssembler masm;
270   MoveEmitter mover(masm);
271   MoveResolver mr;
272   mr.setAllocator(alloc);
273   Simulator* sim = Simulator::Current();
274   TRY(mr.addMove(MoveOperand(double10), MoveOperand(double0), MoveOp::DOUBLE));
275   sim->setFpuRegisterDouble(double10.id(), 10.0);
276   TRY(mr.addMove(MoveOperand(single15), MoveOperand(single3), MoveOp::FLOAT32));
277   sim->setFpuRegisterFloat(single15.id(), 15.0f);
278   TRY(mr.addMove(MoveOperand(single2), MoveOperand(single28), MoveOp::FLOAT32));
279   sim->setFpuRegisterFloat(single2.id(), 2.0f);
280   TRY(mr.addMove(MoveOperand(single30), MoveOperand(single25),
281                  MoveOp::FLOAT32));
282   sim->setFpuRegisterFloat(single30.id(), 30.0f);
283   TRY(mr.addMove(MoveOperand(single16), MoveOperand(single2), MoveOp::FLOAT32));
284   sim->setFpuRegisterFloat(single16.id(), 16.0f);
285   TRY(mr.addMove(MoveOperand(single2), MoveOperand(single29), MoveOp::FLOAT32));
286   sim->setFpuRegisterFloat(single2.id(), 2.0f);
287   TRY(mr.addMove(MoveOperand(single17), MoveOperand(single10),
288                  MoveOp::FLOAT32));
289   sim->setFpuRegisterFloat(single17.id(), 17.0f);
290   TRY(mr.addMove(MoveOperand(single9), MoveOperand(single26), MoveOp::FLOAT32));
291   sim->setFpuRegisterFloat(single9.id(), 9.0f);
292   TRY(mr.addMove(MoveOperand(single1), MoveOperand(single23), MoveOp::FLOAT32));
293   sim->setFpuRegisterFloat(single1.id(), 1.0f);
294   TRY(mr.addMove(MoveOperand(single8), MoveOperand(single6), MoveOp::FLOAT32));
295   sim->setFpuRegisterFloat(single8.id(), 8.0f);
296   TRY(mr.addMove(MoveOperand(single24), MoveOperand(single16),
297                  MoveOp::FLOAT32));
298   sim->setFpuRegisterFloat(single24.id(), 24.0f);
299   TRY(mr.addMove(MoveOperand(double5), MoveOperand(double6), MoveOp::DOUBLE));
300   sim->setFpuRegisterDouble(double5.id(), 5.0f);
301   TRY(mr.addMove(MoveOperand(single23), MoveOperand(single30),
302                  MoveOp::FLOAT32));
303   sim->setFpuRegisterFloat(single23.id(), 23.0f);
304   TRY(mr.addMove(MoveOperand(single27), MoveOperand(single17),
305                  MoveOp::FLOAT32));
306   sim->setFpuRegisterFloat(single27.id(), 27.0f);
307   TRY(mr.addMove(MoveOperand(double3), MoveOperand(double4), MoveOp::DOUBLE));
308   sim->setFpuRegisterDouble(double3.id(), 3.0f);
309   TRY(mr.addMove(MoveOperand(single14), MoveOperand(single27),
310                  MoveOp::FLOAT32));
311   sim->setFpuRegisterFloat(single14.id(), 14.0f);
312   TRY(mr.addMove(MoveOperand(single2), MoveOperand(single31), MoveOp::FLOAT32));
313   sim->setFpuRegisterFloat(single2.id(), 2.0f);
314   TRY(mr.addMove(MoveOperand(single2), MoveOperand(single24), MoveOp::FLOAT32));
315   sim->setFpuRegisterFloat(single2.id(), 2.0f);
316   TRY(mr.addMove(MoveOperand(single31), MoveOperand(single11),
317                  MoveOp::FLOAT32));
318   sim->setFpuRegisterFloat(single31.id(), 31.0f);
319   TRY(mr.addMove(MoveOperand(single24), MoveOperand(single7), MoveOp::FLOAT32));
320   sim->setFpuRegisterFloat(single24.id(), 24.0f);
321   TRY(mr.addMove(MoveOperand(single0), MoveOperand(single21), MoveOp::FLOAT32));
322   sim->setFpuRegisterFloat(single0.id(), 0.0f);
323   TRY(mr.addMove(MoveOperand(single27), MoveOperand(single20),
324                  MoveOp::FLOAT32));
325   sim->setFpuRegisterFloat(single27.id(), 27.0f);
326   TRY(mr.addMove(MoveOperand(single14), MoveOperand(single5), MoveOp::FLOAT32));
327   sim->setFpuRegisterFloat(single14.id(), 14.0f);
328   TRY(mr.addMove(MoveOperand(single2), MoveOperand(single14), MoveOp::FLOAT32));
329   sim->setFpuRegisterFloat(single2.id(), 2.0f);
330   TRY(mr.addMove(MoveOperand(single12), MoveOperand(single22),
331                  MoveOp::FLOAT32));
332   sim->setFpuRegisterFloat(single12.id(), 12.0f);
333   TRY(mr.resolve());
334   mover.emit(mr);
335   mover.finish();
336   masm.abiret();
337   JitCode* code = linkAndAllocate(cx, &masm);
338   sim->call(code->raw(), 1, 1);
339   CHECK(int(sim->getFpuRegisterDouble(double0.id())) == 10);
340   CHECK(int(sim->getFpuRegisterFloat(single3.id())) == 15);
341   CHECK(int(sim->getFpuRegisterFloat(single28.id())) == 2);
342   CHECK(int(sim->getFpuRegisterFloat(single25.id())) == 30);
343   CHECK(int(sim->getFpuRegisterFloat(single2.id())) == 16);
344   CHECK(int(sim->getFpuRegisterFloat(single29.id())) == 2);
345   CHECK(int(sim->getFpuRegisterFloat(single10.id())) == 17);
346   CHECK(int(sim->getFpuRegisterFloat(single26.id())) == 9);
347   CHECK(int(sim->getFpuRegisterFloat(single23.id())) == 1);
348   CHECK(int(sim->getFpuRegisterFloat(single6.id())) == 8);
349   CHECK(int(sim->getFpuRegisterFloat(single16.id())) == 24);
350   CHECK(int(sim->getFpuRegisterDouble(double6.id())) == 5);
351   CHECK(int(sim->getFpuRegisterFloat(single30.id())) == 23);
352   CHECK(int(sim->getFpuRegisterFloat(single17.id())) == 27);
353   CHECK(int(sim->getFpuRegisterDouble(double4.id())) == 3);
354   CHECK(int(sim->getFpuRegisterFloat(single27.id())) == 14);
355   CHECK(int(sim->getFpuRegisterFloat(single31.id())) == 2);
356   CHECK(int(sim->getFpuRegisterFloat(single24.id())) == 2);
357   CHECK(int(sim->getFpuRegisterFloat(single11.id())) == 31);
358   CHECK(int(sim->getFpuRegisterFloat(single7.id())) == 24);
359   CHECK(int(sim->getFpuRegisterFloat(single21.id())) == 0);
360   CHECK(int(sim->getFpuRegisterFloat(single20.id())) == 27);
361   CHECK(int(sim->getFpuRegisterFloat(single5.id())) == 14);
362   CHECK(int(sim->getFpuRegisterFloat(single14.id())) == 2);
363   CHECK(int(sim->getFpuRegisterFloat(single22.id())) == 12);
364   return true;
365 }
366 END_TEST(testJitMoveEmitterCycles_autogen2)
367 
BEGIN_TEST(testJitMoveEmitterCycles_autogen3)368 BEGIN_TEST(testJitMoveEmitterCycles_autogen3) {
369   using namespace js;
370   using namespace js::jit;
371   LifoAlloc lifo(LIFO_ALLOC_PRIMARY_CHUNK_SIZE);
372   TempAllocator alloc(&lifo);
373   JitContext jc(cx, &alloc);
374   StackMacroAssembler masm;
375   MoveEmitter mover(masm);
376   MoveResolver mr;
377   mr.setAllocator(alloc);
378   Simulator* sim = Simulator::Current();
379   TRY(mr.addMove(MoveOperand(single0), MoveOperand(single21), MoveOp::FLOAT32));
380   sim->setFpuRegisterFloat(single0.id(), 0.0f);
381   TRY(mr.addMove(MoveOperand(single2), MoveOperand(single26), MoveOp::FLOAT32));
382   sim->setFpuRegisterFloat(single2.id(), 2.0f);
383   TRY(mr.addMove(MoveOperand(single4), MoveOperand(single24), MoveOp::FLOAT32));
384   sim->setFpuRegisterFloat(single4.id(), 4.0f);
385   TRY(mr.addMove(MoveOperand(single22), MoveOperand(single9), MoveOp::FLOAT32));
386   sim->setFpuRegisterFloat(single22.id(), 22.0f);
387   TRY(mr.addMove(MoveOperand(single5), MoveOperand(single28), MoveOp::FLOAT32));
388   sim->setFpuRegisterFloat(single5.id(), 5.0f);
389   TRY(mr.addMove(MoveOperand(single15), MoveOperand(single7), MoveOp::FLOAT32));
390   sim->setFpuRegisterFloat(single15.id(), 15.0f);
391   TRY(mr.addMove(MoveOperand(single26), MoveOperand(single14),
392                  MoveOp::FLOAT32));
393   sim->setFpuRegisterFloat(single26.id(), 26.0f);
394   TRY(mr.addMove(MoveOperand(single13), MoveOperand(single30),
395                  MoveOp::FLOAT32));
396   sim->setFpuRegisterFloat(single13.id(), 13.0f);
397   TRY(mr.addMove(MoveOperand(single26), MoveOperand(single22),
398                  MoveOp::FLOAT32));
399   sim->setFpuRegisterFloat(single26.id(), 26.0f);
400   TRY(mr.addMove(MoveOperand(single21), MoveOperand(single6), MoveOp::FLOAT32));
401   sim->setFpuRegisterFloat(single21.id(), 21.0f);
402   TRY(mr.addMove(MoveOperand(single23), MoveOperand(single31),
403                  MoveOp::FLOAT32));
404   sim->setFpuRegisterFloat(single23.id(), 23.0f);
405   TRY(mr.addMove(MoveOperand(single7), MoveOperand(single12), MoveOp::FLOAT32));
406   sim->setFpuRegisterFloat(single7.id(), 7.0f);
407   TRY(mr.addMove(MoveOperand(single14), MoveOperand(single10),
408                  MoveOp::FLOAT32));
409   sim->setFpuRegisterFloat(single14.id(), 14.0f);
410   TRY(mr.addMove(MoveOperand(double12), MoveOperand(double8), MoveOp::DOUBLE));
411   sim->setFpuRegisterDouble(double12.id(), 12.0);
412   TRY(mr.addMove(MoveOperand(single5), MoveOperand(single1), MoveOp::FLOAT32));
413   sim->setFpuRegisterFloat(single5.id(), 5.0f);
414   TRY(mr.addMove(MoveOperand(double12), MoveOperand(double2), MoveOp::DOUBLE));
415   sim->setFpuRegisterDouble(double12.id(), 12.0);
416   TRY(mr.addMove(MoveOperand(single3), MoveOperand(single8), MoveOp::FLOAT32));
417   sim->setFpuRegisterFloat(single3.id(), 3.0f);
418   TRY(mr.addMove(MoveOperand(single14), MoveOperand(single0), MoveOp::FLOAT32));
419   sim->setFpuRegisterFloat(single14.id(), 14.0f);
420   TRY(mr.addMove(MoveOperand(single28), MoveOperand(single29),
421                  MoveOp::FLOAT32));
422   sim->setFpuRegisterFloat(single28.id(), 28.0f);
423   TRY(mr.addMove(MoveOperand(single29), MoveOperand(single2), MoveOp::FLOAT32));
424   sim->setFpuRegisterFloat(single29.id(), 29.0f);
425   TRY(mr.addMove(MoveOperand(single22), MoveOperand(single27),
426                  MoveOp::FLOAT32));
427   sim->setFpuRegisterFloat(single22.id(), 22.0f);
428   TRY(mr.addMove(MoveOperand(single21), MoveOperand(single11),
429                  MoveOp::FLOAT32));
430   sim->setFpuRegisterFloat(single21.id(), 21.0f);
431   TRY(mr.addMove(MoveOperand(single22), MoveOperand(single13),
432                  MoveOp::FLOAT32));
433   sim->setFpuRegisterFloat(single22.id(), 22.0f);
434   TRY(mr.addMove(MoveOperand(single29), MoveOperand(single25),
435                  MoveOp::FLOAT32));
436   sim->setFpuRegisterFloat(single29.id(), 29.0f);
437   TRY(mr.addMove(MoveOperand(single29), MoveOperand(single15),
438                  MoveOp::FLOAT32));
439   sim->setFpuRegisterFloat(single29.id(), 29.0f);
440   TRY(mr.addMove(MoveOperand(single16), MoveOperand(single23),
441                  MoveOp::FLOAT32));
442   sim->setFpuRegisterFloat(single16.id(), 16.0f);
443   TRY(mr.resolve());
444   mover.emit(mr);
445   mover.finish();
446   masm.abiret();
447   JitCode* code = linkAndAllocate(cx, &masm);
448   sim->call(code->raw(), 1, 1);
449   CHECK(int(sim->getFpuRegisterFloat(single21.id())) == 0);
450   CHECK(int(sim->getFpuRegisterFloat(single26.id())) == 2);
451   CHECK(int(sim->getFpuRegisterFloat(single24.id())) == 4);
452   CHECK(int(sim->getFpuRegisterFloat(single9.id())) == 22);
453   CHECK(int(sim->getFpuRegisterFloat(single28.id())) == 5);
454   CHECK(int(sim->getFpuRegisterFloat(single7.id())) == 15);
455   CHECK(int(sim->getFpuRegisterFloat(single14.id())) == 26);
456   CHECK(int(sim->getFpuRegisterFloat(single30.id())) == 13);
457   CHECK(int(sim->getFpuRegisterFloat(single22.id())) == 26);
458   CHECK(int(sim->getFpuRegisterFloat(single6.id())) == 21);
459   CHECK(int(sim->getFpuRegisterFloat(single31.id())) == 23);
460   CHECK(int(sim->getFpuRegisterFloat(single12.id())) == 7);
461   CHECK(int(sim->getFpuRegisterFloat(single10.id())) == 14);
462   CHECK(int(sim->getFpuRegisterDouble(double8.id())) == 12);
463   CHECK(int(sim->getFpuRegisterFloat(single1.id())) == 5);
464   CHECK(int(sim->getFpuRegisterDouble(double2.id())) == 12);
465   CHECK(int(sim->getFpuRegisterFloat(single8.id())) == 3);
466   CHECK(int(sim->getFpuRegisterFloat(single0.id())) == 14);
467   CHECK(int(sim->getFpuRegisterFloat(single29.id())) == 28);
468   CHECK(int(sim->getFpuRegisterFloat(single2.id())) == 29);
469   CHECK(int(sim->getFpuRegisterFloat(single27.id())) == 22);
470   CHECK(int(sim->getFpuRegisterFloat(single3.id())) == 3);
471   CHECK(int(sim->getFpuRegisterFloat(single11.id())) == 21);
472   CHECK(int(sim->getFpuRegisterFloat(single13.id())) == 22);
473   CHECK(int(sim->getFpuRegisterFloat(single25.id())) == 29);
474   CHECK(int(sim->getFpuRegisterFloat(single15.id())) == 29);
475   CHECK(int(sim->getFpuRegisterFloat(single23.id())) == 16);
476   return true;
477 }
478 END_TEST(testJitMoveEmitterCycles_autogen3)
479 
480 #endif
481