aboutsummaryrefslogtreecommitdiff
path: root/deps/lightning/lib/jit_sparc-fpu.c
blob: ae2cbab35be2d3395269cff60fc70b2c2e80b18b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
/*
 * Copyright (C) 2013-2019  Free Software Foundation, Inc.
 *
 * This file is part of GNU lightning.
 *
 * GNU lightning is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation; either version 3, or (at your option)
 * any later version.
 *
 * GNU lightning is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
 * License for more details.
 *
 * Authors:
 *	Paulo Cesar Pereira de Andrade
 */

#if PROTO
#  if __WORDSIZE == 32
#    define FPR(r)			(r)
#    define CLASS_SNG			jit_class_fpr
#    define CLASS_DBL			jit_class_fpr
#  else
#    define single_precision_p(r)	((r) >= 0 && (r) <= 31)
#    define FPR(r)			((r) > 31 ? (r) - 31 : (r))
#    define CLASS_SNG			(jit_class_fpr | jit_class_sng)
#    define CLASS_DBL			(jit_class_fpr | jit_class_dbl)
#  endif
#  define LDF(rs1, rs2, rd)		f3r(3, FPR(rd), 32, FPR(rs1), FPR(rs2))
#  define LDFI(rs1, imm, rd)		f3i(3, FPR(rd), 32, FPR(rs1), imm)
#  define LDDF(rs1, rs2, rd)		f3r(3, FPR(rd), 35, FPR(rs1), FPR(rs2))
#  define LDDFI(rs1, imm, rd)		f3i(3, FPR(rd), 35, FPR(rs1), imm)
#  define LDFSR(rs1, rs2, rd)		f3r(3, FPR(rd), 33, FPR(rs1), FPR(rs2))
#  define LDFSRI(rs1, imm, rd)		f3i(3, FPR(rd), 33, FPR(rs1), imm)
#  define STF(rd, rs1, rs2)		f3r(3, FPR(rd), 36, FPR(rs1), FPR(rs2))
#  define STFI(rd, rs1, imm)		f3i(3, FPR(rd), 36, FPR(rs1), imm)
#  define STDF(rd, rs1, rs2)		f3r(3, FPR(rd), 39, FPR(rs1), FPR(rs2))
#  define STDFI(rd, rs1, imm)		f3i(3, FPR(rd), 39, FPR(rs1), imm)
#  define STFSR(rd, rs1, rs2)		f3r(3, FPR(rd), 37, FPR(rs1), FPR(rs2))
#  define STFSRI(rd, rs1, imm)		f3i(3, FPR(rd), 37, FPR(rs1), imm)
#  define STDFQ(rd, rs1, rs2)		f3r(3, FPR(rd), 38, FPR(rs1), FPR(rs2))
#  define STFDFQ(rd, rs1, imm)		f3i(3, FPR(rd), 38, FPR(rs1), imm)
#  define SPARC_FBA			8	/* always - 1 */
#  define SPARC_FBN			0	/* never - 0 */
#  define SPARC_FBU			7	/* unordered - U */
#  define SPARC_FBG			6	/* greater - G */
#  define SPARC_FBUG			5	/* unordered or greater - G or U */
#  define SPARC_FBL			4	/* less - L */
#  define SPARC_FBUL			3	/* unordered or less - L or U */
#  define SPARC_FBLG			2	/* less or greater - L or G */
#  define SPARC_FBNE			1	/* not equal - L or G or U */
#  define SPARC_FBNZ			SPARC_FBNE
#  define SPARC_FBE			9	/* equal - E */
#  define SPARC_FBZ			SPARC_FBE
#  define SPARC_FBUE			10	/* unordered or equal - E or U */
#  define SPARC_FBGE			11	/* greater or equal - E or G */
#  define SPARC_FBUGE			12	/* unordered or greater or equal - E or G or U */
#  define SPARC_FBLE			13	/* less or equal - E or L */
#  define SPARC_FBULE			14	/* unordered or less or equal - E or L or U */
#  define SPARC_FBO			15	/* ordered - E or L or G */
#  define FB(cc, imm)			f2b(0, 0, cc, 6, imm)
#  define FBa(cc, imm)			f2b(0, 1, cc, 6, imm)
#  define FBA(imm)			FB(SPARC_FBA, imm)
#  define FBAa(imm)			FBa(SPARC_FBA, imm)
#  define FBN(imm)			FB(SPARC_FBN, imm)
#  define FBNa(imm)			FBa(SPARC_FBN, imm)
#  define FBU(imm)			FB(SPARC_FBU, imm)
#  define FBUa(imm)			FBa(SPARC_FBU, imm)
#  define FBG(imm)			FB(SPARC_FBG, imm)
#  define FBGa(imm)			FBa(SPARC_FBG, imm)
#  define FBUG(imm)			FB(SPARC_FBUG, imm)
#  define FBUGa(imm)			FBa(SPARC_FBUG, imm)
#  define FBL(imm)			FB(SPARC_FBL, imm)
#  define FBLa(imm)			FBa(SPARC_FBL, imm)
#  define FBUL(imm)			FB(SPARC_FBUL, imm)
#  define FBULa(imm)			FBa(SPARC_FBUL, imm)
#  define FBLG(imm)			FB(SPARC_FBLG, imm)
#  define FBLGa(imm)			FBa(SPARC_FBLG, imm)
#  define FBNE(imm)			FB(SPARC_FBNE, imm)
#  define FBNEa(imm)			FBa(SPARC_FBNE, imm)
#  define FBE(imm)			FB(SPARC_FBE, imm)
#  define FBEa(imm)			FBa(SPARC_FBE, imm)
#  define FBUE(imm)			FB(SPARC_FBUE, imm)
#  define FBUEa(imm)			FBa(SPARC_FBUE, imm)
#  define FBLE(imm)			FB(SPARC_FBLE, imm)
#  define FBLEa(imm)			FBa(SPARC_FBLE, imm)
#  define FBO(imm)			FB(SPARC_FBO, imm)
#  define FBOa(imm)			FBa(SPARC_FBO, imm)
#  define FPop1(rd, rs1, opf, rs2)	f3f(rd, 52, rs1, opf, rs2)
#  define FPop2(rd, rs1, opf, rs2)	f3f(rd, 53, rs1, opf, rs2)
#  define f3f(rd, op3, rs1, opf, rs2)	_f3f(_jit, rd, op3, rs1, opf, rs2)
static void
_f3f(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t, jit_int32_t,jit_int32_t);
#  define FITOS(rs2, rd)		FPop1(rd, 0, 196, rs2)
#  define FITOD(rs2, rd)		FPop1(rd, 0, 200, rs2)
#  define FITOQ(rs2, rd)		FPop1(rd, 0, 204, rs2)
#  if __WORDSIZE == 64
#    define FXTOS(rs2, rd)		FPop1(rd, 0, 132, rs2)
#    define FXTOD(rs2, rd)		FPop1(rd, 0, 136, rs2)
#    define FxTOQ(rs2, rd)		FPop1(rd, 0, 140, rs2)
#  endif
#  define FSTOI(rs2, rd)		FPop1(rd, 0, 209, rs2)
#  define FDTOI(rs2, rd)		FPop1(rd, 0, 210, rs2)
#  define FQTOI(rs2, rd)		FPop1(rd, 0, 211, rs2)
#  define FSTOX(rs2, rd)		FPop1(rd, 0, 129, rs2)
#  define FDTOX(rs2, rd)		FPop1(rd, 0, 130, rs2)
#  define FQTOX(rs2, rd)		FPop1(rd, 0, 131, rs2)
#  define FSTOD(rs2, rd)		FPop1(rd, 0, 201, rs2)
#  define FSTOQ(rs2, rd)		FPop1(rd, 0, 205, rs2)
#  define FDTOS(rs2, rd)		FPop1(rd, 0, 198, rs2)
#  define FDTOQ(rs2, rd)		FPop1(rd, 0, 206, rs2)
#  define FQTOS(rs2, rd)		FPop1(rd, 0, 199, rs2)
#  define FQTOD(rs2, rd)		FPop1(rd, 0, 203, rs2)
#  define FMOVS(rs2, rd)		FPop1(rd, 0,   1, rs2)
#  define FMOVD(rs2, rd)		FPop1(rd, 0,   2, rs2)
#  define FMOVQ(rs2, rd)		FPop1(rd, 0,   3, rs2)
#  define FNEGS(rs2, rd)		FPop1(rd, 0,   5, rs2)
#  define FNEGD(rs2, rd)		FPop1(rd, 0,   6, rs2)
#  define FNEGQ(rs2, rd)		FPop1(rd, 0,   7, rs2)
#  define FABSS(rs2, rd)		FPop1(rd, 0,   9, rs2)
#  define FABSD(rs2, rd)		FPop1(rd, 0,  10, rs2)
#  define FABSQ(rs2, rd)		FPop1(rd, 0,  11, rs2)
#  define FSQRTS(rs2, rd)		FPop1(rd, 0,  41, rs2)
#  define FSQRTD(rs2, rd)		FPop1(rd, 0,  42, rs2)
#  define FSQRTQ(rs2, rd)		FPop1(rd, 0,  43, rs2)
#  define SPARC_FADDS			65
#  define SPARC_FADDD			66
#  define SPARC_FADDQ			67
#  define SPARC_FSUBS			69
#  define SPARC_FSUBD			70
#  define SPARC_FSUBQ			71
#  define SPARC_FMULS			73
#  define SPARC_FMULD			74
#  define SPARC_FMULQ			75
#  define SPARC_FSMULD			105
#  define SPARC_FDMULQ			110
#  define SPARC_FDIVS			77
#  define SPARC_FDIVD			78
#  define SPARC_FDIVQ			79
#  define FADDS(rs1, rs2, rd)		FPop1(rd, rs1,  SPARC_FADDS, rs2)
#  define FADDD(rs1, rs2, rd)		FPop1(rd, rs1,  SPARC_FADDD, rs2)
#  define FADDQ(rs1, rs2, rd)		FPop1(rd, rs1,  SPARC_FADDQ, rs2)
#  define FSUBS(rs1, rs2, rd)		FPop1(rd, rs1,  SPARC_FSUBS, rs2)
#  define FSUBD(rs1, rs2, rd)		FPop1(rd, rs1,  SPARC_FSUBD, rs2)
#  define FSUBQ(rs1, rs2, rd)		FPop1(rd, rs1,  SPARC_FSUBQ, rs2)
#  define FMULS(rs1, rs2, rd)		FPop1(rd, rs1,  SPARC_FMULS, rs2)
#  define FMULD(rs1, rs2, rd)		FPop1(rd, rs1,  SPARC_FMULD, rs2)
#  define FMULQ(rs1, rs2, rd)		FPop1(rd, rs1,  SPARC_FMULQ, rs2)
#  define FSMULD(rs1, rs2, rd)		FPop1(rd, rs1,  SPARC_FSMULD, rs2)
#  define FDMULQ(rs1, rs2, rd)		FPop1(rd, rs1,  SPARC_FDMULQ, rs2)
#  define FDIVS(rs1, rs2, rd)		FPop1(rd, rs1,  SPARC_FDIVS, rs2)
#  define FDIVD(rs1, rs2, rd)		FPop1(rd, rs1,  SPARC_FDIVD, rs2)
#  define FDIVQ(rs1, rs2, rd)		FPop1(rd, rs1,  SPARC_FDIVQ, rs2)
#  define SPARC_FCMPS			81
#  define SPARC_FCMPD			82
#  define SPARC_FCMPQ			83
#  define SPARC_FCMPES			85
#  define SPARC_FCMPED			86
#  define SPARC_FCMPEQ			87
#  define FCMPS(rs1, rs2)		FPop2(0, rs1, SPARC_FCMPS, rs2)
#  define FCMPD(rs1, rs2)		FPop2(0, rs1, SPARC_FCMPD, rs2)
#  define FCMPQ(rs1, rs2)		FPop2(0, rs1, SPARC_FCMPQ, rs2)
#  define FCMPES(rs1, rs2)		FPop2(0, rs1, SPARC_FCMPES, rs2)
#  define FCMPED(rs1, rs2)		FPop2(0, rs1, SPARC_FCMPED, rs2)
#  define FCMPEQ(rs1, rs2)		FPop2(0, rs1, SPARC_FCMPEQ, rs2)
#  define CPop1(rd, rs1, opc, rs2)	f3f(rd, 54, rs1, opf, rs2)
#  define CPop2(rd, rs1, opc, rs2)	f3f(rd, 55, rs1, opf, rs2)
#  define extr_f(r0, r1)		_extr_f(_jit, r0, r1)
static void _extr_f(jit_state_t*, jit_int32_t, jit_int32_t);
#  if __WORDSIZSE == 32
#    define truncr_f(r0, r1)		truncr_f_i(r0, r1)
#  define truncr_d(r0, r1)		truncr_d_i(r0, r1)
#  else
#    define truncr_f(r0, r1)		truncr_f_l(r0, r1)
#  define truncr_d(r0, r1)		truncr_d_l(r0, r1)
#  endif
#  define truncr_f_i(r0, r1)		_truncr_f_i(_jit, r0, r1)
static void _truncr_f_i(jit_state_t*, jit_int32_t, jit_int32_t);
#  if __WORDSIZE == 64
#    define truncr_f_l(r0, r1)		_truncr_f_l(_jit, r0, r1)
static void _truncr_f_l(jit_state_t*, jit_int32_t, jit_int32_t);
#  endif
#  if __WORDSIZE == 32
#    define extr_d_f(r0, r1)		FDTOS(r1, r0)
#  else
#    define extr_d_f(r0, r1)		_extr_d_f(_jit, r0, r1)
static void _extr_d_f(jit_state_t*, jit_int32_t, jit_int32_t);
#  endif
#  define movi_f(r0, i0)		_movi_f(_jit, r0, i0)
#  if __WORDSIZE == 32
#    define movr_f(r0, r1)		FMOVS(r1, r0)
#  else
#    define movr_f(r0, r1)		_movr_f(_jit, r0, r1)
static void _movr_f(jit_state_t*, jit_int32_t, jit_int32_t);
#  endif
static void _movi_f(jit_state_t*, jit_int32_t, jit_float32_t*);
#  if __WORDSIZE == 32
#    define negr_f(r0, r1)		FNEGS(r1, r0)
#    define absr_f(r0, r1)		FABSS(r1, r0)
#    define sqrtr_f(r0, r1)		FSQRTS(r1, r0)
#  else
#    define negr_f(r0, r1)		_negr_f(_jit, r0, r1)
static void _negr_f(jit_state_t*, jit_int32_t, jit_int32_t);
#    define absr_f(r0, r1)		_absr_f(_jit, r0, r1)
static void _absr_f(jit_state_t*, jit_int32_t, jit_int32_t);
#    define sqrtr_f(r0, r1)		_sqrtr_f(_jit, r0, r1)
static void _sqrtr_f(jit_state_t*, jit_int32_t, jit_int32_t);
#  endif
#  define extr_d(r0, r1)		_extr_d(_jit, r0, r1)
static void _extr_d(jit_state_t*, jit_int32_t, jit_int32_t);
#  define truncr_d_i(r0, r1)		_truncr_d_i(_jit, r0, r1)
static void _truncr_d_i(jit_state_t*, jit_int32_t, jit_int32_t);
#  if __WORDSIZE == 64
#    define truncr_d_l(r0, r1)		_truncr_d_l(_jit, r0, r1)
static void _truncr_d_l(jit_state_t*, jit_int32_t, jit_int32_t);
#  endif
#  if __WORDSIZE == 32
#    define extr_f_d(r0, r1)		FSTOD(r1, r0)
#  else
#    define extr_f_d(r0, r1)		_extr_f_d(_jit, r0, r1)
static void _extr_f_d(jit_state_t*, jit_int32_t, jit_int32_t);
#  endif
#  define movi_d(r0, i0)		_movi_d(_jit, r0, i0)
static void _movi_d(jit_state_t*, jit_int32_t, jit_float64_t*);
#  if __WORDSIZE == 32
#  define movr_d(r0, r1)		_movr_d(_jit, r0, r1)
static void _movr_d(jit_state_t*, jit_int32_t, jit_int32_t);
#  define negr_d(r0, r1)		_negr_d(_jit, r0, r1)
static void _negr_d(jit_state_t*, jit_int32_t, jit_int32_t);
#  define absr_d(r0, r1)		_absr_d(_jit, r0, r1)
static void _absr_d(jit_state_t*, jit_int32_t, jit_int32_t);
#  else
#    define movr_d(r0, r1)		FMOVD(r1, r0)
#    define negr_d(r0, r1)		FNEGD(r1, r0)
#    define absr_d(r0, r1)		FABSD(r1, r0)
#  endif
#  define sqrtr_d(r0, r1)		FSQRTD(r1, r0)
#  define fop1f(op, r0, r1, i0)		_fop1f(_jit, op, r0, r1, i0)
static void _fop1f(jit_state_t*,jit_int32_t,
		   jit_int32_t,jit_int32_t,jit_float32_t*);
#  define rfop1f(op, r0, r1, i0)	_rfop1f(_jit, op, r0, r1, i0)
static void _rfop1f(jit_state_t*,jit_int32_t,
		    jit_int32_t,jit_int32_t,jit_float32_t*);
#  define fop1d(op, r0, r1, i0)		_fop1d(_jit, op, r0, r1, i0)
static void _fop1d(jit_state_t*,jit_int32_t,
		   jit_int32_t,jit_int32_t,jit_float64_t*);
#  define rfop1d(op, r0, r1, i0)	_rfop1d(_jit, op, r0, r1, i0)
static void _rfop1d(jit_state_t*,jit_int32_t,
		    jit_int32_t,jit_int32_t,jit_float64_t*);
#  if __WORDSIZE == 32
#    define addr_f(r0, r1, r2)		FADDS(r1, r2, r0)
#    define subr_f(r0, r1, r2)		FSUBS(r1, r2, r0)
#    define mulr_f(r0, r1, r2)		FMULS(r1, r2, r0)
#    define divr_f(r0, r1, r2)		FDIVS(r1, r2, r0)
#  else
#    define fop2f(op, r0, r1, r2)	_fop2f(_jit, op, r0, r1, r2)
static void _fop2f(jit_state_t*, jit_int32_t,
		   jit_int32_t, jit_int32_t, jit_int32_t);
#    define addr_f(r0, r1, r2)		fop2f(SPARC_FADDS, r0, r1, r2)
#    define subr_f(r0, r1, r2)		fop2f(SPARC_FSUBS, r0, r1, r2)
#    define mulr_f(r0, r1, r2)		fop2f(SPARC_FMULS, r0, r1, r2)
#    define divr_f(r0, r1, r2)		fop2f(SPARC_FDIVS, r0, r1, r2)
#  endif
#  define addi_f(r0, r1, i0)		fop1f(SPARC_FADDS, r0, r1, i0)
#  define subi_f(r0, r1, i0)		fop1f(SPARC_FSUBS, r0, r1, i0)
#  define rsbr_f(r0, r1, r2)		subr_f(r0, r2, r1)
#  define rsbi_f(r0, r1, i0)		rfop1f(SPARC_FSUBS, r0, r1, i0)
#  define rsbr_d(r0, r1, r2)		subr_d(r0, r2, r1)
#  define rsbi_d(r0, r1, i0)		rfop1d(SPARC_FSUBD, r0, r1, i0)
#  define muli_f(r0, r1, i0)		fop1f(SPARC_FMULS, r0, r1, i0)
#  define divi_f(r0, r1, i0)		fop1f(SPARC_FDIVS, r0, r1, i0)
#  define addr_d(r0, r1, r2)		FADDD(r1, r2, r0)
#  define addi_d(r0, r1, i0)		fop1d(SPARC_FADDD, r0, r1, i0)
#  define subr_d(r0, r1, r2)		FSUBD(r1, r2, r0)
#  define subi_d(r0, r1, i0)		fop1d(SPARC_FSUBD, r0, r1, i0)
#  define rsbr_d(r0, r1, r2)		subr_d(r0, r2, r1)
#  define rsbi_d(r0, r1, i0)		rfop1d(SPARC_FSUBD, r0, r1, i0)
#  define mulr_d(r0, r1, r2)		FMULD(r1, r2, r0)
#  define muli_d(r0, r1, i0)		fop1d(SPARC_FMULD, r0, r1, i0)
#  define divr_d(r0, r1, r2)		FDIVD(r1, r2, r0)
#  define divi_d(r0, r1, i0)		fop1d(SPARC_FDIVD, r0, r1, i0)
#define fcr(cc, r0, r1, r2)		_fcr(_jit, cc, r0, r1, r2)
static void _fcr(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t,jit_int32_t);
#define fcw(cc, r0, r1, i0)		_fcw(_jit, cc, r0, r1, i0)
static void
_fcw(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t,jit_float32_t*);
#  define ltr_f(r0, r1, r2)		fcr(SPARC_FBL, r0, r1, r2)
#  define lti_f(r0, r1, i0)		fcw(SPARC_FBL, r0, r1, i0)
#  define ler_f(r0, r1, r2)		fcr(SPARC_FBLE, r0, r1, r2)
#  define lei_f(r0, r1, i0)		fcw(SPARC_FBLE, r0, r1, i0)
#  define eqr_f(r0, r1, r2)		fcr(SPARC_FBE, r0, r1, r2)
#  define eqi_f(r0, r1, i0)		fcw(SPARC_FBE, r0, r1, i0)
#  define ger_f(r0, r1, r2)		fcr(SPARC_FBGE, r0, r1, r2)
#  define gei_f(r0, r1, i0)		fcw(SPARC_FBGE, r0, r1, i0)
#  define gtr_f(r0, r1, r2)		fcr(SPARC_FBG, r0, r1, r2)
#  define gti_f(r0, r1, i0)		fcw(SPARC_FBG, r0, r1, i0)
#  define ner_f(r0, r1, r2)		fcr(SPARC_FBNE, r0, r1, r2)
#  define nei_f(r0, r1, i0)		fcw(SPARC_FBNE, r0, r1, i0)
#  define unltr_f(r0, r1, r2)		fcr(SPARC_FBUL, r0, r1, r2)
#  define unlti_f(r0, r1, i0)		fcw(SPARC_FBUL, r0, r1, i0)
#  define unler_f(r0, r1, r2)		fcr(SPARC_FBULE, r0, r1, r2)
#  define unlei_f(r0, r1, i0)		fcw(SPARC_FBULE, r0, r1, i0)
#  define uneqr_f(r0, r1, r2)		fcr(SPARC_FBUE, r0, r1, r2)
#  define uneqi_f(r0, r1, i0)		fcw(SPARC_FBUE, r0, r1, i0)
#  define unger_f(r0, r1, r2)		fcr(SPARC_FBUGE, r0, r1, r2)
#  define ungei_f(r0, r1, i0)		fcw(SPARC_FBUGE, r0, r1, i0)
#  define ungtr_f(r0, r1, r2)		fcr(SPARC_FBUG, r0, r1, r2)
#  define ungti_f(r0, r1, i0)		fcw(SPARC_FBUG, r0, r1, i0)
#  define ltgtr_f(r0, r1, r2)		fcr(SPARC_FBLG, r0, r1, r2)
#  define ltgti_f(r0, r1, i0)		fcw(SPARC_FBLG, r0, r1, i0)
#  define ordr_f(r0, r1, r2)		fcr(SPARC_FBO, r0, r1, r2)
#  define ordi_f(r0, r1, i0)		fcw(SPARC_FBO, r0, r1, i0)
#  define unordr_f(r0, r1, r2)		fcr(SPARC_FBU, r0, r1, r2)
#  define unordi_f(r0, r1, i0)		fcw(SPARC_FBU, r0, r1, i0)
#define dcr(cc, r0, r1, r2)		_dcr(_jit, cc, r0, r1, r2)
static void _dcr(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t,jit_int32_t);
#define dcw(cc, r0, r1, i0)		_dcw(_jit, cc, r0, r1, i0)
static void
_dcw(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t,jit_float64_t*);
#  define ltr_d(r0, r1, r2)		dcr(SPARC_FBL, r0, r1, r2)
#  define lti_d(r0, r1, i0)		dcw(SPARC_FBL, r0, r1, i0)
#  define ler_d(r0, r1, r2)		dcr(SPARC_FBLE, r0, r1, r2)
#  define lei_d(r0, r1, i0)		dcw(SPARC_FBLE, r0, r1, i0)
#  define eqr_d(r0, r1, r2)		dcr(SPARC_FBE, r0, r1, r2)
#  define eqi_d(r0, r1, i0)		dcw(SPARC_FBE, r0, r1, i0)
#  define ger_d(r0, r1, r2)		dcr(SPARC_FBGE, r0, r1, r2)
#  define gei_d(r0, r1, i0)		dcw(SPARC_FBGE, r0, r1, i0)
#  define gtr_d(r0, r1, r2)		dcr(SPARC_FBG, r0, r1, r2)
#  define gti_d(r0, r1, i0)		dcw(SPARC_FBG, r0, r1, i0)
#  define ner_d(r0, r1, r2)		dcr(SPARC_FBNE, r0, r1, r2)
#  define nei_d(r0, r1, i0)		dcw(SPARC_FBNE, r0, r1, i0)
#  define unltr_d(r0, r1, r2)		dcr(SPARC_FBUL, r0, r1, r2)
#  define unlti_d(r0, r1, i0)		dcw(SPARC_FBUL, r0, r1, i0)
#  define unler_d(r0, r1, r2)		dcr(SPARC_FBULE, r0, r1, r2)
#  define unlei_d(r0, r1, i0)		dcw(SPARC_FBULE, r0, r1, i0)
#  define uneqr_d(r0, r1, r2)		dcr(SPARC_FBUE, r0, r1, r2)
#  define uneqi_d(r0, r1, i0)		dcw(SPARC_FBUE, r0, r1, i0)
#  define unger_d(r0, r1, r2)		dcr(SPARC_FBUGE, r0, r1, r2)
#  define ungei_d(r0, r1, i0)		dcw(SPARC_FBUGE, r0, r1, i0)
#  define ungtr_d(r0, r1, r2)		dcr(SPARC_FBUG, r0, r1, r2)
#  define ungti_d(r0, r1, i0)		dcw(SPARC_FBUG, r0, r1, i0)
#  define ltgtr_d(r0, r1, r2)		dcr(SPARC_FBLG, r0, r1, r2)
#  define ltgti_d(r0, r1, i0)		dcw(SPARC_FBLG, r0, r1, i0)
#  define ordr_d(r0, r1, r2)		dcr(SPARC_FBO, r0, r1, r2)
#  define ordi_d(r0, r1, i0)		dcw(SPARC_FBO, r0, r1, i0)
#  define unordr_d(r0, r1, r2)		dcr(SPARC_FBU, r0, r1, r2)
#  define unordi_d(r0, r1, i0)		dcw(SPARC_FBU, r0, r1, i0)
#  if __WORDSIZE == 32
#    define ldr_f(r0, r1)		LDF(r1, 0, r0)
#  else
#  define ldr_f(r0, r1)			_ldr_f(_jit, r0, r1)
static void _ldr_f(jit_state_t*,jit_int32_t,jit_int32_t);
#  endif
#  define ldi_f(r0, i0)			_ldi_f(_jit, r0, i0)
static void _ldi_f(jit_state_t*,jit_int32_t,jit_word_t);
#  if __WORDSIZE == 32
#    define ldxr_f(r0, r1, r2)		LDF(r1, r2, r0)
#  else
#  define ldxr_f(r0, r1, r2)		_ldxr_f(_jit, r0, r1, r2)
static void _ldxr_f(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
#  endif
#  define ldxi_f(r0, r1, i0)		_ldxi_f(_jit, r0, r1, i0)
static void _ldxi_f(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
#  if __WORDSIZE == 32
#    define str_f(r0, r1)		STF(r1, r0, 0)
#  else
#  define str_f(r0, r1)			_str_f(_jit, r0, r1)
static void _str_f(jit_state_t*,jit_int32_t,jit_int32_t);
#  endif
#  define sti_f(r0, i0)			_sti_f(_jit, r0, i0)
static void _sti_f(jit_state_t*,jit_word_t,jit_int32_t);
#  if __WORDSIZE == 32
#    define stxr_f(r0, r1, r2)		STF(r2, r1, r0)
#  else
#  define stxr_f(r0, r1, r2)		_stxr_f(_jit, r0, r1, r2)
static void _stxr_f(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
#  endif
#  define stxi_f(r0, r1, i0)		_stxi_f(_jit, r0, r1, i0)
static void _stxi_f(jit_state_t*,jit_word_t,jit_int32_t,jit_int32_t);
#  define ldr_d(r0, r1)			LDDF(r1, 0, r0)
#  define ldi_d(r0, i0)			_ldi_d(_jit, r0, i0)
static void _ldi_d(jit_state_t*,jit_int32_t,jit_word_t);
#  define ldxr_d(r0, r1, r2)		LDDF(r1, r2, r0)
#  define ldxi_d(r0, r1, i0)		_ldxi_d(_jit, r0, r1, i0)
static void _ldxi_d(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
#  define str_d(r0, r1)			STDF(r1, r0, 0)
#  define sti_d(r0, i0)			_sti_d(_jit, r0, i0)
static void _sti_d(jit_state_t*,jit_word_t,jit_int32_t);
#  define stxr_d(r0, r1, r2)		STDF(r2, r1, r0)
#  define stxi_d(r0, r1, i0)		_stxi_d(_jit, r0, r1, i0)
static void _stxi_d(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
#  define fbr(cc, i0, r0, r1)		_fbr(_jit, cc, i0, r0, r1)
static jit_word_t
_fbr(jit_state_t*,jit_int32_t,jit_word_t,jit_int32_t,jit_int32_t);
#  define fbw(cc, i0, r0, i1)		_fbw(_jit, cc, i0, r0, i1)
static jit_word_t
_fbw(jit_state_t*,jit_int32_t,jit_word_t,jit_int32_t,jit_float32_t*);
#  define bltr_f(i0, r0, r1)		fbr(SPARC_FBL, i0, r0, r1)
#  define blti_f(i0, r0, i1)		fbw(SPARC_FBL, i0, r0, i1)
#  define bler_f(i0, r0, r1)		fbr(SPARC_FBLE, i0, r0, r1)
#  define blei_f(i0, r0, i1)		fbw(SPARC_FBLE, i0, r0, i1)
#  define beqr_f(i0, r0, r1)		fbr(SPARC_FBE, i0, r0, r1)
#  define beqi_f(i0, r0, i1)		fbw(SPARC_FBE, i0, r0, i1)
#  define bger_f(i0, r0, r1)		fbr(SPARC_FBGE, i0, r0, r1)
#  define bgei_f(i0, r0, i1)		fbw(SPARC_FBGE, i0, r0, i1)
#  define bgtr_f(i0, r0, r1)		fbr(SPARC_FBG, i0, r0, r1)
#  define bgti_f(i0, r0, i1)		fbw(SPARC_FBG, i0, r0, i1)
#  define bner_f(i0, r0, r1)		fbr(SPARC_FBNE, i0, r0, r1)
#  define bnei_f(i0, r0, i1)		fbw(SPARC_FBNE, i0, r0, i1)
#  define bunltr_f(i0, r0, r1)		fbr(SPARC_FBUL, i0, r0, r1)
#  define bunlti_f(i0, r0, i1)		fbw(SPARC_FBUL, i0, r0, i1)
#  define bunler_f(i0, r0, r1)		fbr(SPARC_FBULE, i0, r0, r1)
#  define bunlei_f(i0, r0, i1)		fbw(SPARC_FBULE, i0, r0, i1)
#  define buneqr_f(i0, r0, r1)		fbr(SPARC_FBUE, i0, r0, r1)
#  define buneqi_f(i0, r0, i1)		fbw(SPARC_FBUE, i0, r0, i1)
#  define bunger_f(i0, r0, r1)		fbr(SPARC_FBUGE, i0, r0, r1)
#  define bungei_f(i0, r0, i1)		fbw(SPARC_FBUGE, i0, r0, i1)
#  define bungtr_f(i0, r0, r1)		fbr(SPARC_FBUG, i0, r0, r1)
#  define bungti_f(i0, r0, i1)		fbw(SPARC_FBUG, i0, r0, i1)
#  define bltgtr_f(i0, r0, r1)		fbr(SPARC_FBLG, i0, r0, r1)
#  define bltgti_f(i0, r0, i1)		fbw(SPARC_FBLG, i0, r0, i1)
#  define bordr_f(i0, r0, r1)		fbr(SPARC_FBO, i0, r0, r1)
#  define bordi_f(i0, r0, i1)		fbw(SPARC_FBO, i0, r0, i1)
#  define bunordr_f(i0, r0, r1)		fbr(SPARC_FBU, i0, r0, r1)
#  define bunordi_f(i0, r0, i1)		fbw(SPARC_FBU, i0, r0, i1)
#  define dbr(cc, i0, r0, r1)		_dbr(_jit, cc, i0, r0, r1)
static jit_word_t
_dbr(jit_state_t*,jit_int32_t,jit_word_t,jit_int32_t,jit_int32_t);
#  define dbw(cc, i0, r0, i1)		_dbw(_jit, cc, i0, r0, i1)
static jit_word_t
_dbw(jit_state_t*,jit_int32_t,jit_word_t,jit_int32_t,jit_float64_t*);
#  define bltr_d(i0, r0, r1)		dbr(SPARC_FBL, i0, r0, r1)
#  define blti_d(i0, r0, i1)		dbw(SPARC_FBL, i0, r0, i1)
#  define bler_d(i0, r0, r1)		dbr(SPARC_FBLE, i0, r0, r1)
#  define blei_d(i0, r0, i1)		dbw(SPARC_FBLE, i0, r0, i1)
#  define beqr_d(i0, r0, r1)		dbr(SPARC_FBE, i0, r0, r1)
#  define beqi_d(i0, r0, i1)		dbw(SPARC_FBE, i0, r0, i1)
#  define bger_d(i0, r0, r1)		dbr(SPARC_FBGE, i0, r0, r1)
#  define bgei_d(i0, r0, i1)		dbw(SPARC_FBGE, i0, r0, i1)
#  define bgtr_d(i0, r0, r1)		dbr(SPARC_FBG, i0, r0, r1)
#  define bgti_d(i0, r0, i1)		dbw(SPARC_FBG, i0, r0, i1)
#  define bner_d(i0, r0, r1)		dbr(SPARC_FBNE, i0, r0, r1)
#  define bnei_d(i0, r0, i1)		dbw(SPARC_FBNE, i0, r0, i1)
#  define bunltr_d(i0, r0, r1)		dbr(SPARC_FBUL, i0, r0, r1)
#  define bunlti_d(i0, r0, i1)		dbw(SPARC_FBUL, i0, r0, i1)
#  define bunler_d(i0, r0, r1)		dbr(SPARC_FBULE, i0, r0, r1)
#  define bunlei_d(i0, r0, i1)		dbw(SPARC_FBULE, i0, r0, i1)
#  define buneqr_d(i0, r0, r1)		dbr(SPARC_FBUE, i0, r0, r1)
#  define buneqi_d(i0, r0, i1)		dbw(SPARC_FBUE, i0, r0, i1)
#  define bunger_d(i0, r0, r1)		dbr(SPARC_FBUGE, i0, r0, r1)
#  define bungei_d(i0, r0, i1)		dbw(SPARC_FBUGE, i0, r0, i1)
#  define bungtr_d(i0, r0, r1)		dbr(SPARC_FBUG, i0, r0, r1)
#  define bungti_d(i0, r0, i1)		dbw(SPARC_FBUG, i0, r0, i1)
#  define bltgtr_d(i0, r0, r1)		dbr(SPARC_FBLG, i0, r0, r1)
#  define bltgti_d(i0, r0, i1)		dbw(SPARC_FBLG, i0, r0, i1)
#  define bordr_d(i0, r0, r1)		dbr(SPARC_FBO, i0, r0, r1)
#  define bordi_d(i0, r0, i1)		dbw(SPARC_FBO, i0, r0, i1)
#  define bunordr_d(i0, r0, r1)		dbr(SPARC_FBU, i0, r0, r1)
#  define bunordi_d(i0, r0, i1)		dbw(SPARC_FBU, i0, r0, i1)
#  define vaarg_d(r0, r1)		_vaarg_d(_jit, r0, r1)
static void _vaarg_d(jit_state_t*, jit_int32_t, jit_int32_t);
#endif

#if CODE
static void
_f3f(jit_state_t *_jit, jit_int32_t rd,
     jit_int32_t op3, jit_int32_t rs1, jit_int32_t opf, jit_int32_t rs2)
{
    jit_instr_t		v;
#  if __WORDSIZE == 64
    if (rd > 31) {
	assert(rd <= 63 && (rd & 1) == 0);
	rd -= 31;
    }
    if (rs1 > 31) {
	assert(rs1 <= 63 && (rs1 & 1) == 0);
	rs1 -= 31;
    }
    if (rs2 > 31) {
	assert(rs2 <= 63 && (rs2 & 1) == 0);
	rs2 -= 31;
    }
#  endif
    assert(!(rd  & 0xffffffe0));
    assert(!(op3 & 0xffffffc0));
    assert(!(rs1 & 0xffffffe0));
    assert(!(opf & 0xfffffe00));
    assert(!(rs2 & 0xffffffe0));
    v.op.b    = 2;
    v.rd.b    = rd;
    v.op3.b   = op3;
    v.rs1.b   = rs1;
    v.opf.b   = opf;
    v.rs2.b   = rs2;
    ii(v.v);
}

#  if __WORDSIZE == 64
static void
_movr_f(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
    jit_int32_t		t0, t1;
    if (r0 != r1) {
	if (single_precision_p(r0)) {
	    if (single_precision_p(r1))
		FMOVS(r1, r0);
	    else {
		t1 = jit_get_reg(CLASS_SNG);
		movr_d(rn(t1), r1);
		FMOVS(rn(t1), r0);
		jit_unget_reg(t1);
	    }
	}
	else {
	    if (single_precision_p(r1)) {
		t0 = jit_get_reg(CLASS_SNG);
		FMOVS(r1, rn(t0));
		movr_d(r0, rn(t0));
		jit_unget_reg(t0);
	    }
	    else {
		t1 = jit_get_reg(CLASS_SNG);
		movr_d(rn(t1), r1);
		FMOVS(rn(t1), rn(t1));
		movr_d(r0, rn(t1));
		jit_unget_reg(t1);
	    }
	}
    }
}

static void
_negr_f(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
    jit_int32_t		t0, t1;
    if (single_precision_p(r0)) {
	if (single_precision_p(r1))
	    FNEGS(r1, r0);
	else {
	    t1 = jit_get_reg(CLASS_SNG);
	    movr_d(rn(t1), r1);
	    FNEGS(rn(t1), r0);
	    jit_unget_reg(t1);
	}
    }
    else {
	if (single_precision_p(r1)) {
	    t0 = jit_get_reg(CLASS_SNG);
	    FNEGS(r1, rn(t0));
	    movr_d(r0, rn(t0));
	    jit_unget_reg(t0);
	}
	else {
	    t1 = jit_get_reg(CLASS_SNG);
	    movr_d(rn(t1), r1);
	    FNEGS(rn(t1), rn(t1));
	    movr_d(r0, rn(t1));
	    jit_unget_reg(t1);
	}
    }
}

static void
_absr_f(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
    jit_int32_t		t0, t1;
    if (single_precision_p(r0)) {
	if (single_precision_p(r1))
	    FABSS(r1, r0);
	else {
	    t1 = jit_get_reg(CLASS_SNG);
	    movr_d(rn(t1), r1);
	    FABSS(rn(t1), r0);
	    jit_unget_reg(t1);
	}
    }
    else {
	if (single_precision_p(r1)) {
	    t0 = jit_get_reg(CLASS_SNG);
	    FABSS(r1, rn(t0));
	    movr_d(r0, rn(t0));
	    jit_unget_reg(t0);
	}
	else {
	    t1 = jit_get_reg(CLASS_SNG);
	    movr_d(rn(t1), r1);
	    FABSS(rn(t1), rn(t1));
	    movr_d(r0, rn(t1));
	    jit_unget_reg(t1);
	}
    }
}

static void
_sqrtr_f(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
    jit_int32_t		t0, t1;
    if (single_precision_p(r0)) {
	if (single_precision_p(r1))
	    FSQRTS(r1, r0);
	else {
	    t1 = jit_get_reg(CLASS_SNG);
	    movr_d(rn(t1), r1);
	    FSQRTS(rn(t1), r0);
	    jit_unget_reg(t1);
	}
    }
    else {
	if (single_precision_p(r1)) {
	    t0 = jit_get_reg(CLASS_SNG);
	    FSQRTS(r1, rn(t0));
	    movr_d(r0, rn(t0));
	    jit_unget_reg(t0);
	}
	else {
	    t1 = jit_get_reg(CLASS_SNG);
	    movr_d(rn(t1), r1);
	    FSQRTS(rn(t1), rn(t1));
	    movr_d(r0, rn(t1));
	    jit_unget_reg(t1);
	}
    }
}
#  endif

#  if __WORDSIZE == 64
static void
_extr_d_f(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
    jit_int32_t		reg;
    if (!single_precision_p(r0)) {
	reg = jit_get_reg(CLASS_SNG);
	movr_d(rn(reg), r0);
	FDTOS(r1, rn(reg));
	movr_d(r0, rn(reg));
	jit_unget_reg(reg);
    }
    else
	FDTOS(r1, r0);
}
#  endif

static void
_movi_f(jit_state_t *_jit, jit_int32_t r0, jit_float32_t *i0)
{
    union {
	jit_int32_t	 i;
	jit_float32_t	 f;
    } data;
    jit_int32_t		 reg;

    if (_jitc->no_data) {
	data.f = *i0;
	reg = jit_get_reg(jit_class_gpr);
	movi(rn(reg), data.i & 0xffffffff);
	stxi_i(BIAS(-8), _FP_REGNO, rn(reg));
	jit_unget_reg(reg);
	ldxi_f(r0, _FP_REGNO, BIAS(-8));
    }
    else
	ldi_f(r0, (jit_word_t)i0);
}

#  if __WORDSIZE == 64
static void
_extr_f_d(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
    jit_int32_t		reg;
    if (!single_precision_p(r1)) {
	reg = jit_get_reg(CLASS_SNG);
	movr_d(rn(reg), r1);
	FSTOD(rn(reg), r0);
	jit_unget_reg(reg);
    }
    else
	FSTOD(r1, r0);
}
#  endif

static void
_movi_d(jit_state_t *_jit, jit_int32_t r0, jit_float64_t *i0)
{
    union {
#  if __WORDSIZE == 32
	jit_int32_t	 i[2];
#  else
	jit_word_t	 w;
#  endif
	jit_float64_t	 d;
    } data;
    jit_int32_t		 reg;

    if (_jitc->no_data) {
	data.d = *i0;
	reg = jit_get_reg(jit_class_gpr);
# if __WORDSIZE == 32
	movi(rn(reg), data.i[0]);
#  else
	movi(rn(reg), data.w);
#  endif
	stxi(BIAS(-8), _FP_REGNO, rn(reg));
#  if __WORDSIZE == 32
	movi(rn(reg), data.i[1]);
	stxi_i(BIAS(-4), _FP_REGNO, rn(reg));
#  endif
	jit_unget_reg(reg);
	ldxi_d(r0, _FP_REGNO, BIAS(-8));
    }
    else
	ldi_d(r0, (jit_word_t)i0);
}

#  if __WORDSIZE == 32
static void
_movr_d(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
    assert(!(r0 & 1));
    assert(!(r1 & 1));
    if (r0 != r1) {
	FMOVS(r1, r0);
	FMOVS(r1 + 1, r0 + 1);
    }
}

static void
_negr_d(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
    assert(!(r0 & 1));
    assert(!(r1 & 1));
    FNEGS(r1, r0);
    if (r0 != r1)
	FMOVS(r1 + 1, r0 + 1);
}

static void
_absr_d(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
    assert(!(r0 & 1));
    assert(!(r1 & 1));
    FABSS(r1, r0);
    if (r0 != r1)
	FMOVS(r1 + 1, r0 + 1);
}
#  endif

#  if __WORDSIZE == 64
#    define single_rrr(NAME, CODE)					\
static void								\
NAME(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)	\
{									\
    jit_int32_t		x0, t0, x1, t1, x2, t2, mask = 0;		\
    if (!single_precision_p(r0)) {					\
	mask |= 1;							\
	t0 = jit_get_reg(CLASS_SNG);					\
	x0 = rn(t0);							\
	if (r0 == r1) {							\
	    x1 = x0;							\
	    movr_d(x1, r1);						\
	    if (r0 == r2)						\
		x2 = x0;						\
	}								\
	else if (r0 == r2) {						\
	    x2 = x0;							\
	    movr_d(x2, r2);						\
	}								\
    }									\
    else								\
	x0 = r0;							\
    if (!single_precision_p(r1)) {					\
	if (r0 != r1) {							\
	    mask |= 2;							\
	    t1 = jit_get_reg(CLASS_SNG);				\
	    x1 = rn(t1);						\
	    movr_d(x1, r1);						\
	    if (r1 == r2)						\
		x2 = x1;						\
	}								\
    }									\
    else								\
	x1 = r1;							\
    if (!single_precision_p(r2)) {					\
	if (r0 != r2 && r1 != r2) {					\
	    mask |= 4;							\
	    t2 = jit_get_reg(CLASS_SNG);				\
	    x2 = rn(t2);						\
	    movr_d(x2, r2);						\
	}								\
    }									\
    else								\
	x2 = r2;							\
    CODE(x1, x2, x0);							\
    if (mask & 1) {							\
	movr_d(r0, x0);							\
	jit_unget_reg(t0);						\
    }									\
    if (mask & 2)							\
	jit_unget_reg(t1);						\
    if (mask & 4)							\
	jit_unget_reg(t2);						\
}

static void
_fop2f(jit_state_t *_jit, jit_int32_t op,
       jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
    jit_int32_t		x0, t0, x1, t1, x2, t2, mask = 0;
    if (!single_precision_p(r0)) {
	mask |= 1;
	t0 = jit_get_reg(CLASS_SNG);
	x0 = rn(t0);
	if (r0 == r1) {
	    x1 = x0;
	    movr_d(x1, r1);
	    if (r0 == r2)
		x2 = x0;
	}
	else if (r0 == r2) {
	    x2 = x0;
	    movr_d(x2, r2);
	}
    }
    else
	x0 = r0;
    if (!single_precision_p(r1)) {
	if (r0 != r1) {
	    mask |= 2;
	    t1 = jit_get_reg(CLASS_SNG);
	    x1 = rn(t1);
	    movr_d(x1, r1);
	    if (r1 == r2)
		x2 = x1;
	}
    }
    else
	x1 = r1;
    if (!single_precision_p(r2)) {
	if (r0 != r2 && r1 != r2) {
	    mask |= 4;
	    t2 = jit_get_reg(CLASS_SNG);
	    x2 = rn(t2);
	    movr_d(x2, r2);
	}
    }
    else
	x2 = r2;
    FPop1(x0, x1,  op, x2);
    if (mask & 1) {
	movr_d(r0, x0);
	jit_unget_reg(t0);
    }
    if (mask & 2)
	jit_unget_reg(t1);
    if (mask & 4)
	jit_unget_reg(t2);
}
#  endif

static void
_fop1f(jit_state_t *_jit, jit_int32_t op,
       jit_int32_t r0, jit_int32_t r1, jit_float32_t *i0)
{
    jit_int32_t		reg;
#  if __WORDSIZE == 64
    jit_int32_t		x0, t0, x1, t1, mask = 0;
#  endif
    reg = jit_get_reg(CLASS_SNG);
    movi_f(rn(reg), i0);
#  if __WORDSIZE == 64
    if (!single_precision_p(r0)) {
	mask |= 1;
	t0 = jit_get_reg(CLASS_SNG);
	x0 = rn(t0);
	if (r0 == r1) {
	    x1 = x0;
	    movr_d(x1, r1);
	}
    }
    else
	x0 = r0;
    if (!single_precision_p(r1)) {
	if (r0 != r1) {
	    mask |= 2;
	    t1 = jit_get_reg(CLASS_SNG);
	    x1 = rn(t1);
	    movr_d(x1, r1);
	}
    }
    else
	x1 = r1;
    FPop1(x0, x1, op, rn(reg));
    if (mask & 1) {
	movr_d(r0, x0);
	jit_unget_reg(t0);
    }
    if (mask & 2)
	jit_unget_reg(t1);
#  else
    FPop1(r0, r1, op, rn(reg));
#  endif
    jit_unget_reg(reg);
}

static void
_rfop1f(jit_state_t *_jit, jit_int32_t op,
	jit_int32_t r0, jit_int32_t r1, jit_float32_t *i0)
{
    jit_int32_t		reg;
#  if __WORDSIZE == 64
    jit_int32_t		x0, t0, x1, t1, mask = 0;
#  endif
    reg = jit_get_reg(CLASS_SNG);
    movi_f(rn(reg), i0);
#  if __WORDSIZE == 64
    if (!single_precision_p(r0)) {
	mask |= 1;
	t0 = jit_get_reg(CLASS_SNG);
	x0 = rn(t0);
	if (r0 == r1) {
	    x1 = x0;
	    movr_d(x1, r1);
	}
    }
    else
	x0 = r0;
    if (!single_precision_p(r1)) {
	if (r0 != r1) {
	    mask |= 2;
	    t1 = jit_get_reg(CLASS_SNG);
	    x1 = rn(t1);
	    movr_d(x1, r1);
	}
    }
    else
	x1 = r1;
    FPop1(x0, rn(reg), op, x1);
    if (mask & 1) {
	movr_d(r0, x0);
	jit_unget_reg(t0);
    }
    if (mask & 2)
	jit_unget_reg(t1);
#  else
    FPop1(r0, rn(reg), op, r1);
#  endif
    jit_unget_reg(reg);
}

static void
_fop1d(jit_state_t *_jit, jit_int32_t op,
       jit_int32_t r0, jit_int32_t r1, jit_float64_t *i0)
{
    jit_int32_t		reg;
    reg = jit_get_reg(CLASS_DBL);
    movi_d(rn(reg), i0);
    FPop1(r0, r1, op, rn(reg));
    jit_unget_reg(reg);
}

static void
_rfop1d(jit_state_t *_jit, jit_int32_t op,
	jit_int32_t r0, jit_int32_t r1, jit_float64_t *i0)
{
    jit_int32_t		reg;
    reg = jit_get_reg(CLASS_DBL);
    movi_d(rn(reg), i0);
    FPop1(r0, rn(reg), op, r1);
    jit_unget_reg(reg);
}

static void
_extr_f(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
    stxi(BIAS(-8), _FP_REGNO, r1);
#  if __WORDSIZE == 32
    ldxi_f(r0, _FP_REGNO, BIAS(-8));
    FITOS(r0, r0);
#  else
    ldxi_d(r0, _FP_REGNO, BIAS(-8));
    if (!single_precision_p(r0)) {
	jit_int32_t	reg;
	reg = jit_get_reg(CLASS_SNG);
	movr_d(rn(reg), r0);
	FXTOS(rn(reg), rn(reg));
	movr_d(r0, rn(reg));
	jit_unget_reg(reg);
    }
    else
	FXTOS(r0, r0);
#  endif
}

static void
_truncr_f_i(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
    jit_int32_t		reg;
    reg = jit_get_reg(CLASS_SNG);
#  if __WORDSIZE == 64
    if (!single_precision_p(r1)) {
	movr_d(rn(reg), r1);
	FSTOI(rn(reg), rn(reg));
    }
    else
#  endif
	FSTOI(r1, rn(reg));
    stxi_f(BIAS(-8), _FP_REGNO, rn(reg));
    ldxi_i(r0, _FP_REGNO, BIAS(-8));
    jit_unget_reg(reg);
}

#  if __WORDSIZE == 64
static void
_truncr_f_l(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
    jit_int32_t		reg;
    reg = jit_get_reg(CLASS_SNG);
#  if __WORDSIZE == 64
    if (!single_precision_p(r1)) {
	movr_d(rn(reg), r1);
	FSTOX(rn(reg), rn(reg));
    }
    else
#  endif
	FSTOX(r1, rn(reg));
    stxi_d(BIAS(-8), _FP_REGNO, rn(reg));
    ldxi_l(r0, _FP_REGNO, BIAS(-8));
    jit_unget_reg(reg);
}
#  endif

static void
_fcr(jit_state_t *_jit, jit_int32_t cc,
     jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
#  if __WORDSIZE == 64
    jit_int32_t		x0, t0, x1, t1, mask = 0;
    if (!single_precision_p(r1)) {
	mask |= 1;
	t0 = jit_get_reg(CLASS_SNG);
	x0 = rn(t0);
	movr_d(x0, r1);
    }
    else
	x0 = r1;
    if (r1 == r2)
	x1 = x0;
    else if (!single_precision_p(r2)) {
	mask |= 2;
	t1 = jit_get_reg(CLASS_SNG);
	x1 = rn(t1);
	movr_d(x1, r2);
    }
    else
	x1 = r2;
    FCMPS(x0, x1);
    if (mask & 1)
	jit_unget_reg(t0);
    if (mask & 2)
	jit_unget_reg(t1);
#  else
    FCMPS(r1, r2);
#  endif
    FBa(cc, 3);
    movi(r0, 1);
    movi(r0, 0);
}

static void
_fcw(jit_state_t *_jit, jit_int32_t cc,
     jit_int32_t r0, jit_int32_t r1, jit_float32_t *i0)
{
    jit_int32_t		reg;
#  if __WORDSIZE == 64
    jit_int32_t		x0, t0, mask = 0;
    if (!single_precision_p(r1)) {
	mask |= 1;
	t0 = jit_get_reg(CLASS_SNG);
	x0 = rn(t0);
	movr_d(x0, r1);
    }
    else
	x0 = r1;
#  endif
    reg = jit_get_reg(CLASS_SNG);
    movi_f(rn(reg), i0);
#  if __WORDSIZE == 64
    FCMPS(x0, rn(reg));
    if (mask & 1)
	jit_unget_reg(t0);
#  else
    FCMPS(r1, rn(reg));
#  endif
    jit_unget_reg(reg);
    FBa(cc, 3);
    movi(r0, 1);
    movi(r0, 0);
}

static void
_dcr(jit_state_t *_jit, jit_int32_t cc,
     jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
    FCMPD(r1, r2);
    FBa(cc, 3);
    movi(r0, 1);
    movi(r0, 0);
}

static void
_dcw(jit_state_t *_jit, jit_int32_t cc,
     jit_int32_t r0, jit_int32_t r1, jit_float64_t *i0)
{
    jit_int32_t		reg;
    reg = jit_get_reg(CLASS_DBL);
    movi_d(rn(reg), i0);
    FCMPD(r1, rn(reg));
    jit_unget_reg(reg);
    FBa(cc, 3);
    movi(r0, 1);
    movi(r0, 0);
}

#  if __WORDSIZE == 64
static void
_ldr_f(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
    jit_int32_t		reg;
    if (!single_precision_p(r0)) {
	reg = jit_get_reg(CLASS_SNG);
	LDF(r1, 0, rn(reg));
	movr_d(r0, rn(reg));
	jit_unget_reg(reg);
    }
    else
	LDF(r1, 0, r0);
}
#  endif

static void
_ldi_f(jit_state_t *_jit, jit_int32_t r0, jit_word_t i0)
{
    jit_int32_t		reg;
    if (s13_p(i0)) {
#  if __WORDSIZE == 64
	if (!single_precision_p(r0)) {
	    reg = jit_get_reg(CLASS_SNG);
	    LDFI(0, i0, rn(reg));
	    movr_d(r0, rn(reg));
	    jit_unget_reg(reg);
	}
	else
#  endif
	    LDFI(0, i0, r0);
    }
    else {
	reg = jit_get_reg(jit_class_gpr);
	movi(rn(reg), i0);
	ldr_f(r0, rn(reg));
	jit_unget_reg(reg);
    }
}

#  if __WORDSIZE == 64
static void
_ldxr_f(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
    jit_int32_t		reg;
    if (!single_precision_p(r0)) {
	reg = jit_get_reg(CLASS_SNG);
	LDF(r1, r2, rn(reg));
	movr_d(r0, rn(reg));
	jit_unget_reg(reg);
    }
    else
	LDF(r1, r2, r0);
}
#  endif

static void
_ldxi_f(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
    jit_int32_t		reg;
    if (s13_p(i0)) {
#  if __WORDSIZE == 64
	if (!single_precision_p(r0)) {
	    reg = jit_get_reg(CLASS_SNG);
	    LDFI(r1, i0, rn(reg));
	    movr_d(r0, rn(reg));
	    jit_unget_reg(reg);
	}
	else
#  endif
	    LDFI(r1, i0, r0);
    }
    else {
	reg = jit_get_reg(jit_class_gpr);
	movi(rn(reg), i0);
	ldxr_f(r0, r1, rn(reg));
	jit_unget_reg(reg);
    }
}

#  if __WORDSIZE == 64
static void
_str_f(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
    jit_int32_t		reg;
    if (!single_precision_p(r1)) {
	reg = jit_get_reg(CLASS_SNG);
	movr_d(rn(reg), r1);
	STF(rn(reg), r0, 0);
	jit_unget_reg(reg);
    }
    else
	STF(r1, r0, 0);
}
# endif

static void
_sti_f(jit_state_t *_jit, jit_word_t i0, jit_int32_t r0)
{
    jit_int32_t		reg;
    if (s13_p(i0)) {
#  if __WORDSIZE == 64
	if (!single_precision_p(r0)) {
	    reg = jit_get_reg(CLASS_SNG);
	    movr_d(rn(reg), r0);
	    STFI(rn(reg), 0, i0);
	    jit_unget_reg(reg);
	}
	else
#  endif
	    STFI(r0, 0, i0);
    }
    else {
	reg = jit_get_reg(jit_class_gpr);
	movi(rn(reg), i0);
	str_f(rn(reg), r0);
	jit_unget_reg(reg);
    }
}

#  if __WORDSIZE == 64
static void
_stxr_f(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
    jit_int32_t		reg;
    if (!single_precision_p(r2)) {
	reg = jit_get_reg(CLASS_SNG);
	movr_d(rn(reg), r2);
	STF(rn(reg), r1, r0);
	jit_unget_reg(reg);
    }
    else
	STF(r2, r1, r0);
}
# endif

static void
_stxi_f(jit_state_t *_jit, jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
    jit_int32_t		reg;
    if (s13_p(i0)) {
#  if __WORDSIZE == 64
	if (!single_precision_p(r1)) {
	    reg = jit_get_reg(CLASS_SNG);
	    movr_d(rn(reg), r1);
	    STFI(rn(reg), r0, i0);
	    jit_unget_reg(reg);
	}
	else
#  endif
	    STFI(r1, r0, i0);
    }
    else {
	reg = jit_get_reg(jit_class_gpr);
	movi(rn(reg), i0);
	stxr_f(rn(reg), r0, r1);
	jit_unget_reg(reg);
    }
}

static void
_extr_d(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
    stxi(BIAS(-8), _FP_REGNO, r1);
#  if __WORDSIZE == 32
    stxi(BIAS(-4), _FP_REGNO, 0);
#  endif
    ldxi_d(r0, _FP_REGNO, BIAS(-8));
#  if __WORDSIZE == 32
    FITOD(r0, r0);
#  else
    FXTOD(r0, r0);
#  endif
}

static void
_truncr_d_i(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
    jit_int32_t		reg;
    reg = jit_get_reg(CLASS_SNG);
#  if __WORDSIZE == 64
    if (!single_precision_p(r1)) {
	movr_d(rn(reg), r1);
	FDTOI(rn(reg), rn(reg));
    }
    else
#  endif
	FDTOI(r1, rn(reg));
    stxi_d(BIAS(-8), _FP_REGNO, rn(reg));
    ldxi_i(r0, _FP_REGNO, BIAS(-8));
    jit_unget_reg(reg);
}

#  if __WORDSIZE == 64
static void
_truncr_d_l(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
    jit_int32_t		reg;
    reg = jit_get_reg(CLASS_DBL);
    FDTOX(r1, rn(reg));
    stxi_d(BIAS(-8), _FP_REGNO, rn(reg));
    ldxi_l(r0, _FP_REGNO, BIAS(-8));
    jit_unget_reg(reg);
}
#  endif

static void
_ldi_d(jit_state_t *_jit, jit_int32_t r0, jit_word_t i0)
{
    jit_int32_t		reg;
    if (s13_p(i0))
	LDDFI(0, i0, r0);
    else {
	reg = jit_get_reg(jit_class_gpr);
	movi(rn(reg), i0);
	ldr_d(r0, rn(reg));
	jit_unget_reg(reg);
    }
}

static void
_ldxi_d(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t i0)
{
    jit_int32_t		reg;
    if (s13_p(i0))
	LDDFI(r1, i0, r0);
    else {
	reg = jit_get_reg(jit_class_gpr);
	movi(rn(reg), i0);
	ldxr_d(r0, r1, rn(reg));
	jit_unget_reg(reg);
    }
}

static void
_sti_d(jit_state_t *_jit, jit_word_t i0, jit_int32_t r0)
{
    jit_int32_t		reg;
    if (s13_p(i0))
	STDFI(r0, 0, i0);
    else {
	reg = jit_get_reg(jit_class_gpr);
	movi(rn(reg), i0);
	str_d(rn(reg), r0);
	jit_unget_reg(reg);
    }
}

static void
_stxi_d(jit_state_t *_jit, jit_int32_t i0, jit_int32_t r0, jit_int32_t r1)
{
    jit_int32_t		reg;
    if (s13_p(i0))
	STDFI(r1, r0, i0);
    else {
	reg = jit_get_reg(jit_class_gpr);
	movi(rn(reg), i0);
	stxr_d(rn(reg), r0, r1);
	jit_unget_reg(reg);
    }
}

static jit_word_t
_fbr(jit_state_t *_jit, jit_int32_t cc,
     jit_word_t i0, jit_int32_t r0,jit_int32_t r1)
{
#  if __WORDSIZE == 64
    jit_int32_t		x0, t0, x1, t1, mask = 0;
#  endif
    jit_word_t		w;
#  if __WORDSIZE == 64
    if (!single_precision_p(r0)) {
	mask |= 1;
	t0 = jit_get_reg(CLASS_SNG);
	x0 = rn(t0);
	movr_d(x0, r0);
    }
    else
	x0 = r0;
    if (r0 == r1)
	x1 = x0;
    else if (!single_precision_p(r1)) {
	mask |= 2;
	t1 = jit_get_reg(CLASS_SNG);
	x1 = rn(t1);
	movr_d(x1, r1);
    }
    else
	x1 = r1;
    FCMPS(x0, x1);
    if (mask & 1)
	jit_unget_reg(t0);
    if (mask & 2)
	jit_unget_reg(t1);
#  else
    FCMPS(r0, r1);
#  endif
    w = _jit->pc.w;
    FB(cc, (i0 - w) >> 2);
    NOP();
    return (w);
}

static jit_word_t
_fbw(jit_state_t *_jit, jit_int32_t cc,
     jit_word_t i0, jit_int32_t r0, jit_float32_t *i1)
{
    jit_word_t		w;
    jit_int32_t		reg;
#  if __WORDSIZE == 64
    jit_int32_t		x0, t0, mask = 0;
    if (!single_precision_p(r0)) {
	mask |= 1;
	t0 = jit_get_reg(CLASS_SNG);
	x0 = rn(t0);
	movr_d(x0, r0);
    }
    else
	x0 = r0;
#  endif
    reg = jit_get_reg(CLASS_SNG);
    movi_f(rn(reg), i1);
#  if __WORDSIZE == 64
    FCMPS(x0, rn(reg));
    if (mask & 1)
	jit_unget_reg(t0);
#  else
    FCMPS(r0, rn(reg));
#  endif
    jit_unget_reg(reg);
    w = _jit->pc.w;
    FB(cc, (i0 - w) >> 2);
    NOP();
    return (w);
}

static jit_word_t
_dbr(jit_state_t *_jit, jit_int32_t cc,
     jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
    jit_word_t		w;
    FCMPD(r0, r1);
    w = _jit->pc.w;
    FB(cc, (i0 - w) >> 2);
    NOP();
    return (w);
}

static jit_word_t
_dbw(jit_state_t *_jit, jit_int32_t cc,
     jit_word_t i0, jit_int32_t r0, jit_float64_t *i1)
{
    jit_word_t		w;
    jit_int32_t		reg;
    reg = jit_get_reg(CLASS_DBL);
    movi_d(rn(reg), i1);
    FCMPD(r0, rn(reg));
    jit_unget_reg(reg);
    w = _jit->pc.w;
    FB(cc, (i0 - w) >> 2);
    NOP();
    return (w);
}

static void
_vaarg_d(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
    assert(_jitc->function->self.call & jit_call_varargs);

    /* Load argument. */
    ldr_d(r0, r1);

    /* Update vararg stack pointer. */
    addi(r1, r1, 8);
}
#endif