4
Copyright (C) 2003 Thomas M. Ogrisegg <tom@fnord.at>
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Lesser General Public
8
License as published by the Free Software Foundation; either
9
version 2 of the License, or (at your option) any later version.
11
This library is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Lesser General Public License for more details.
16
You should have received a copy of the GNU Lesser General Public
17
License along with this library; if not, write to the Free Software
18
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
#define REG (env->gregs[0])
26
#include "op_template.h"
28
#define REG (env->gregs[1])
29
#include "op_template.h"
31
#define REG (env->gregs[2])
32
#include "op_template.h"
34
#define REG (env->gregs[3])
35
#include "op_template.h"
37
#define REG (env->gregs[4])
38
#include "op_template.h"
40
#define REG (env->gregs[5])
41
#include "op_template.h"
43
#define REG (env->gregs[6])
44
#include "op_template.h"
46
#define REG (env->gregs[7])
47
#include "op_template.h"
49
#define REG (REGWPTR[16])
50
#include "op_template.h"
52
#define REG (REGWPTR[17])
53
#include "op_template.h"
55
#define REG (REGWPTR[18])
56
#include "op_template.h"
58
#define REG (REGWPTR[19])
59
#include "op_template.h"
61
#define REG (REGWPTR[20])
62
#include "op_template.h"
64
#define REG (REGWPTR[21])
65
#include "op_template.h"
67
#define REG (REGWPTR[22])
68
#include "op_template.h"
70
#define REG (REGWPTR[23])
71
#include "op_template.h"
73
#define REG (REGWPTR[8])
74
#include "op_template.h"
76
#define REG (REGWPTR[9])
77
#include "op_template.h"
79
#define REG (REGWPTR[10])
80
#include "op_template.h"
82
#define REG (REGWPTR[11])
83
#include "op_template.h"
85
#define REG (REGWPTR[12])
86
#include "op_template.h"
88
#define REG (REGWPTR[13])
89
#include "op_template.h"
91
#define REG (REGWPTR[14])
92
#include "op_template.h"
94
#define REG (REGWPTR[15])
95
#include "op_template.h"
97
#define REG (REGWPTR[0])
98
#include "op_template.h"
100
#define REG (REGWPTR[1])
101
#include "op_template.h"
103
#define REG (REGWPTR[2])
104
#include "op_template.h"
106
#define REG (REGWPTR[3])
107
#include "op_template.h"
109
#define REG (REGWPTR[4])
110
#include "op_template.h"
112
#define REG (REGWPTR[5])
113
#include "op_template.h"
115
#define REG (REGWPTR[6])
116
#include "op_template.h"
118
#define REG (REGWPTR[7])
119
#include "op_template.h"
122
#define REG (env->fpr[0])
123
#include "fop_template.h"
125
#define REG (env->fpr[1])
126
#include "fop_template.h"
128
#define REG (env->fpr[2])
129
#include "fop_template.h"
131
#define REG (env->fpr[3])
132
#include "fop_template.h"
134
#define REG (env->fpr[4])
135
#include "fop_template.h"
137
#define REG (env->fpr[5])
138
#include "fop_template.h"
140
#define REG (env->fpr[6])
141
#include "fop_template.h"
143
#define REG (env->fpr[7])
144
#include "fop_template.h"
146
#define REG (env->fpr[8])
147
#include "fop_template.h"
149
#define REG (env->fpr[9])
150
#include "fop_template.h"
152
#define REG (env->fpr[10])
153
#include "fop_template.h"
155
#define REG (env->fpr[11])
156
#include "fop_template.h"
158
#define REG (env->fpr[12])
159
#include "fop_template.h"
161
#define REG (env->fpr[13])
162
#include "fop_template.h"
164
#define REG (env->fpr[14])
165
#include "fop_template.h"
167
#define REG (env->fpr[15])
168
#include "fop_template.h"
170
#define REG (env->fpr[16])
171
#include "fop_template.h"
173
#define REG (env->fpr[17])
174
#include "fop_template.h"
176
#define REG (env->fpr[18])
177
#include "fop_template.h"
179
#define REG (env->fpr[19])
180
#include "fop_template.h"
182
#define REG (env->fpr[20])
183
#include "fop_template.h"
185
#define REG (env->fpr[21])
186
#include "fop_template.h"
188
#define REG (env->fpr[22])
189
#include "fop_template.h"
191
#define REG (env->fpr[23])
192
#include "fop_template.h"
194
#define REG (env->fpr[24])
195
#include "fop_template.h"
197
#define REG (env->fpr[25])
198
#include "fop_template.h"
200
#define REG (env->fpr[26])
201
#include "fop_template.h"
203
#define REG (env->fpr[27])
204
#include "fop_template.h"
206
#define REG (env->fpr[28])
207
#include "fop_template.h"
209
#define REG (env->fpr[29])
210
#include "fop_template.h"
212
#define REG (env->fpr[30])
213
#include "fop_template.h"
215
#define REG (env->fpr[31])
216
#include "fop_template.h"
218
#ifdef TARGET_SPARC64
220
#define REG (env->fpr[32])
221
#include "fop_template.h"
223
#define REG (env->fpr[34])
224
#include "fop_template.h"
226
#define REG (env->fpr[36])
227
#include "fop_template.h"
229
#define REG (env->fpr[38])
230
#include "fop_template.h"
232
#define REG (env->fpr[40])
233
#include "fop_template.h"
235
#define REG (env->fpr[42])
236
#include "fop_template.h"
238
#define REG (env->fpr[44])
239
#include "fop_template.h"
241
#define REG (env->fpr[46])
242
#include "fop_template.h"
244
#define REG (env->fpr[47])
245
#include "fop_template.h"
247
#define REG (env->fpr[50])
248
#include "fop_template.h"
250
#define REG (env->fpr[52])
251
#include "fop_template.h"
253
#define REG (env->fpr[54])
254
#include "fop_template.h"
256
#define REG (env->fpr[56])
257
#include "fop_template.h"
259
#define REG (env->fpr[58])
260
#include "fop_template.h"
262
#define REG (env->fpr[60])
263
#include "fop_template.h"
265
#define REG (env->fpr[62])
266
#include "fop_template.h"
269
#ifdef TARGET_SPARC64
270
#ifdef WORDS_BIGENDIAN
271
typedef union UREG64 {
272
struct { uint16_t v3, v2, v1, v0; } w;
273
struct { uint32_t v1, v0; } l;
277
typedef union UREG64 {
278
struct { uint16_t v0, v1, v2, v3; } w;
279
struct { uint32_t v0, v1; } l;
292
void OPPROTO op_movq_T0_im64(void)
297
void OPPROTO op_movq_T1_im64(void)
302
#define XFLAG_SET(x) ((env->xcc&x)?1:0)
305
#define EIP (env->pc)
308
#define FLAG_SET(x) ((env->psr&x)?1:0)
310
void OPPROTO op_movl_T0_0(void)
315
void OPPROTO op_movl_T0_im(void)
317
T0 = (uint32_t)PARAM1;
320
void OPPROTO op_movl_T1_im(void)
322
T1 = (uint32_t)PARAM1;
325
void OPPROTO op_movl_T2_im(void)
327
T2 = (uint32_t)PARAM1;
330
void OPPROTO op_movl_T0_sim(void)
332
T0 = (int32_t)PARAM1;
335
void OPPROTO op_movl_T1_sim(void)
337
T1 = (int32_t)PARAM1;
340
void OPPROTO op_movl_T2_sim(void)
342
T2 = (int32_t)PARAM1;
345
void OPPROTO op_movl_T0_env(void)
347
T0 = *(uint32_t *)((char *)env + PARAM1);
350
void OPPROTO op_movl_env_T0(void)
352
*(uint32_t *)((char *)env + PARAM1) = T0;
355
void OPPROTO op_movtl_T0_env(void)
357
T0 = *(target_ulong *)((char *)env + PARAM1);
360
void OPPROTO op_movtl_env_T0(void)
362
*(target_ulong *)((char *)env + PARAM1) = T0;
365
void OPPROTO op_add_T1_T0(void)
370
void OPPROTO op_add_T1_T0_cc(void)
377
#ifdef TARGET_SPARC64
378
if (!(T0 & 0xffffffff))
379
env->psr |= PSR_ZERO;
380
if ((int32_t) T0 < 0)
382
if ((T0 & 0xffffffff) < (src1 & 0xffffffff))
383
env->psr |= PSR_CARRY;
384
if ((((src1 & 0xffffffff) ^ (T1 & 0xffffffff) ^ -1) &
385
((src1 & 0xffffffff) ^ (T0 & 0xffffffff))) & (1 << 31))
390
env->xcc |= PSR_ZERO;
391
if ((int64_t) T0 < 0)
394
env->xcc |= PSR_CARRY;
395
if (((src1 ^ T1 ^ -1) & (src1 ^ T0)) & (1ULL << 63))
399
env->psr |= PSR_ZERO;
400
if ((int32_t) T0 < 0)
403
env->psr |= PSR_CARRY;
404
if (((src1 ^ T1 ^ -1) & (src1 ^ T0)) & (1 << 31))
410
void OPPROTO op_addx_T1_T0(void)
412
T0 += T1 + FLAG_SET(PSR_CARRY);
415
void OPPROTO op_addx_T1_T0_cc(void)
419
if (FLAG_SET(PSR_CARRY))
423
#ifdef TARGET_SPARC64
424
if ((T0 & 0xffffffff) <= (src1 & 0xffffffff))
425
env->psr |= PSR_CARRY;
428
env->xcc |= PSR_CARRY;
431
env->psr |= PSR_CARRY;
438
#ifdef TARGET_SPARC64
439
if ((T0 & 0xffffffff) < (src1 & 0xffffffff))
440
env->psr |= PSR_CARRY;
443
env->xcc |= PSR_CARRY;
446
env->psr |= PSR_CARRY;
449
#ifdef TARGET_SPARC64
450
if (!(T0 & 0xffffffff))
451
env->psr |= PSR_ZERO;
452
if ((int32_t) T0 < 0)
454
if ((((src1 & 0xffffffff) ^ (T1 & 0xffffffff) ^ -1) &
455
((src1 & 0xffffffff) ^ (T0 & 0xffffffff))) & (1 << 31))
459
env->xcc |= PSR_ZERO;
460
if ((int64_t) T0 < 0)
462
if (((src1 ^ T1 ^ -1) & (src1 ^ T0)) & (1ULL << 63))
466
env->psr |= PSR_ZERO;
467
if ((int32_t) T0 < 0)
469
if (((src1 ^ T1 ^ -1) & (src1 ^ T0)) & (1 << 31))
475
void OPPROTO op_tadd_T1_T0_cc(void)
482
#ifdef TARGET_SPARC64
483
if (!(T0 & 0xffffffff))
484
env->psr |= PSR_ZERO;
485
if ((int32_t) T0 < 0)
487
if ((T0 & 0xffffffff) < (src1 & 0xffffffff))
488
env->psr |= PSR_CARRY;
489
if ((((src1 & 0xffffffff) ^ (T1 & 0xffffffff) ^ -1) &
490
((src1 & 0xffffffff) ^ (T0 & 0xffffffff))) & (1 << 31))
492
if ((src1 & 0x03) || (T1 & 0x03))
497
env->xcc |= PSR_ZERO;
498
if ((int64_t) T0 < 0)
501
env->xcc |= PSR_CARRY;
502
if (((src1 ^ T1 ^ -1) & (src1 ^ T0)) & (1ULL << 63))
506
env->psr |= PSR_ZERO;
507
if ((int32_t) T0 < 0)
510
env->psr |= PSR_CARRY;
511
if (((src1 ^ T1 ^ -1) & (src1 ^ T0)) & (1 << 31))
513
if ((src1 & 0x03) || (T1 & 0x03))
519
void OPPROTO op_tadd_T1_T0_ccTV(void)
523
if ((T0 & 0x03) || (T1 & 0x03))
524
raise_exception(TT_TOVF);
529
#ifdef TARGET_SPARC64
530
if ((((src1 & 0xffffffff) ^ (T1 & 0xffffffff) ^ -1) &
531
((src1 & 0xffffffff) ^ (T0 & 0xffffffff))) & (1 << 31))
532
raise_exception(TT_TOVF);
534
if ((src1 & 0x03) || (T1 & 0x03))
535
raise_exception(TT_TOVF);
539
#ifdef TARGET_SPARC64
540
if (!(T0 & 0xffffffff))
541
env->psr |= PSR_ZERO;
542
if ((int32_t) T0 < 0)
544
if ((T0 & 0xffffffff) < (src1 & 0xffffffff))
545
env->psr |= PSR_CARRY;
549
env->xcc |= PSR_ZERO;
550
if ((int64_t) T0 < 0)
553
env->xcc |= PSR_CARRY;
556
env->psr |= PSR_ZERO;
557
if ((int32_t) T0 < 0)
560
env->psr |= PSR_CARRY;
565
void OPPROTO op_sub_T1_T0(void)
570
void OPPROTO op_sub_T1_T0_cc(void)
577
#ifdef TARGET_SPARC64
578
if (!(T0 & 0xffffffff))
579
env->psr |= PSR_ZERO;
580
if ((int32_t) T0 < 0)
582
if ((src1 & 0xffffffff) < (T1 & 0xffffffff))
583
env->psr |= PSR_CARRY;
584
if ((((src1 & 0xffffffff) ^ (T1 & 0xffffffff)) &
585
((src1 & 0xffffffff) ^ (T0 & 0xffffffff))) & (1 << 31))
590
env->xcc |= PSR_ZERO;
591
if ((int64_t) T0 < 0)
594
env->xcc |= PSR_CARRY;
595
if (((src1 ^ T1) & (src1 ^ T0)) & (1ULL << 63))
599
env->psr |= PSR_ZERO;
600
if ((int32_t) T0 < 0)
603
env->psr |= PSR_CARRY;
604
if (((src1 ^ T1) & (src1 ^ T0)) & (1 << 31))
610
void OPPROTO op_subx_T1_T0(void)
612
T0 -= T1 + FLAG_SET(PSR_CARRY);
615
void OPPROTO op_subx_T1_T0_cc(void)
619
if (FLAG_SET(PSR_CARRY))
623
#ifdef TARGET_SPARC64
624
if ((src1 & 0xffffffff) <= (T1 & 0xffffffff))
625
env->psr |= PSR_CARRY;
628
env->xcc |= PSR_CARRY;
631
env->psr |= PSR_CARRY;
638
#ifdef TARGET_SPARC64
639
if ((src1 & 0xffffffff) < (T1 & 0xffffffff))
640
env->psr |= PSR_CARRY;
643
env->xcc |= PSR_CARRY;
646
env->psr |= PSR_CARRY;
649
#ifdef TARGET_SPARC64
650
if (!(T0 & 0xffffffff))
651
env->psr |= PSR_ZERO;
652
if ((int32_t) T0 < 0)
654
if ((((src1 & 0xffffffff) ^ (T1 & 0xffffffff)) &
655
((src1 & 0xffffffff) ^ (T0 & 0xffffffff))) & (1 << 31))
659
env->xcc |= PSR_ZERO;
660
if ((int64_t) T0 < 0)
662
if (((src1 ^ T1) & (src1 ^ T0)) & (1ULL << 63))
666
env->psr |= PSR_ZERO;
667
if ((int32_t) T0 < 0)
669
if (((src1 ^ T1) & (src1 ^ T0)) & (1 << 31))
675
void OPPROTO op_tsub_T1_T0_cc(void)
682
#ifdef TARGET_SPARC64
683
if (!(T0 & 0xffffffff))
684
env->psr |= PSR_ZERO;
685
if ((int32_t) T0 < 0)
687
if ((src1 & 0xffffffff) < (T1 & 0xffffffff))
688
env->psr |= PSR_CARRY;
689
if ((((src1 & 0xffffffff) ^ (T1 & 0xffffffff)) &
690
((src1 & 0xffffffff) ^ (T0 & 0xffffffff))) & (1 << 31))
692
if ((src1 & 0x03) || (T1 & 0x03))
697
env->xcc |= PSR_ZERO;
698
if ((int64_t) T0 < 0)
701
env->xcc |= PSR_CARRY;
702
if (((src1 ^ T1) & (src1 ^ T0)) & (1ULL << 63))
706
env->psr |= PSR_ZERO;
707
if ((int32_t) T0 < 0)
710
env->psr |= PSR_CARRY;
711
if (((src1 ^ T1) & (src1 ^ T0)) & (1 << 31))
713
if ((src1 & 0x03) || (T1 & 0x03))
719
void OPPROTO op_tsub_T1_T0_ccTV(void)
723
if ((T0 & 0x03) || (T1 & 0x03))
724
raise_exception(TT_TOVF);
729
#ifdef TARGET_SPARC64
730
if ((((src1 & 0xffffffff) ^ (T1 & 0xffffffff)) &
731
((src1 & 0xffffffff) ^ (T0 & 0xffffffff))) & (1 << 31))
732
raise_exception(TT_TOVF);
734
if (((src1 ^ T1) & (src1 ^ T0)) & (1 << 31))
735
raise_exception(TT_TOVF);
739
#ifdef TARGET_SPARC64
740
if (!(T0 & 0xffffffff))
741
env->psr |= PSR_ZERO;
742
if ((int32_t) T0 < 0)
744
if ((src1 & 0xffffffff) < (T1 & 0xffffffff))
745
env->psr |= PSR_CARRY;
749
env->xcc |= PSR_ZERO;
750
if ((int64_t) T0 < 0)
753
env->xcc |= PSR_CARRY;
756
env->psr |= PSR_ZERO;
757
if ((int32_t) T0 < 0)
760
env->psr |= PSR_CARRY;
765
void OPPROTO op_and_T1_T0(void)
770
void OPPROTO op_or_T1_T0(void)
775
void OPPROTO op_xor_T1_T0(void)
780
void OPPROTO op_andn_T1_T0(void)
785
void OPPROTO op_orn_T1_T0(void)
790
void OPPROTO op_xnor_T1_T0(void)
795
void OPPROTO op_umul_T1_T0(void)
798
res = (uint64_t) T0 * (uint64_t) T1;
799
#ifdef TARGET_SPARC64
802
T0 = res & 0xffffffff;
807
void OPPROTO op_smul_T1_T0(void)
810
res = (int64_t) ((int32_t) T0) * (int64_t) ((int32_t) T1);
811
#ifdef TARGET_SPARC64
814
T0 = res & 0xffffffff;
819
void OPPROTO op_mulscc_T1_T0(void)
821
unsigned int b1, N, V, b2;
824
N = FLAG_SET(PSR_NEG);
825
V = FLAG_SET(PSR_OVF);
828
T0 = (b1 << 31) | (T0 >> 1);
831
/* do addition and update flags */
836
env->psr |= PSR_ZERO;
837
if ((int32_t) T0 < 0)
840
env->psr |= PSR_CARRY;
841
if (((src1 ^ T1 ^ -1) & (src1 ^ T0)) & (1 << 31))
843
env->y = (b2 << 31) | (env->y >> 1);
847
void OPPROTO op_udiv_T1_T0(void)
852
x0 = T0 | ((uint64_t) (env->y) << 32);
856
raise_exception(TT_DIV_ZERO);
860
if (x0 > 0xffffffff) {
870
void OPPROTO op_sdiv_T1_T0(void)
875
x0 = T0 | ((int64_t) (env->y) << 32);
879
raise_exception(TT_DIV_ZERO);
883
if ((int32_t) x0 != x0) {
884
T0 = x0 < 0? 0x80000000: 0x7fffffff;
893
void OPPROTO op_div_cc(void)
896
#ifdef TARGET_SPARC64
898
env->psr |= PSR_ZERO;
899
if ((int32_t) T0 < 0)
906
env->xcc |= PSR_ZERO;
907
if ((int64_t) T0 < 0)
911
env->psr |= PSR_ZERO;
912
if ((int32_t) T0 < 0)
920
#ifdef TARGET_SPARC64
921
void OPPROTO op_mulx_T1_T0(void)
927
void OPPROTO op_udivx_T1_T0(void)
930
raise_exception(TT_DIV_ZERO);
936
void OPPROTO op_sdivx_T1_T0(void)
939
raise_exception(TT_DIV_ZERO);
941
if (T0 == INT64_MIN && T1 == -1)
944
T0 /= (target_long) T1;
949
void OPPROTO op_logic_T0_cc(void)
952
#ifdef TARGET_SPARC64
953
if (!(T0 & 0xffffffff))
954
env->psr |= PSR_ZERO;
955
if ((int32_t) T0 < 0)
960
env->xcc |= PSR_ZERO;
961
if ((int64_t) T0 < 0)
965
env->psr |= PSR_ZERO;
966
if ((int32_t) T0 < 0)
972
void OPPROTO op_sll(void)
977
#ifdef TARGET_SPARC64
978
void OPPROTO op_sllx(void)
983
void OPPROTO op_srl(void)
985
T0 = (T0 & 0xffffffff) >> (T1 & 0x1f);
988
void OPPROTO op_srlx(void)
993
void OPPROTO op_sra(void)
995
T0 = ((int32_t) (T0 & 0xffffffff)) >> (T1 & 0x1f);
998
void OPPROTO op_srax(void)
1000
T0 = ((int64_t) T0) >> (T1 & 0x3f);
1003
void OPPROTO op_srl(void)
1008
void OPPROTO op_sra(void)
1010
T0 = ((int32_t) T0) >> (T1 & 0x1f);
1014
/* Load and store */
1015
#define MEMSUFFIX _raw
1017
#if !defined(CONFIG_USER_ONLY)
1018
#define MEMSUFFIX _user
1021
#define MEMSUFFIX _kernel
1025
void OPPROTO op_ldfsr(void)
1027
PUT_FSR32(env, *((uint32_t *) &FT0));
1031
void OPPROTO op_stfsr(void)
1033
*((uint32_t *) &FT0) = GET_FSR32(env);
1036
#ifndef TARGET_SPARC64
1037
void OPPROTO op_rdpsr(void)
1042
void OPPROTO op_wrpsr(void)
1048
void OPPROTO op_wrwim(void)
1053
env->wim = T0 & ((1 << NWINDOWS) - 1);
1057
void OPPROTO op_rett(void)
1063
/* XXX: use another pointer for %iN registers to avoid slow wrapping
1065
void OPPROTO op_save(void)
1068
cwp = (env->cwp - 1) & (NWINDOWS - 1);
1069
if (env->wim & (1 << cwp)) {
1070
raise_exception(TT_WIN_OVF);
1076
void OPPROTO op_restore(void)
1079
cwp = (env->cwp + 1) & (NWINDOWS - 1);
1080
if (env->wim & (1 << cwp)) {
1081
raise_exception(TT_WIN_UNF);
1087
void OPPROTO op_rdccr(void)
1092
void OPPROTO op_wrccr(void)
1097
void OPPROTO op_rdtick(void)
1099
T0 = 0; // XXX read cycle counter and bit 31
1102
void OPPROTO op_wrtick(void)
1104
T0 = 0; // XXX write cycle counter and bit 31
1107
void OPPROTO op_rdtpc(void)
1109
T0 = env->tpc[env->tl];
1112
void OPPROTO op_wrtpc(void)
1114
env->tpc[env->tl] = T0;
1117
void OPPROTO op_rdtnpc(void)
1119
T0 = env->tnpc[env->tl];
1122
void OPPROTO op_wrtnpc(void)
1124
env->tnpc[env->tl] = T0;
1127
void OPPROTO op_rdtstate(void)
1129
T0 = env->tstate[env->tl];
1132
void OPPROTO op_wrtstate(void)
1134
env->tstate[env->tl] = T0;
1137
void OPPROTO op_rdtt(void)
1139
T0 = env->tt[env->tl];
1142
void OPPROTO op_wrtt(void)
1144
env->tt[env->tl] = T0;
1147
void OPPROTO op_rdpstate(void)
1152
void OPPROTO op_wrpstate(void)
1157
// CWP handling is reversed in V9, but we still use the V8 register
1159
void OPPROTO op_rdcwp(void)
1161
T0 = NWINDOWS - 1 - env->cwp;
1164
void OPPROTO op_wrcwp(void)
1166
env->cwp = NWINDOWS - 1 - T0;
1169
/* XXX: use another pointer for %iN registers to avoid slow wrapping
1171
void OPPROTO op_save(void)
1174
cwp = (env->cwp - 1) & (NWINDOWS - 1);
1175
if (env->cansave == 0) {
1176
raise_exception(TT_SPILL | (env->otherwin != 0 ?
1177
(TT_WOTHER | ((env->wstate & 0x38) >> 1)):
1178
((env->wstate & 0x7) << 2)));
1180
if (env->cleanwin - env->canrestore == 0) {
1181
// XXX Clean windows without trap
1182
raise_exception(TT_CLRWIN);
1192
void OPPROTO op_restore(void)
1195
cwp = (env->cwp + 1) & (NWINDOWS - 1);
1196
if (env->canrestore == 0) {
1197
raise_exception(TT_FILL | (env->otherwin != 0 ?
1198
(TT_WOTHER | ((env->wstate & 0x38) >> 1)):
1199
((env->wstate & 0x7) << 2)));
1209
void OPPROTO op_exception(void)
1211
env->exception_index = PARAM1;
1215
void OPPROTO op_trap_T0(void)
1217
env->exception_index = TT_TRAP + (T0 & 0x7f);
1221
void OPPROTO op_trapcc_T0(void)
1224
env->exception_index = TT_TRAP + (T0 & 0x7f);
1230
void OPPROTO op_fpexception_im(void)
1232
env->exception_index = TT_FP_EXCP;
1233
env->fsr &= ~FSR_FTT_MASK;
1239
void OPPROTO op_debug(void)
1244
void OPPROTO op_exit_tb(void)
1249
void OPPROTO op_eval_ba(void)
1254
void OPPROTO op_eval_be(void)
1256
T2 = FLAG_SET(PSR_ZERO);
1259
void OPPROTO op_eval_ble(void)
1261
target_ulong Z = FLAG_SET(PSR_ZERO), N = FLAG_SET(PSR_NEG), V = FLAG_SET(PSR_OVF);
1266
void OPPROTO op_eval_bl(void)
1268
target_ulong N = FLAG_SET(PSR_NEG), V = FLAG_SET(PSR_OVF);
1273
void OPPROTO op_eval_bleu(void)
1275
target_ulong Z = FLAG_SET(PSR_ZERO), C = FLAG_SET(PSR_CARRY);
1280
void OPPROTO op_eval_bcs(void)
1282
T2 = FLAG_SET(PSR_CARRY);
1285
void OPPROTO op_eval_bvs(void)
1287
T2 = FLAG_SET(PSR_OVF);
1290
void OPPROTO op_eval_bn(void)
1295
void OPPROTO op_eval_bneg(void)
1297
T2 = FLAG_SET(PSR_NEG);
1300
void OPPROTO op_eval_bne(void)
1302
T2 = !FLAG_SET(PSR_ZERO);
1305
void OPPROTO op_eval_bg(void)
1307
target_ulong Z = FLAG_SET(PSR_ZERO), N = FLAG_SET(PSR_NEG), V = FLAG_SET(PSR_OVF);
1309
T2 = !(Z | (N ^ V));
1312
void OPPROTO op_eval_bge(void)
1314
target_ulong N = FLAG_SET(PSR_NEG), V = FLAG_SET(PSR_OVF);
1319
void OPPROTO op_eval_bgu(void)
1321
target_ulong Z = FLAG_SET(PSR_ZERO), C = FLAG_SET(PSR_CARRY);
1326
void OPPROTO op_eval_bcc(void)
1328
T2 = !FLAG_SET(PSR_CARRY);
1331
void OPPROTO op_eval_bpos(void)
1333
T2 = !FLAG_SET(PSR_NEG);
1336
void OPPROTO op_eval_bvc(void)
1338
T2 = !FLAG_SET(PSR_OVF);
1341
#ifdef TARGET_SPARC64
1342
void OPPROTO op_eval_xbe(void)
1344
T2 = XFLAG_SET(PSR_ZERO);
1347
void OPPROTO op_eval_xble(void)
1349
target_ulong Z = XFLAG_SET(PSR_ZERO), N = XFLAG_SET(PSR_NEG), V = XFLAG_SET(PSR_OVF);
1354
void OPPROTO op_eval_xbl(void)
1356
target_ulong N = XFLAG_SET(PSR_NEG), V = XFLAG_SET(PSR_OVF);
1361
void OPPROTO op_eval_xbleu(void)
1363
target_ulong Z = XFLAG_SET(PSR_ZERO), C = XFLAG_SET(PSR_CARRY);
1368
void OPPROTO op_eval_xbcs(void)
1370
T2 = XFLAG_SET(PSR_CARRY);
1373
void OPPROTO op_eval_xbvs(void)
1375
T2 = XFLAG_SET(PSR_OVF);
1378
void OPPROTO op_eval_xbneg(void)
1380
T2 = XFLAG_SET(PSR_NEG);
1383
void OPPROTO op_eval_xbne(void)
1385
T2 = !XFLAG_SET(PSR_ZERO);
1388
void OPPROTO op_eval_xbg(void)
1390
target_ulong Z = XFLAG_SET(PSR_ZERO), N = XFLAG_SET(PSR_NEG), V = XFLAG_SET(PSR_OVF);
1392
T2 = !(Z | (N ^ V));
1395
void OPPROTO op_eval_xbge(void)
1397
target_ulong N = XFLAG_SET(PSR_NEG), V = XFLAG_SET(PSR_OVF);
1402
void OPPROTO op_eval_xbgu(void)
1404
target_ulong Z = XFLAG_SET(PSR_ZERO), C = XFLAG_SET(PSR_CARRY);
1409
void OPPROTO op_eval_xbcc(void)
1411
T2 = !XFLAG_SET(PSR_CARRY);
1414
void OPPROTO op_eval_xbpos(void)
1416
T2 = !XFLAG_SET(PSR_NEG);
1419
void OPPROTO op_eval_xbvc(void)
1421
T2 = !XFLAG_SET(PSR_OVF);
1426
#define FFLAG_SET(x) (env->fsr & x? 1: 0)
1427
#include "fbranch_template.h"
1429
#ifdef TARGET_SPARC64
1431
#define FFLAG_SET(x) ((env->fsr & ((uint64_t)x >> 32))? 1: 0)
1432
#include "fbranch_template.h"
1434
#define FFLAG_SET(x) ((env->fsr & ((uint64_t)x >> 34))? 1: 0)
1435
#include "fbranch_template.h"
1437
#define FFLAG_SET(x) ((env->fsr & ((uint64_t)x >> 36))? 1: 0)
1438
#include "fbranch_template.h"
1441
#ifdef TARGET_SPARC64
1442
void OPPROTO op_eval_brz(void)
1447
void OPPROTO op_eval_brnz(void)
1452
void OPPROTO op_eval_brlz(void)
1454
T2 = ((int64_t)T0 < 0);
1457
void OPPROTO op_eval_brlez(void)
1459
T2 = ((int64_t)T0 <= 0);
1462
void OPPROTO op_eval_brgz(void)
1464
T2 = ((int64_t)T0 > 0);
1467
void OPPROTO op_eval_brgez(void)
1469
T2 = ((int64_t)T0 >= 0);
1472
void OPPROTO op_jmp_im64(void)
1477
void OPPROTO op_movq_npc_im64(void)
1483
void OPPROTO op_jmp_im(void)
1485
env->pc = (uint32_t)PARAM1;
1488
void OPPROTO op_movl_npc_im(void)
1490
env->npc = (uint32_t)PARAM1;
1493
void OPPROTO op_movl_npc_T0(void)
1496
raise_exception(TT_UNALIGNED);
1501
void OPPROTO op_mov_pc_npc(void)
1506
void OPPROTO op_next_insn(void)
1509
env->npc = env->npc + 4;
1512
void OPPROTO op_goto_tb0(void)
1514
GOTO_TB(op_goto_tb0, PARAM1, 0);
1517
void OPPROTO op_goto_tb1(void)
1519
GOTO_TB(op_goto_tb1, PARAM1, 1);
1522
void OPPROTO op_jmp_label(void)
1524
GOTO_LABEL_PARAM(1);
1527
void OPPROTO op_jnz_T2_label(void)
1530
GOTO_LABEL_PARAM(1);
1534
void OPPROTO op_jz_T2_label(void)
1537
GOTO_LABEL_PARAM(1);
1541
void OPPROTO op_flush_T0(void)
1546
void OPPROTO op_clear_ieee_excp_and_FTT(void)
1548
env->fsr &= ~(FSR_FTT_MASK | FSR_CEXC_MASK);;
1551
#define F_OP(name, p) void OPPROTO op_f##name##p(void)
1553
#define F_BINOP(name) \
1556
set_float_exception_flags(0, &env->fp_status); \
1557
FT0 = float32_ ## name (FT0, FT1, &env->fp_status); \
1558
check_ieee_exceptions(); \
1562
set_float_exception_flags(0, &env->fp_status); \
1563
DT0 = float64_ ## name (DT0, DT1, &env->fp_status); \
1564
check_ieee_exceptions(); \
1573
void OPPROTO op_fsmuld(void)
1575
set_float_exception_flags(0, &env->fp_status);
1576
DT0 = float64_mul(float32_to_float64(FT0, &env->fp_status),
1577
float32_to_float64(FT1, &env->fp_status),
1579
check_ieee_exceptions();
1582
#define F_HELPER(name) \
1596
FT0 = float32_chs(FT1);
1607
#ifdef TARGET_SPARC64
1610
DT0 = float64_chs(DT1);
1618
void OPPROTO op_fcmps_fcc1(void)
1623
void OPPROTO op_fcmpd_fcc1(void)
1628
void OPPROTO op_fcmps_fcc2(void)
1633
void OPPROTO op_fcmpd_fcc2(void)
1638
void OPPROTO op_fcmps_fcc3(void)
1643
void OPPROTO op_fcmpd_fcc3(void)
1648
void OPPROTO op_fcmpes_fcc1(void)
1653
void OPPROTO op_fcmped_fcc1(void)
1658
void OPPROTO op_fcmpes_fcc2(void)
1663
void OPPROTO op_fcmped_fcc2(void)
1668
void OPPROTO op_fcmpes_fcc3(void)
1673
void OPPROTO op_fcmped_fcc3(void)
1680
/* Integer to float conversion. */
1681
#ifdef USE_INT_TO_FLOAT_HELPERS
1686
set_float_exception_flags(0, &env->fp_status);
1687
FT0 = int32_to_float32(*((int32_t *)&FT1), &env->fp_status);
1688
check_ieee_exceptions();
1693
set_float_exception_flags(0, &env->fp_status);
1694
DT0 = int32_to_float64(*((int32_t *)&FT1), &env->fp_status);
1695
check_ieee_exceptions();
1698
#ifdef TARGET_SPARC64
1701
set_float_exception_flags(0, &env->fp_status);
1702
FT0 = int64_to_float32(*((int64_t *)&DT1), &env->fp_status);
1703
check_ieee_exceptions();
1708
set_float_exception_flags(0, &env->fp_status);
1709
DT0 = int64_to_float64(*((int64_t *)&DT1), &env->fp_status);
1710
check_ieee_exceptions();
1716
/* floating point conversion */
1717
void OPPROTO op_fdtos(void)
1719
set_float_exception_flags(0, &env->fp_status);
1720
FT0 = float64_to_float32(DT1, &env->fp_status);
1721
check_ieee_exceptions();
1724
void OPPROTO op_fstod(void)
1726
set_float_exception_flags(0, &env->fp_status);
1727
DT0 = float32_to_float64(FT1, &env->fp_status);
1728
check_ieee_exceptions();
1731
/* Float to integer conversion. */
1732
void OPPROTO op_fstoi(void)
1734
set_float_exception_flags(0, &env->fp_status);
1735
*((int32_t *)&FT0) = float32_to_int32_round_to_zero(FT1, &env->fp_status);
1736
check_ieee_exceptions();
1739
void OPPROTO op_fdtoi(void)
1741
set_float_exception_flags(0, &env->fp_status);
1742
*((int32_t *)&FT0) = float64_to_int32_round_to_zero(DT1, &env->fp_status);
1743
check_ieee_exceptions();
1746
#ifdef TARGET_SPARC64
1747
void OPPROTO op_fstox(void)
1749
set_float_exception_flags(0, &env->fp_status);
1750
*((int64_t *)&DT0) = float32_to_int64_round_to_zero(FT1, &env->fp_status);
1751
check_ieee_exceptions();
1754
void OPPROTO op_fdtox(void)
1756
set_float_exception_flags(0, &env->fp_status);
1757
*((int64_t *)&DT0) = float64_to_int64_round_to_zero(DT1, &env->fp_status);
1758
check_ieee_exceptions();
1761
void OPPROTO op_fmovs_cc(void)
1767
void OPPROTO op_fmovd_cc(void)
1773
void OPPROTO op_mov_cc(void)
1779
void OPPROTO op_flushw(void)
1781
if (env->cansave != NWINDOWS - 2) {
1782
raise_exception(TT_SPILL | (env->otherwin != 0 ?
1783
(TT_WOTHER | ((env->wstate & 0x38) >> 1)):
1784
((env->wstate & 0x7) << 2)));
1788
void OPPROTO op_saved(void)
1791
if (env->otherwin == 0)
1798
void OPPROTO op_restored(void)
1801
if (env->cleanwin < NWINDOWS - 1)
1803
if (env->otherwin == 0)
1810
void OPPROTO op_popc(void)
1815
void OPPROTO op_done(void)
1820
void OPPROTO op_retry(void)
1825
void OPPROTO op_sir(void)
1830
void OPPROTO op_ld_asi_reg()
1833
helper_ld_asi(env->asi, PARAM2, PARAM3);
1836
void OPPROTO op_st_asi_reg()
1839
helper_st_asi(env->asi, PARAM2, PARAM3);
1843
void OPPROTO op_ld_asi()
1845
helper_ld_asi(PARAM1, PARAM2, PARAM3);
1848
void OPPROTO op_st_asi()
1850
helper_st_asi(PARAM1, PARAM2, PARAM3);
1853
#ifdef TARGET_SPARC64
1854
// This function uses non-native bit order
1855
#define GET_FIELD(X, FROM, TO) \
1856
((X) >> (63 - (TO)) & ((1ULL << ((TO) - (FROM) + 1)) - 1))
1858
// This function uses the order in the manuals, i.e. bit 0 is 2^0
1859
#define GET_FIELD_SP(X, FROM, TO) \
1860
GET_FIELD(X, 63 - (TO), 63 - (FROM))
1862
void OPPROTO op_array8()
1864
T0 = (GET_FIELD_SP(T0, 60, 63) << (17 + 2 * T1)) |
1865
(GET_FIELD_SP(T0, 39, 39 + T1 - 1) << (17 + T1)) |
1866
(GET_FIELD_SP(T0, 17 + T1 - 1, 17) << 17) |
1867
(GET_FIELD_SP(T0, 56, 59) << 13) | (GET_FIELD_SP(T0, 35, 38) << 9) |
1868
(GET_FIELD_SP(T0, 13, 16) << 5) | (((T0 >> 55) & 1) << 4) |
1869
(GET_FIELD_SP(T0, 33, 34) << 2) | GET_FIELD_SP(T0, 11, 12);
1872
void OPPROTO op_array16()
1874
T0 = ((GET_FIELD_SP(T0, 60, 63) << (17 + 2 * T1)) |
1875
(GET_FIELD_SP(T0, 39, 39 + T1 - 1) << (17 + T1)) |
1876
(GET_FIELD_SP(T0, 17 + T1 - 1, 17) << 17) |
1877
(GET_FIELD_SP(T0, 56, 59) << 13) | (GET_FIELD_SP(T0, 35, 38) << 9) |
1878
(GET_FIELD_SP(T0, 13, 16) << 5) | (((T0 >> 55) & 1) << 4) |
1879
(GET_FIELD_SP(T0, 33, 34) << 2) | GET_FIELD_SP(T0, 11, 12)) << 1;
1882
void OPPROTO op_array32()
1884
T0 = ((GET_FIELD_SP(T0, 60, 63) << (17 + 2 * T1)) |
1885
(GET_FIELD_SP(T0, 39, 39 + T1 - 1) << (17 + T1)) |
1886
(GET_FIELD_SP(T0, 17 + T1 - 1, 17) << 17) |
1887
(GET_FIELD_SP(T0, 56, 59) << 13) | (GET_FIELD_SP(T0, 35, 38) << 9) |
1888
(GET_FIELD_SP(T0, 13, 16) << 5) | (((T0 >> 55) & 1) << 4) |
1889
(GET_FIELD_SP(T0, 33, 34) << 2) | GET_FIELD_SP(T0, 11, 12)) << 2;
1892
void OPPROTO op_alignaddr()
1898
env->gsr |= tmp & 7ULL;
1902
void OPPROTO op_faligndata()
1906
tmp = (*((uint64_t *)&DT0)) << ((env->gsr & 7) * 8);
1907
tmp |= (*((uint64_t *)&DT1)) >> (64 - (env->gsr & 7) * 8);
1908
*((uint64_t *)&DT0) = tmp;
1911
void OPPROTO op_movl_FT0_0(void)
1913
*((uint32_t *)&FT0) = 0;
1916
void OPPROTO op_movl_DT0_0(void)
1918
*((uint64_t *)&DT0) = 0;
1921
void OPPROTO op_movl_FT0_1(void)
1923
*((uint32_t *)&FT0) = 0xffffffff;
1926
void OPPROTO op_movl_DT0_1(void)
1928
*((uint64_t *)&DT0) = 0xffffffffffffffffULL;
1931
void OPPROTO op_fnot(void)
1933
*(uint64_t *)&DT0 = ~*(uint64_t *)&DT1;
1936
void OPPROTO op_fnots(void)
1938
*(uint32_t *)&FT0 = ~*(uint32_t *)&FT1;
1941
void OPPROTO op_fnor(void)
1943
*(uint64_t *)&DT0 = ~(*(uint64_t *)&DT0 | *(uint64_t *)&DT1);
1946
void OPPROTO op_fnors(void)
1948
*(uint32_t *)&FT0 = ~(*(uint32_t *)&FT0 | *(uint32_t *)&FT1);
1951
void OPPROTO op_for(void)
1953
*(uint64_t *)&DT0 |= *(uint64_t *)&DT1;
1956
void OPPROTO op_fors(void)
1958
*(uint32_t *)&FT0 |= *(uint32_t *)&FT1;
1961
void OPPROTO op_fxor(void)
1963
*(uint64_t *)&DT0 ^= *(uint64_t *)&DT1;
1966
void OPPROTO op_fxors(void)
1968
*(uint32_t *)&FT0 ^= *(uint32_t *)&FT1;
1971
void OPPROTO op_fand(void)
1973
*(uint64_t *)&DT0 &= *(uint64_t *)&DT1;
1976
void OPPROTO op_fands(void)
1978
*(uint32_t *)&FT0 &= *(uint32_t *)&FT1;
1981
void OPPROTO op_fornot(void)
1983
*(uint64_t *)&DT0 = *(uint64_t *)&DT0 | ~*(uint64_t *)&DT1;
1986
void OPPROTO op_fornots(void)
1988
*(uint32_t *)&FT0 = *(uint32_t *)&FT0 | ~*(uint32_t *)&FT1;
1991
void OPPROTO op_fandnot(void)
1993
*(uint64_t *)&DT0 = *(uint64_t *)&DT0 & ~*(uint64_t *)&DT1;
1996
void OPPROTO op_fandnots(void)
1998
*(uint32_t *)&FT0 = *(uint32_t *)&FT0 & ~*(uint32_t *)&FT1;
2001
void OPPROTO op_fnand(void)
2003
*(uint64_t *)&DT0 = ~(*(uint64_t *)&DT0 & *(uint64_t *)&DT1);
2006
void OPPROTO op_fnands(void)
2008
*(uint32_t *)&FT0 = ~(*(uint32_t *)&FT0 & *(uint32_t *)&FT1);
2011
void OPPROTO op_fxnor(void)
2013
*(uint64_t *)&DT0 ^= ~*(uint64_t *)&DT1;
2016
void OPPROTO op_fxnors(void)
2018
*(uint32_t *)&FT0 ^= ~*(uint32_t *)&FT1;
2021
#ifdef WORDS_BIGENDIAN
2022
#define VIS_B64(n) b[7 - (n)]
2023
#define VIS_W64(n) w[3 - (n)]
2024
#define VIS_SW64(n) sw[3 - (n)]
2025
#define VIS_L64(n) l[1 - (n)]
2026
#define VIS_B32(n) b[3 - (n)]
2027
#define VIS_W32(n) w[1 - (n)]
2029
#define VIS_B64(n) b[n]
2030
#define VIS_W64(n) w[n]
2031
#define VIS_SW64(n) sw[n]
2032
#define VIS_L64(n) l[n]
2033
#define VIS_B32(n) b[n]
2034
#define VIS_W32(n) w[n]
2052
void OPPROTO op_fpmerge(void)
2059
// Reverse calculation order to handle overlap
2060
d.VIS_B64(7) = s.VIS_B64(3);
2061
d.VIS_B64(6) = d.VIS_B64(3);
2062
d.VIS_B64(5) = s.VIS_B64(2);
2063
d.VIS_B64(4) = d.VIS_B64(2);
2064
d.VIS_B64(3) = s.VIS_B64(1);
2065
d.VIS_B64(2) = d.VIS_B64(1);
2066
d.VIS_B64(1) = s.VIS_B64(0);
2067
//d.VIS_B64(0) = d.VIS_B64(0);
2072
void OPPROTO op_fmul8x16(void)
2081
tmp = (int32_t)d.VIS_SW64(r) * (int32_t)s.VIS_B64(r); \
2082
if ((tmp & 0xff) > 0x7f) \
2084
d.VIS_W64(r) = tmp >> 8;
2095
void OPPROTO op_fmul8x16al(void)
2104
tmp = (int32_t)d.VIS_SW64(1) * (int32_t)s.VIS_B64(r); \
2105
if ((tmp & 0xff) > 0x7f) \
2107
d.VIS_W64(r) = tmp >> 8;
2118
void OPPROTO op_fmul8x16au(void)
2127
tmp = (int32_t)d.VIS_SW64(0) * (int32_t)s.VIS_B64(r); \
2128
if ((tmp & 0xff) > 0x7f) \
2130
d.VIS_W64(r) = tmp >> 8;
2141
void OPPROTO op_fmul8sux16(void)
2150
tmp = (int32_t)d.VIS_SW64(r) * ((int32_t)s.VIS_SW64(r) >> 8); \
2151
if ((tmp & 0xff) > 0x7f) \
2153
d.VIS_W64(r) = tmp >> 8;
2164
void OPPROTO op_fmul8ulx16(void)
2173
tmp = (int32_t)d.VIS_SW64(r) * ((uint32_t)s.VIS_B64(r * 2)); \
2174
if ((tmp & 0xff) > 0x7f) \
2176
d.VIS_W64(r) = tmp >> 8;
2187
void OPPROTO op_fmuld8sux16(void)
2196
tmp = (int32_t)d.VIS_SW64(r) * ((int32_t)s.VIS_SW64(r) >> 8); \
2197
if ((tmp & 0xff) > 0x7f) \
2201
// Reverse calculation order to handle overlap
2209
void OPPROTO op_fmuld8ulx16(void)
2218
tmp = (int32_t)d.VIS_SW64(r) * ((uint32_t)s.VIS_B64(r * 2)); \
2219
if ((tmp & 0xff) > 0x7f) \
2223
// Reverse calculation order to handle overlap
2231
void OPPROTO op_fexpand(void)
2236
s.l = (uint32_t)(*(uint64_t *)&DT0 & 0xffffffff);
2238
d.VIS_L64(0) = s.VIS_W32(0) << 4;
2239
d.VIS_L64(1) = s.VIS_W32(1) << 4;
2240
d.VIS_L64(2) = s.VIS_W32(2) << 4;
2241
d.VIS_L64(3) = s.VIS_W32(3) << 4;
2246
#define VIS_OP(name, F) \
2247
void OPPROTO name##16(void) \
2254
d.VIS_W64(0) = F(d.VIS_W64(0), s.VIS_W64(0)); \
2255
d.VIS_W64(1) = F(d.VIS_W64(1), s.VIS_W64(1)); \
2256
d.VIS_W64(2) = F(d.VIS_W64(2), s.VIS_W64(2)); \
2257
d.VIS_W64(3) = F(d.VIS_W64(3), s.VIS_W64(3)); \
2262
void OPPROTO name##16s(void) \
2269
d.VIS_W32(0) = F(d.VIS_W32(0), s.VIS_W32(0)); \
2270
d.VIS_W32(1) = F(d.VIS_W32(1), s.VIS_W32(1)); \
2275
void OPPROTO name##32(void) \
2282
d.VIS_L64(0) = F(d.VIS_L64(0), s.VIS_L64(0)); \
2283
d.VIS_L64(1) = F(d.VIS_L64(1), s.VIS_L64(1)); \
2288
void OPPROTO name##32s(void) \
2295
d.l = F(d.l, s.l); \
2300
#define FADD(a, b) ((a) + (b))
2301
#define FSUB(a, b) ((a) - (b))
2302
VIS_OP(op_fpadd, FADD)
2303
VIS_OP(op_fpsub, FSUB)
2305
#define VIS_CMPOP(name, F) \
2306
void OPPROTO name##16(void) \
2313
d.VIS_W64(0) = F(d.VIS_W64(0), s.VIS_W64(0))? 1: 0; \
2314
d.VIS_W64(0) |= F(d.VIS_W64(1), s.VIS_W64(1))? 2: 0; \
2315
d.VIS_W64(0) |= F(d.VIS_W64(2), s.VIS_W64(2))? 4: 0; \
2316
d.VIS_W64(0) |= F(d.VIS_W64(3), s.VIS_W64(3))? 8: 0; \
2321
void OPPROTO name##32(void) \
2328
d.VIS_L64(0) = F(d.VIS_L64(0), s.VIS_L64(0))? 1: 0; \
2329
d.VIS_L64(0) |= F(d.VIS_L64(1), s.VIS_L64(1))? 2: 0; \
2334
#define FCMPGT(a, b) ((a) > (b))
2335
#define FCMPEQ(a, b) ((a) == (b))
2336
#define FCMPLE(a, b) ((a) <= (b))
2337
#define FCMPNE(a, b) ((a) != (b))
2339
VIS_CMPOP(op_fcmpgt, FCMPGT)
2340
VIS_CMPOP(op_fcmpeq, FCMPEQ)
2341
VIS_CMPOP(op_fcmple, FCMPLE)
2342
VIS_CMPOP(op_fcmpne, FCMPNE)