2 * PowerPC emulation micro-operations for qemu.
4 * Copyright (c) 2003-2007 Jocelyn Mayer
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 #include "host-utils.h"
26 #include "helper_regs.h"
27 #include "op_helper.h"
30 #include "op_template.h"
33 #include "op_template.h"
36 #include "op_template.h"
39 #include "op_template.h"
42 #include "op_template.h"
45 #include "op_template.h"
48 #include "op_template.h"
51 #include "op_template.h"
54 #include "op_template.h"
57 #include "op_template.h"
60 #include "op_template.h"
63 #include "op_template.h"
66 #include "op_template.h"
69 #include "op_template.h"
72 #include "op_template.h"
75 #include "op_template.h"
78 #include "op_template.h"
81 #include "op_template.h"
84 #include "op_template.h"
87 #include "op_template.h"
90 #include "op_template.h"
93 #include "op_template.h"
96 #include "op_template.h"
99 #include "op_template.h"
102 #include "op_template.h"
105 #include "op_template.h"
108 #include "op_template.h"
111 #include "op_template.h"
114 #include "op_template.h"
117 #include "op_template.h"
120 #include "op_template.h"
123 #include "op_template.h"
125 void OPPROTO
op_print_mem_EA (void)
131 /* PowerPC state maintenance operations */
133 void OPPROTO
op_set_Rc0 (void)
135 env
->crf
[0] = T0
| xer_so
;
140 void OPPROTO
op_reset_T0 (void)
146 void OPPROTO
op_set_T0 (void)
148 T0
= (uint32_t)PARAM1
;
152 #if defined(TARGET_PPC64)
153 void OPPROTO
op_set_T0_64 (void)
155 T0
= ((uint64_t)PARAM1
<< 32) | (uint64_t)PARAM2
;
160 void OPPROTO
op_set_T1 (void)
162 T1
= (uint32_t)PARAM1
;
166 #if defined(TARGET_PPC64)
167 void OPPROTO
op_set_T1_64 (void)
169 T1
= ((uint64_t)PARAM1
<< 32) | (uint64_t)PARAM2
;
175 void OPPROTO
op_set_T2 (void)
177 T2
= (uint32_t)PARAM1
;
182 void OPPROTO
op_move_T1_T0 (void)
188 void OPPROTO
op_move_T2_T0 (void)
194 void OPPROTO
op_moven_T2_T0 (void)
200 /* Generate exceptions */
201 void OPPROTO
op_raise_exception_err (void)
203 do_raise_exception_err(PARAM1
, PARAM2
);
206 void OPPROTO
op_update_nip (void)
208 env
->nip
= (uint32_t)PARAM1
;
212 #if defined(TARGET_PPC64)
213 void OPPROTO
op_update_nip_64 (void)
215 env
->nip
= ((uint64_t)PARAM1
<< 32) | (uint64_t)PARAM2
;
220 void OPPROTO
op_debug (void)
222 do_raise_exception(EXCP_DEBUG
);
225 /* Load/store special registers */
226 void OPPROTO
op_load_cr (void)
232 void OPPROTO
op_store_cr (void)
238 void OPPROTO
op_load_cro (void)
240 T0
= env
->crf
[PARAM1
];
244 void OPPROTO
op_store_cro (void)
246 env
->crf
[PARAM1
] = T0
;
250 void OPPROTO
op_load_xer_cr (void)
252 T0
= (xer_so
<< 3) | (xer_ov
<< 2) | (xer_ca
<< 1);
256 void OPPROTO
op_clear_xer_ov (void)
263 void OPPROTO
op_clear_xer_ca (void)
269 void OPPROTO
op_load_xer_bc (void)
275 void OPPROTO
op_store_xer_bc (void)
281 void OPPROTO
op_load_xer (void)
283 T0
= hreg_load_xer(env
);
287 void OPPROTO
op_store_xer (void)
289 hreg_store_xer(env
, T0
);
293 #if defined(TARGET_PPC64)
294 void OPPROTO
op_store_pri (void)
296 do_store_pri(PARAM1
);
301 #if !defined(CONFIG_USER_ONLY)
302 /* Segment registers load and store */
303 void OPPROTO
op_load_sr (void)
309 void OPPROTO
op_store_sr (void)
311 do_store_sr(env
, T1
, T0
);
315 #if defined(TARGET_PPC64)
316 void OPPROTO
op_load_slb (void)
318 T0
= ppc_load_slb(env
, T1
);
322 void OPPROTO
op_store_slb (void)
324 ppc_store_slb(env
, T1
, T0
);
327 #endif /* defined(TARGET_PPC64) */
329 void OPPROTO
op_load_sdr1 (void)
335 void OPPROTO
op_store_sdr1 (void)
337 do_store_sdr1(env
, T0
);
341 #if defined (TARGET_PPC64)
342 void OPPROTO
op_load_asr (void)
348 void OPPROTO
op_store_asr (void)
350 ppc_store_asr(env
, T0
);
355 void OPPROTO
op_load_msr (void)
361 void OPPROTO
op_store_msr (void)
367 #if defined (TARGET_PPC64)
368 void OPPROTO
op_store_msr_32 (void)
370 T0
= (env
->msr
& ~0xFFFFFFFFULL
) | (T0
& 0xFFFFFFFF);
376 void OPPROTO
op_update_riee (void)
378 /* We don't call do_store_msr here as we won't trigger
379 * any special case nor change hflags
381 T0
&= (1 << MSR_RI
) | (1 << MSR_EE
);
382 env
->msr
&= ~(1 << MSR_RI
) | (1 << MSR_EE
);
389 void OPPROTO
op_load_spr (void)
391 T0
= env
->spr
[PARAM1
];
395 void OPPROTO
op_store_spr (void)
397 env
->spr
[PARAM1
] = T0
;
401 void OPPROTO
op_load_dump_spr (void)
403 T0
= ppc_load_dump_spr(PARAM1
);
407 void OPPROTO
op_store_dump_spr (void)
409 ppc_store_dump_spr(PARAM1
, T0
);
413 void OPPROTO
op_mask_spr (void)
415 env
->spr
[PARAM1
] &= ~T0
;
419 void OPPROTO
op_load_lr (void)
425 void OPPROTO
op_store_lr (void)
431 void OPPROTO
op_load_ctr (void)
437 void OPPROTO
op_store_ctr (void)
443 void OPPROTO
op_load_tbl (void)
445 T0
= cpu_ppc_load_tbl(env
);
449 void OPPROTO
op_load_tbu (void)
451 T0
= cpu_ppc_load_tbu(env
);
455 void OPPROTO
op_load_atbl (void)
457 T0
= cpu_ppc_load_atbl(env
);
461 void OPPROTO
op_load_atbu (void)
463 T0
= cpu_ppc_load_atbu(env
);
467 #if !defined(CONFIG_USER_ONLY)
468 void OPPROTO
op_store_tbl (void)
470 cpu_ppc_store_tbl(env
, T0
);
474 void OPPROTO
op_store_tbu (void)
476 cpu_ppc_store_tbu(env
, T0
);
480 void OPPROTO
op_store_atbl (void)
482 cpu_ppc_store_atbl(env
, T0
);
486 void OPPROTO
op_store_atbu (void)
488 cpu_ppc_store_atbu(env
, T0
);
492 void OPPROTO
op_load_decr (void)
494 T0
= cpu_ppc_load_decr(env
);
498 void OPPROTO
op_store_decr (void)
500 cpu_ppc_store_decr(env
, T0
);
504 void OPPROTO
op_load_ibat (void)
506 T0
= env
->IBAT
[PARAM1
][PARAM2
];
510 void OPPROTO
op_store_ibatu (void)
512 do_store_ibatu(env
, PARAM1
, T0
);
516 void OPPROTO
op_store_ibatl (void)
519 env
->IBAT
[1][PARAM1
] = T0
;
521 do_store_ibatl(env
, PARAM1
, T0
);
526 void OPPROTO
op_load_dbat (void)
528 T0
= env
->DBAT
[PARAM1
][PARAM2
];
532 void OPPROTO
op_store_dbatu (void)
534 do_store_dbatu(env
, PARAM1
, T0
);
538 void OPPROTO
op_store_dbatl (void)
541 env
->DBAT
[1][PARAM1
] = T0
;
543 do_store_dbatl(env
, PARAM1
, T0
);
547 #endif /* !defined(CONFIG_USER_ONLY) */
550 #ifdef CONFIG_SOFTFLOAT
551 void OPPROTO
op_reset_fpstatus (void)
553 env
->fp_status
.float_exception_flags
= 0;
558 void OPPROTO
op_compute_fprf (void)
560 do_compute_fprf(PARAM1
);
564 #ifdef CONFIG_SOFTFLOAT
565 void OPPROTO
op_float_check_status (void)
567 do_float_check_status();
571 void OPPROTO
op_float_check_status (void)
573 if (env
->exception_index
== POWERPC_EXCP_PROGRAM
&&
574 (env
->error_code
& POWERPC_EXCP_FP
)) {
575 /* Differred floating-point exception after target FPR update */
576 if (msr_fe0
!= 0 || msr_fe1
!= 0)
577 do_raise_exception_err(env
->exception_index
, env
->error_code
);
583 void OPPROTO
op_load_fpscr_FT0 (void)
585 /* The 32 MSB of the target fpr are undefined.
591 u
.l
.lower
= env
->fpscr
;
596 void OPPROTO
op_set_FT0 (void)
606 void OPPROTO
op_load_fpscr_T0 (void)
608 T0
= (env
->fpscr
>> PARAM1
) & 0xF;
612 void OPPROTO
op_load_fpcc (void)
618 void OPPROTO
op_fpscr_resetbit (void)
620 env
->fpscr
&= PARAM1
;
624 void OPPROTO
op_fpscr_setbit (void)
626 do_fpscr_setbit(PARAM1
);
630 void OPPROTO
op_store_fpscr (void)
632 do_store_fpscr(PARAM1
);
639 void OPPROTO
op_setlr (void)
641 env
->lr
= (uint32_t)PARAM1
;
645 #if defined (TARGET_PPC64)
646 void OPPROTO
op_setlr_64 (void)
648 env
->lr
= ((uint64_t)PARAM1
<< 32) | (uint64_t)PARAM2
;
653 void OPPROTO
op_b_T1 (void)
655 env
->nip
= (uint32_t)(T1
& ~3);
659 #if defined (TARGET_PPC64)
660 void OPPROTO
op_b_T1_64 (void)
662 env
->nip
= (uint64_t)(T1
& ~3);
667 void OPPROTO
op_jz_T0 (void)
674 void OPPROTO
op_btest_T1 (void)
677 env
->nip
= (uint32_t)(T1
& ~3);
679 env
->nip
= (uint32_t)PARAM1
;
684 #if defined (TARGET_PPC64)
685 void OPPROTO
op_btest_T1_64 (void)
688 env
->nip
= (uint64_t)(T1
& ~3);
690 env
->nip
= ((uint64_t)PARAM1
<< 32) | (uint64_t)PARAM2
;
696 void OPPROTO
op_movl_T1_ctr (void)
702 void OPPROTO
op_movl_T1_lr (void)
708 /* tests with result in T0 */
709 void OPPROTO
op_test_ctr (void)
711 T0
= (uint32_t)env
->ctr
;
715 #if defined(TARGET_PPC64)
716 void OPPROTO
op_test_ctr_64 (void)
718 T0
= (uint64_t)env
->ctr
;
723 void OPPROTO
op_test_ctr_true (void)
725 T0
= ((uint32_t)env
->ctr
!= 0 && (T0
& PARAM1
) != 0);
729 #if defined(TARGET_PPC64)
730 void OPPROTO
op_test_ctr_true_64 (void)
732 T0
= ((uint64_t)env
->ctr
!= 0 && (T0
& PARAM1
) != 0);
737 void OPPROTO
op_test_ctr_false (void)
739 T0
= ((uint32_t)env
->ctr
!= 0 && (T0
& PARAM1
) == 0);
743 #if defined(TARGET_PPC64)
744 void OPPROTO
op_test_ctr_false_64 (void)
746 T0
= ((uint64_t)env
->ctr
!= 0 && (T0
& PARAM1
) == 0);
751 void OPPROTO
op_test_ctrz (void)
753 T0
= ((uint32_t)env
->ctr
== 0);
757 #if defined(TARGET_PPC64)
758 void OPPROTO
op_test_ctrz_64 (void)
760 T0
= ((uint64_t)env
->ctr
== 0);
765 void OPPROTO
op_test_ctrz_true (void)
767 T0
= ((uint32_t)env
->ctr
== 0 && (T0
& PARAM1
) != 0);
771 #if defined(TARGET_PPC64)
772 void OPPROTO
op_test_ctrz_true_64 (void)
774 T0
= ((uint64_t)env
->ctr
== 0 && (T0
& PARAM1
) != 0);
779 void OPPROTO
op_test_ctrz_false (void)
781 T0
= ((uint32_t)env
->ctr
== 0 && (T0
& PARAM1
) == 0);
785 #if defined(TARGET_PPC64)
786 void OPPROTO
op_test_ctrz_false_64 (void)
788 T0
= ((uint64_t)env
->ctr
== 0 && (T0
& PARAM1
) == 0);
793 void OPPROTO
op_test_true (void)
799 void OPPROTO
op_test_false (void)
801 T0
= ((T0
& PARAM1
) == 0);
805 /* CTR maintenance */
806 void OPPROTO
op_dec_ctr (void)
812 /*** Integer arithmetic ***/
814 void OPPROTO
op_add (void)
820 void OPPROTO
op_check_addo (void)
822 xer_ov
= (((uint32_t)T2
^ (uint32_t)T1
^ UINT32_MAX
) &
823 ((uint32_t)T2
^ (uint32_t)T0
)) >> 31;
828 #if defined(TARGET_PPC64)
829 void OPPROTO
op_check_addo_64 (void)
831 xer_ov
= (((uint64_t)T2
^ (uint64_t)T1
^ UINT64_MAX
) &
832 ((uint64_t)T2
^ (uint64_t)T0
)) >> 63;
839 void OPPROTO
op_check_addc (void)
841 if (likely((uint32_t)T0
>= (uint32_t)T2
)) {
849 #if defined(TARGET_PPC64)
850 void OPPROTO
op_check_addc_64 (void)
852 if (likely((uint64_t)T0
>= (uint64_t)T2
)) {
862 void OPPROTO
op_adde (void)
868 #if defined(TARGET_PPC64)
869 void OPPROTO
op_adde_64 (void)
877 void OPPROTO
op_addi (void)
879 T0
+= (int32_t)PARAM1
;
883 /* add to minus one extended */
884 void OPPROTO
op_add_me (void)
887 if (likely((uint32_t)T1
!= 0))
894 #if defined(TARGET_PPC64)
895 void OPPROTO
op_add_me_64 (void)
898 if (likely((uint64_t)T1
!= 0))
906 void OPPROTO
op_addmeo (void)
912 void OPPROTO
op_addmeo_64 (void)
918 /* add to zero extended */
919 void OPPROTO
op_add_ze (void)
926 void OPPROTO
op_divw (void)
928 if (unlikely(((int32_t)T0
== INT32_MIN
&& (int32_t)T1
== (int32_t)-1) ||
930 T0
= (int32_t)(UINT32_MAX
* ((uint32_t)T0
>> 31));
932 T0
= (int32_t)T0
/ (int32_t)T1
;
937 #if defined(TARGET_PPC64)
938 void OPPROTO
op_divd (void)
940 if (unlikely(((int64_t)T0
== INT64_MIN
&& (int64_t)T1
== (int64_t)-1LL) ||
942 T0
= (int64_t)(UINT64_MAX
* ((uint64_t)T0
>> 63));
944 T0
= (int64_t)T0
/ (int64_t)T1
;
950 void OPPROTO
op_divwo (void)
956 #if defined(TARGET_PPC64)
957 void OPPROTO
op_divdo (void)
964 /* divide word unsigned */
965 void OPPROTO
op_divwu (void)
967 if (unlikely(T1
== 0)) {
970 T0
= (uint32_t)T0
/ (uint32_t)T1
;
975 #if defined(TARGET_PPC64)
976 void OPPROTO
op_divdu (void)
978 if (unlikely(T1
== 0)) {
987 void OPPROTO
op_divwuo (void)
993 #if defined(TARGET_PPC64)
994 void OPPROTO
op_divduo (void)
1001 /* multiply high word */
1002 void OPPROTO
op_mulhw (void)
1004 T0
= ((int64_t)((int32_t)T0
) * (int64_t)((int32_t)T1
)) >> 32;
1008 #if defined(TARGET_PPC64)
1009 void OPPROTO
op_mulhd (void)
1013 muls64(&tl
, &th
, T0
, T1
);
1019 /* multiply high word unsigned */
1020 void OPPROTO
op_mulhwu (void)
1022 T0
= ((uint64_t)(uint32_t)T0
* (uint64_t)(uint32_t)T1
) >> 32;
1026 #if defined(TARGET_PPC64)
1027 void OPPROTO
op_mulhdu (void)
1031 mulu64(&tl
, &th
, T0
, T1
);
1037 /* multiply low immediate */
1038 void OPPROTO
op_mulli (void)
1040 T0
= ((int32_t)T0
* (int32_t)PARAM1
);
1044 /* multiply low word */
1045 void OPPROTO
op_mullw (void)
1047 T0
= (int32_t)(T0
* T1
);
1051 #if defined(TARGET_PPC64)
1052 void OPPROTO
op_mulld (void)
1059 void OPPROTO
op_mullwo (void)
1065 #if defined(TARGET_PPC64)
1066 void OPPROTO
op_mulldo (void)
1074 void OPPROTO
op_neg (void)
1076 if (likely(T0
!= INT32_MIN
)) {
1082 #if defined(TARGET_PPC64)
1083 void OPPROTO
op_neg_64 (void)
1085 if (likely(T0
!= INT64_MIN
)) {
1092 void OPPROTO
op_nego (void)
1098 #if defined(TARGET_PPC64)
1099 void OPPROTO
op_nego_64 (void)
1107 void OPPROTO
op_subf (void)
1113 /* subtract from carrying */
1114 void OPPROTO
op_check_subfc (void)
1116 if (likely((uint32_t)T0
> (uint32_t)T1
)) {
1124 #if defined(TARGET_PPC64)
1125 void OPPROTO
op_check_subfc_64 (void)
1127 if (likely((uint64_t)T0
> (uint64_t)T1
)) {
1136 /* subtract from extended */
1137 void OPPROTO
op_subfe (void)
1143 #if defined(TARGET_PPC64)
1144 void OPPROTO
op_subfe_64 (void)
1151 /* subtract from immediate carrying */
1152 void OPPROTO
op_subfic (void)
1154 T0
= (int32_t)PARAM1
+ ~T0
+ 1;
1155 if ((uint32_t)T0
<= (uint32_t)PARAM1
) {
1163 #if defined(TARGET_PPC64)
1164 void OPPROTO
op_subfic_64 (void)
1166 T0
= (int64_t)PARAM1
+ ~T0
+ 1;
1167 if ((uint64_t)T0
<= (uint64_t)PARAM1
) {
1176 /* subtract from minus one extended */
1177 void OPPROTO
op_subfme (void)
1179 T0
= ~T0
+ xer_ca
- 1;
1180 if (likely((uint32_t)T0
!= UINT32_MAX
))
1187 #if defined(TARGET_PPC64)
1188 void OPPROTO
op_subfme_64 (void)
1190 T0
= ~T0
+ xer_ca
- 1;
1191 if (likely((uint64_t)T0
!= UINT64_MAX
))
1199 void OPPROTO
op_subfmeo (void)
1205 #if defined(TARGET_PPC64)
1206 void OPPROTO
op_subfmeo_64 (void)
1213 /* subtract from zero extended */
1214 void OPPROTO
op_subfze (void)
1218 if ((uint32_t)T0
< (uint32_t)T1
) {
1226 #if defined(TARGET_PPC64)
1227 void OPPROTO
op_subfze_64 (void)
1231 if ((uint64_t)T0
< (uint64_t)T1
) {
1240 void OPPROTO
op_subfzeo (void)
1246 #if defined(TARGET_PPC64)
1247 void OPPROTO
op_subfzeo_64 (void)
1254 /*** Integer comparison ***/
1256 void OPPROTO
op_cmp (void)
1258 if ((int32_t)T0
< (int32_t)T1
) {
1260 } else if ((int32_t)T0
> (int32_t)T1
) {
1269 #if defined(TARGET_PPC64)
1270 void OPPROTO
op_cmp_64 (void)
1272 if ((int64_t)T0
< (int64_t)T1
) {
1274 } else if ((int64_t)T0
> (int64_t)T1
) {
1284 /* compare immediate */
1285 void OPPROTO
op_cmpi (void)
1287 if ((int32_t)T0
< (int32_t)PARAM1
) {
1289 } else if ((int32_t)T0
> (int32_t)PARAM1
) {
1298 #if defined(TARGET_PPC64)
1299 void OPPROTO
op_cmpi_64 (void)
1301 if ((int64_t)T0
< (int64_t)((int32_t)PARAM1
)) {
1303 } else if ((int64_t)T0
> (int64_t)((int32_t)PARAM1
)) {
1313 /* compare logical */
1314 void OPPROTO
op_cmpl (void)
1316 if ((uint32_t)T0
< (uint32_t)T1
) {
1318 } else if ((uint32_t)T0
> (uint32_t)T1
) {
1327 #if defined(TARGET_PPC64)
1328 void OPPROTO
op_cmpl_64 (void)
1330 if ((uint64_t)T0
< (uint64_t)T1
) {
1332 } else if ((uint64_t)T0
> (uint64_t)T1
) {
1342 /* compare logical immediate */
1343 void OPPROTO
op_cmpli (void)
1345 if ((uint32_t)T0
< (uint32_t)PARAM1
) {
1347 } else if ((uint32_t)T0
> (uint32_t)PARAM1
) {
1356 #if defined(TARGET_PPC64)
1357 void OPPROTO
op_cmpli_64 (void)
1359 if ((uint64_t)T0
< (uint64_t)PARAM1
) {
1361 } else if ((uint64_t)T0
> (uint64_t)PARAM1
) {
1371 void OPPROTO
op_isel (void)
1380 void OPPROTO
op_popcntb (void)
1386 #if defined(TARGET_PPC64)
1387 void OPPROTO
op_popcntb_64 (void)
1394 /*** Integer logical ***/
1396 void OPPROTO
op_and (void)
1403 void OPPROTO
op_andc (void)
1410 void OPPROTO
op_andi_T0 (void)
1412 T0
&= (uint32_t)PARAM1
;
1416 void OPPROTO
op_andi_T1 (void)
1418 T1
&= (uint32_t)PARAM1
;
1422 #if defined(TARGET_PPC64)
1423 void OPPROTO
op_andi_T0_64 (void)
1425 T0
&= ((uint64_t)PARAM1
<< 32) | (uint64_t)PARAM2
;
1429 void OPPROTO
op_andi_T1_64 (void)
1431 T1
&= ((uint64_t)PARAM1
<< 32) | (uint64_t)PARAM2
;
1436 /* count leading zero */
1437 void OPPROTO
op_cntlzw (void)
1443 #if defined(TARGET_PPC64)
1444 void OPPROTO
op_cntlzd (void)
1452 void OPPROTO
op_eqv (void)
1458 /* extend sign byte */
1459 void OPPROTO
op_extsb (void)
1461 #if defined (TARGET_PPC64)
1462 T0
= (int64_t)((int8_t)T0
);
1464 T0
= (int32_t)((int8_t)T0
);
1469 /* extend sign half word */
1470 void OPPROTO
op_extsh (void)
1472 #if defined (TARGET_PPC64)
1473 T0
= (int64_t)((int16_t)T0
);
1475 T0
= (int32_t)((int16_t)T0
);
1480 #if defined (TARGET_PPC64)
1481 void OPPROTO
op_extsw (void)
1483 T0
= (int64_t)((int32_t)T0
);
1489 void OPPROTO
op_nand (void)
1496 void OPPROTO
op_nor (void)
1503 void OPPROTO
op_or (void)
1510 void OPPROTO
op_orc (void)
1517 void OPPROTO
op_ori (void)
1519 T0
|= (uint32_t)PARAM1
;
1524 void OPPROTO
op_xor (void)
1531 void OPPROTO
op_xori (void)
1533 T0
^= (uint32_t)PARAM1
;
1537 /*** Integer rotate ***/
1538 void OPPROTO
op_rotl32_T0_T1 (void)
1540 T0
= rotl32(T0
, T1
& 0x1F);
1544 void OPPROTO
op_rotli32_T0 (void)
1546 T0
= rotl32(T0
, PARAM1
);
1550 #if defined(TARGET_PPC64)
1551 void OPPROTO
op_rotl64_T0_T1 (void)
1553 T0
= rotl64(T0
, T1
& 0x3F);
1557 void OPPROTO
op_rotli64_T0 (void)
1559 T0
= rotl64(T0
, PARAM1
);
1564 /*** Integer shift ***/
1565 /* shift left word */
1566 void OPPROTO
op_slw (void)
1571 T0
= (uint32_t)(T0
<< T1
);
1576 #if defined(TARGET_PPC64)
1577 void OPPROTO
op_sld (void)
1588 /* shift right algebraic word */
1589 void OPPROTO
op_sraw (void)
1595 #if defined(TARGET_PPC64)
1596 void OPPROTO
op_srad (void)
1603 /* shift right algebraic word immediate */
1604 void OPPROTO
op_srawi (void)
1606 uint32_t mask
= (uint32_t)PARAM2
;
1608 T0
= (int32_t)T0
>> PARAM1
;
1609 if ((int32_t)T1
< 0 && (T1
& mask
) != 0) {
1617 #if defined(TARGET_PPC64)
1618 void OPPROTO
op_sradi (void)
1620 uint64_t mask
= ((uint64_t)PARAM2
<< 32) | (uint64_t)PARAM3
;
1622 T0
= (int64_t)T0
>> PARAM1
;
1623 if ((int64_t)T1
< 0 && ((uint64_t)T1
& mask
) != 0) {
1632 /* shift right word */
1633 void OPPROTO
op_srw (void)
1638 T0
= (uint32_t)T0
>> T1
;
1643 #if defined(TARGET_PPC64)
1644 void OPPROTO
op_srd (void)
1649 T0
= (uint64_t)T0
>> T1
;
1655 void OPPROTO
op_sl_T0_T1 (void)
1661 void OPPROTO
op_sli_T0 (void)
1667 void OPPROTO
op_sli_T1 (void)
1673 void OPPROTO
op_srl_T0_T1 (void)
1675 T0
= (uint32_t)T0
>> T1
;
1679 #if defined(TARGET_PPC64)
1680 void OPPROTO
op_srl_T0_T1_64 (void)
1682 T0
= (uint32_t)T0
>> T1
;
1687 void OPPROTO
op_srli_T0 (void)
1689 T0
= (uint32_t)T0
>> PARAM1
;
1693 #if defined(TARGET_PPC64)
1694 void OPPROTO
op_srli_T0_64 (void)
1696 T0
= (uint64_t)T0
>> PARAM1
;
1701 void OPPROTO
op_srli_T1 (void)
1703 T1
= (uint32_t)T1
>> PARAM1
;
1707 #if defined(TARGET_PPC64)
1708 void OPPROTO
op_srli_T1_64 (void)
1710 T1
= (uint64_t)T1
>> PARAM1
;
1715 /*** Floating-Point arithmetic ***/
1717 void OPPROTO
op_fadd (void)
1719 #if USE_PRECISE_EMULATION
1722 FT0
= float64_add(FT0
, FT1
, &env
->fp_status
);
1728 void OPPROTO
op_fsub (void)
1730 #if USE_PRECISE_EMULATION
1733 FT0
= float64_sub(FT0
, FT1
, &env
->fp_status
);
1739 void OPPROTO
op_fmul (void)
1741 #if USE_PRECISE_EMULATION
1744 FT0
= float64_mul(FT0
, FT1
, &env
->fp_status
);
1750 void OPPROTO
op_fdiv (void)
1752 #if USE_PRECISE_EMULATION
1755 FT0
= float64_div(FT0
, FT1
, &env
->fp_status
);
1760 /* fsqrt - fsqrt. */
1761 void OPPROTO
op_fsqrt (void)
1768 void OPPROTO
op_fre (void)
1775 void OPPROTO
op_fres (void)
1781 /* frsqrte - frsqrte. */
1782 void OPPROTO
op_frsqrte (void)
1789 void OPPROTO
op_fsel (void)
1795 /*** Floating-Point multiply-and-add ***/
1796 /* fmadd - fmadd. */
1797 void OPPROTO
op_fmadd (void)
1799 #if USE_PRECISE_EMULATION
1802 FT0
= float64_mul(FT0
, FT1
, &env
->fp_status
);
1803 FT0
= float64_add(FT0
, FT2
, &env
->fp_status
);
1808 /* fmsub - fmsub. */
1809 void OPPROTO
op_fmsub (void)
1811 #if USE_PRECISE_EMULATION
1814 FT0
= float64_mul(FT0
, FT1
, &env
->fp_status
);
1815 FT0
= float64_sub(FT0
, FT2
, &env
->fp_status
);
1820 /* fnmadd - fnmadd. - fnmadds - fnmadds. */
1821 void OPPROTO
op_fnmadd (void)
1827 /* fnmsub - fnmsub. */
1828 void OPPROTO
op_fnmsub (void)
1834 /*** Floating-Point round & convert ***/
1836 void OPPROTO
op_frsp (void)
1838 #if USE_PRECISE_EMULATION
1841 FT0
= float64_to_float32(FT0
, &env
->fp_status
);
1846 /* fctiw - fctiw. */
1847 void OPPROTO
op_fctiw (void)
1853 /* fctiwz - fctiwz. */
1854 void OPPROTO
op_fctiwz (void)
1860 #if defined(TARGET_PPC64)
1861 /* fcfid - fcfid. */
1862 void OPPROTO
op_fcfid (void)
1868 /* fctid - fctid. */
1869 void OPPROTO
op_fctid (void)
1875 /* fctidz - fctidz. */
1876 void OPPROTO
op_fctidz (void)
1883 void OPPROTO
op_frin (void)
1889 void OPPROTO
op_friz (void)
1895 void OPPROTO
op_frip (void)
1901 void OPPROTO
op_frim (void)
1907 /*** Floating-Point compare ***/
1909 void OPPROTO
op_fcmpu (void)
1916 void OPPROTO
op_fcmpo (void)
1922 /*** Floating-point move ***/
1924 void OPPROTO
op_fabs (void)
1926 FT0
= float64_abs(FT0
);
1931 void OPPROTO
op_fnabs (void)
1933 FT0
= float64_abs(FT0
);
1934 FT0
= float64_chs(FT0
);
1939 void OPPROTO
op_fneg (void)
1941 FT0
= float64_chs(FT0
);
1945 /* Load and store */
1946 #define MEMSUFFIX _raw
1947 #include "op_helper.h"
1949 #if !defined(CONFIG_USER_ONLY)
1950 #define MEMSUFFIX _user
1951 #include "op_helper.h"
1953 #define MEMSUFFIX _kernel
1954 #include "op_helper.h"
1956 #define MEMSUFFIX _hypv
1957 #include "op_helper.h"
1961 /* Special op to check and maybe clear reservation */
1962 void OPPROTO
op_check_reservation (void)
1964 if ((uint32_t)env
->reserve
== (uint32_t)(T0
& ~0x00000003))
1965 env
->reserve
= (target_ulong
)-1ULL;
1969 #if defined(TARGET_PPC64)
1970 void OPPROTO
op_check_reservation_64 (void)
1972 if ((uint64_t)env
->reserve
== (uint64_t)(T0
& ~0x00000003))
1973 env
->reserve
= (target_ulong
)-1ULL;
1978 void OPPROTO
op_wait (void)
1984 /* Return from interrupt */
1985 #if !defined(CONFIG_USER_ONLY)
1986 void OPPROTO
op_rfi (void)
1992 #if defined(TARGET_PPC64)
1993 void OPPROTO
op_rfid (void)
1999 void OPPROTO
op_hrfid (void)
2006 /* Exception vectors */
2007 void OPPROTO
op_store_excp_prefix (void)
2009 T0
&= env
->ivpr_mask
;
2010 env
->excp_prefix
= T0
;
2014 void OPPROTO
op_store_excp_vector (void)
2016 T0
&= env
->ivor_mask
;
2017 env
->excp_vectors
[PARAM1
] = T0
;
2023 void OPPROTO
op_tw (void)
2029 #if defined(TARGET_PPC64)
2030 void OPPROTO
op_td (void)
2037 #if !defined(CONFIG_USER_ONLY)
2039 void OPPROTO
op_tlbia (void)
2041 ppc_tlb_invalidate_all(env
);
2046 void OPPROTO
op_tlbie (void)
2048 ppc_tlb_invalidate_one(env
, (uint32_t)T0
);
2052 #if defined(TARGET_PPC64)
2053 void OPPROTO
op_tlbie_64 (void)
2055 ppc_tlb_invalidate_one(env
, T0
);
2060 #if defined(TARGET_PPC64)
2061 void OPPROTO
op_slbia (void)
2063 ppc_slb_invalidate_all(env
);
2067 void OPPROTO
op_slbie (void)
2069 ppc_slb_invalidate_one(env
, (uint32_t)T0
);
2073 void OPPROTO
op_slbie_64 (void)
2075 ppc_slb_invalidate_one(env
, T0
);
2081 #if !defined(CONFIG_USER_ONLY)
2082 /* PowerPC 602/603/755 software TLB load instructions */
2083 void OPPROTO
op_6xx_tlbld (void)
2089 void OPPROTO
op_6xx_tlbli (void)
2095 /* PowerPC 74xx software TLB load instructions */
2096 void OPPROTO
op_74xx_tlbld (void)
2098 do_load_74xx_tlb(0);
2102 void OPPROTO
op_74xx_tlbli (void)
2104 do_load_74xx_tlb(1);
2110 void OPPROTO
op_load_601_rtcl (void)
2112 T0
= cpu_ppc601_load_rtcl(env
);
2116 void OPPROTO
op_load_601_rtcu (void)
2118 T0
= cpu_ppc601_load_rtcu(env
);
2122 #if !defined(CONFIG_USER_ONLY)
2123 void OPPROTO
op_store_601_rtcl (void)
2125 cpu_ppc601_store_rtcl(env
, T0
);
2129 void OPPROTO
op_store_601_rtcu (void)
2131 cpu_ppc601_store_rtcu(env
, T0
);
2135 void OPPROTO
op_store_hid0_601 (void)
2137 do_store_hid0_601();
2141 void OPPROTO
op_load_601_bat (void)
2143 T0
= env
->IBAT
[PARAM1
][PARAM2
];
2147 void OPPROTO
op_store_601_batl (void)
2149 do_store_ibatl_601(env
, PARAM1
, T0
);
2153 void OPPROTO
op_store_601_batu (void)
2155 do_store_ibatu_601(env
, PARAM1
, T0
);
2158 #endif /* !defined(CONFIG_USER_ONLY) */
2160 /* PowerPC 601 specific instructions (POWER bridge) */
2161 /* XXX: those micro-ops need tests ! */
2162 void OPPROTO
op_POWER_abs (void)
2164 if ((int32_t)T0
== INT32_MIN
)
2166 else if ((int32_t)T0
< 0)
2171 void OPPROTO
op_POWER_abso (void)
2177 void OPPROTO
op_POWER_clcs (void)
2183 void OPPROTO
op_POWER_div (void)
2189 void OPPROTO
op_POWER_divo (void)
2195 void OPPROTO
op_POWER_divs (void)
2201 void OPPROTO
op_POWER_divso (void)
2207 void OPPROTO
op_POWER_doz (void)
2209 if ((int32_t)T1
> (int32_t)T0
)
2216 void OPPROTO
op_POWER_dozo (void)
2222 void OPPROTO
op_load_xer_cmp (void)
2228 void OPPROTO
op_POWER_maskg (void)
2234 void OPPROTO
op_POWER_maskir (void)
2236 T0
= (T0
& ~T2
) | (T1
& T2
);
2240 void OPPROTO
op_POWER_mul (void)
2244 tmp
= (uint64_t)T0
* (uint64_t)T1
;
2245 env
->spr
[SPR_MQ
] = tmp
>> 32;
2250 void OPPROTO
op_POWER_mulo (void)
2256 void OPPROTO
op_POWER_nabs (void)
2263 void OPPROTO
op_POWER_nabso (void)
2265 /* nabs never overflows */
2272 /* XXX: factorise POWER rotates... */
2273 void OPPROTO
op_POWER_rlmi (void)
2275 T0
= rotl32(T0
, T2
) & PARAM1
;
2276 T0
|= T1
& (uint32_t)PARAM2
;
2280 void OPPROTO
op_POWER_rrib (void)
2283 T0
= rotl32(T0
& INT32_MIN
, T2
);
2284 T0
|= T1
& ~rotl32(INT32_MIN
, T2
);
2288 void OPPROTO
op_POWER_sle (void)
2291 env
->spr
[SPR_MQ
] = rotl32(T0
, T1
);
2296 void OPPROTO
op_POWER_sleq (void)
2298 uint32_t tmp
= env
->spr
[SPR_MQ
];
2301 env
->spr
[SPR_MQ
] = rotl32(T0
, T1
);
2303 T0
|= tmp
>> (32 - T1
);
2307 void OPPROTO
op_POWER_sllq (void)
2309 uint32_t msk
= UINT32_MAX
;
2311 msk
= msk
<< (T1
& 0x1FUL
);
2315 T0
= (T0
<< T1
) & msk
;
2316 T0
|= env
->spr
[SPR_MQ
] & ~msk
;
2320 void OPPROTO
op_POWER_slq (void)
2322 uint32_t msk
= UINT32_MAX
, tmp
;
2324 msk
= msk
<< (T1
& 0x1FUL
);
2328 tmp
= rotl32(T0
, T1
);
2330 env
->spr
[SPR_MQ
] = tmp
;
2334 void OPPROTO
op_POWER_sraq (void)
2336 env
->spr
[SPR_MQ
] = rotl32(T0
, 32 - (T1
& 0x1FUL
));
2340 T0
= (int32_t)T0
>> T1
;
2344 void OPPROTO
op_POWER_sre (void)
2347 env
->spr
[SPR_MQ
] = rotl32(T0
, 32 - T1
);
2348 T0
= (int32_t)T0
>> T1
;
2352 void OPPROTO
op_POWER_srea (void)
2355 env
->spr
[SPR_MQ
] = T0
>> T1
;
2356 T0
= (int32_t)T0
>> T1
;
2360 void OPPROTO
op_POWER_sreq (void)
2366 msk
= INT32_MIN
>> T1
;
2367 tmp
= env
->spr
[SPR_MQ
];
2368 env
->spr
[SPR_MQ
] = rotl32(T0
, 32 - T1
);
2374 void OPPROTO
op_POWER_srlq (void)
2379 msk
= INT32_MIN
>> (T1
& 0x1FUL
);
2383 tmp
= env
->spr
[SPR_MQ
];
2384 env
->spr
[SPR_MQ
] = rotl32(T0
, 32 - T1
);
2391 void OPPROTO
op_POWER_srq (void)
2394 env
->spr
[SPR_MQ
] = rotl32(T0
, 32 - T1
);
2399 /* POWER instructions not implemented in PowerPC 601 */
2400 #if !defined(CONFIG_USER_ONLY)
2401 void OPPROTO
op_POWER_mfsri (void)
2408 void OPPROTO
op_POWER_rac (void)
2414 void OPPROTO
op_POWER_rfsvc (void)
2421 /* PowerPC 602 specific instruction */
2422 #if !defined(CONFIG_USER_ONLY)
2423 void OPPROTO
op_602_mfrom (void)
2430 /* PowerPC 4xx specific micro-ops */
2431 void OPPROTO
op_405_add_T0_T2 (void)
2433 T0
= (int32_t)T0
+ (int32_t)T2
;
2437 void OPPROTO
op_405_mulchw (void)
2439 T0
= ((int16_t)T0
) * ((int16_t)(T1
>> 16));
2443 void OPPROTO
op_405_mulchwu (void)
2445 T0
= ((uint16_t)T0
) * ((uint16_t)(T1
>> 16));
2449 void OPPROTO
op_405_mulhhw (void)
2451 T0
= ((int16_t)(T0
>> 16)) * ((int16_t)(T1
>> 16));
2455 void OPPROTO
op_405_mulhhwu (void)
2457 T0
= ((uint16_t)(T0
>> 16)) * ((uint16_t)(T1
>> 16));
2461 void OPPROTO
op_405_mullhw (void)
2463 T0
= ((int16_t)T0
) * ((int16_t)T1
);
2467 void OPPROTO
op_405_mullhwu (void)
2469 T0
= ((uint16_t)T0
) * ((uint16_t)T1
);
2473 void OPPROTO
op_405_check_sat (void)
2479 void OPPROTO
op_405_check_ovu (void)
2481 if (likely(T0
>= T2
)) {
2490 void OPPROTO
op_405_check_satu (void)
2492 if (unlikely(T0
< T2
)) {
2493 /* Saturate result */
2499 void OPPROTO
op_load_dcr (void)
2505 void OPPROTO
op_store_dcr (void)
2511 #if !defined(CONFIG_USER_ONLY)
2512 /* Return from critical interrupt :
2513 * same as rfi, except nip & MSR are loaded from SRR2/3 instead of SRR0/1
2515 void OPPROTO
op_40x_rfci (void)
2521 void OPPROTO
op_rfci (void)
2527 void OPPROTO
op_rfdi (void)
2533 void OPPROTO
op_rfmci (void)
2539 void OPPROTO
op_wrte (void)
2541 /* We don't call do_store_msr here as we won't trigger
2542 * any special case nor change hflags
2545 env
->msr
&= ~(1 << MSR_EE
);
2550 void OPPROTO
op_440_tlbre (void)
2552 do_440_tlbre(PARAM1
);
2556 void OPPROTO
op_440_tlbsx (void)
2558 T0
= ppcemb_tlb_search(env
, T0
, env
->spr
[SPR_440_MMUCR
] & 0xFF);
2562 void OPPROTO
op_4xx_tlbsx_check (void)
2573 void OPPROTO
op_440_tlbwe (void)
2575 do_440_tlbwe(PARAM1
);
2579 void OPPROTO
op_4xx_tlbre_lo (void)
2585 void OPPROTO
op_4xx_tlbre_hi (void)
2591 void OPPROTO
op_4xx_tlbsx (void)
2593 T0
= ppcemb_tlb_search(env
, T0
, env
->spr
[SPR_40x_PID
]);
2597 void OPPROTO
op_4xx_tlbwe_lo (void)
2603 void OPPROTO
op_4xx_tlbwe_hi (void)
2612 void OPPROTO
op_440_dlmzb (void)
2618 void OPPROTO
op_440_dlmzb_update_Rc (void)
2629 #if !defined(CONFIG_USER_ONLY)
2630 void OPPROTO
op_store_pir (void)
2632 env
->spr
[SPR_PIR
] = T0
& 0x0000000FUL
;
2636 void OPPROTO
op_load_403_pb (void)
2638 do_load_403_pb(PARAM1
);
2642 void OPPROTO
op_store_403_pb (void)
2644 do_store_403_pb(PARAM1
);
2648 void OPPROTO
op_load_40x_pit (void)
2650 T0
= load_40x_pit(env
);
2654 void OPPROTO
op_store_40x_pit (void)
2656 store_40x_pit(env
, T0
);
2660 void OPPROTO
op_store_40x_dbcr0 (void)
2662 store_40x_dbcr0(env
, T0
);
2666 void OPPROTO
op_store_40x_sler (void)
2668 store_40x_sler(env
, T0
);
2672 void OPPROTO
op_store_booke_tcr (void)
2674 store_booke_tcr(env
, T0
);
2678 void OPPROTO
op_store_booke_tsr (void)
2680 store_booke_tsr(env
, T0
);
2683 #endif /* !defined(CONFIG_USER_ONLY) */
2686 void OPPROTO
op_splatw_T1_64 (void)
2688 T1_64
= (T1_64
<< 32) | (T1_64
& 0x00000000FFFFFFFFULL
);
2692 void OPPROTO
op_splatwi_T0_64 (void)
2694 uint64_t tmp
= PARAM1
;
2696 T0_64
= (tmp
<< 32) | tmp
;
2700 void OPPROTO
op_splatwi_T1_64 (void)
2702 uint64_t tmp
= PARAM1
;
2704 T1_64
= (tmp
<< 32) | tmp
;
2708 void OPPROTO
op_extsh_T1_64 (void)
2710 T1_64
= (int32_t)((int16_t)T1_64
);
2714 void OPPROTO
op_sli16_T1_64 (void)
2716 T1_64
= T1_64
<< 16;
2720 void OPPROTO
op_sli32_T1_64 (void)
2722 T1_64
= T1_64
<< 32;
2726 void OPPROTO
op_srli32_T1_64 (void)
2728 T1_64
= T1_64
>> 32;
2732 void OPPROTO
op_evsel (void)
2738 void OPPROTO
op_evaddw (void)
2744 void OPPROTO
op_evsubfw (void)
2750 void OPPROTO
op_evneg (void)
2756 void OPPROTO
op_evabs (void)
2762 void OPPROTO
op_evextsh (void)
2764 T0_64
= ((uint64_t)((int32_t)(int16_t)(T0_64
>> 32)) << 32) |
2765 (uint64_t)((int32_t)(int16_t)T0_64
);
2769 void OPPROTO
op_evextsb (void)
2771 T0_64
= ((uint64_t)((int32_t)(int8_t)(T0_64
>> 32)) << 32) |
2772 (uint64_t)((int32_t)(int8_t)T0_64
);
2776 void OPPROTO
op_evcntlzw (void)
2782 void OPPROTO
op_evrndw (void)
2788 void OPPROTO
op_brinc (void)
2794 void OPPROTO
op_evcntlsw (void)
2800 void OPPROTO
op_evand (void)
2806 void OPPROTO
op_evandc (void)
2812 void OPPROTO
op_evor (void)
2818 void OPPROTO
op_evxor (void)
2824 void OPPROTO
op_eveqv (void)
2826 T0_64
= ~(T0_64
^ T1_64
);
2830 void OPPROTO
op_evnor (void)
2832 T0_64
= ~(T0_64
| T1_64
);
2836 void OPPROTO
op_evorc (void)
2842 void OPPROTO
op_evnand (void)
2844 T0_64
= ~(T0_64
& T1_64
);
2848 void OPPROTO
op_evsrws (void)
2854 void OPPROTO
op_evsrwu (void)
2860 void OPPROTO
op_evslw (void)
2866 void OPPROTO
op_evrlw (void)
2872 void OPPROTO
op_evmergelo (void)
2874 T0_64
= (T0_64
<< 32) | (T1_64
& 0x00000000FFFFFFFFULL
);
2878 void OPPROTO
op_evmergehi (void)
2880 T0_64
= (T0_64
& 0xFFFFFFFF00000000ULL
) | (T1_64
>> 32);
2884 void OPPROTO
op_evmergelohi (void)
2886 T0_64
= (T0_64
<< 32) | (T1_64
>> 32);
2890 void OPPROTO
op_evmergehilo (void)
2892 T0_64
= (T0_64
& 0xFFFFFFFF00000000ULL
) | (T1_64
& 0x00000000FFFFFFFFULL
);
2896 void OPPROTO
op_evcmpgts (void)
2902 void OPPROTO
op_evcmpgtu (void)
2908 void OPPROTO
op_evcmplts (void)
2914 void OPPROTO
op_evcmpltu (void)
2920 void OPPROTO
op_evcmpeq (void)
2926 void OPPROTO
op_evfssub (void)
2932 void OPPROTO
op_evfsadd (void)
2938 void OPPROTO
op_evfsnabs (void)
2944 void OPPROTO
op_evfsabs (void)
2950 void OPPROTO
op_evfsneg (void)
2956 void OPPROTO
op_evfsdiv (void)
2962 void OPPROTO
op_evfsmul (void)
2968 void OPPROTO
op_evfscmplt (void)
2974 void OPPROTO
op_evfscmpgt (void)
2980 void OPPROTO
op_evfscmpeq (void)
2986 void OPPROTO
op_evfscfsi (void)
2992 void OPPROTO
op_evfscfui (void)
2998 void OPPROTO
op_evfscfsf (void)
3004 void OPPROTO
op_evfscfuf (void)
3010 void OPPROTO
op_evfsctsi (void)
3016 void OPPROTO
op_evfsctui (void)
3022 void OPPROTO
op_evfsctsf (void)
3028 void OPPROTO
op_evfsctuf (void)
3034 void OPPROTO
op_evfsctuiz (void)
3040 void OPPROTO
op_evfsctsiz (void)
3046 void OPPROTO
op_evfststlt (void)
3052 void OPPROTO
op_evfststgt (void)
3058 void OPPROTO
op_evfststeq (void)
3064 void OPPROTO
op_efssub (void)
3066 T0_64
= _do_efssub(T0_64
, T1_64
);
3070 void OPPROTO
op_efsadd (void)
3072 T0_64
= _do_efsadd(T0_64
, T1_64
);
3076 void OPPROTO
op_efsnabs (void)
3078 T0_64
= _do_efsnabs(T0_64
);
3082 void OPPROTO
op_efsabs (void)
3084 T0_64
= _do_efsabs(T0_64
);
3088 void OPPROTO
op_efsneg (void)
3090 T0_64
= _do_efsneg(T0_64
);
3094 void OPPROTO
op_efsdiv (void)
3096 T0_64
= _do_efsdiv(T0_64
, T1_64
);
3100 void OPPROTO
op_efsmul (void)
3102 T0_64
= _do_efsmul(T0_64
, T1_64
);
3106 void OPPROTO
op_efscmplt (void)
3112 void OPPROTO
op_efscmpgt (void)
3118 void OPPROTO
op_efscfd (void)
3124 void OPPROTO
op_efscmpeq (void)
3130 void OPPROTO
op_efscfsi (void)
3136 void OPPROTO
op_efscfui (void)
3142 void OPPROTO
op_efscfsf (void)
3148 void OPPROTO
op_efscfuf (void)
3154 void OPPROTO
op_efsctsi (void)
3160 void OPPROTO
op_efsctui (void)
3166 void OPPROTO
op_efsctsf (void)
3172 void OPPROTO
op_efsctuf (void)
3178 void OPPROTO
op_efsctsiz (void)
3184 void OPPROTO
op_efsctuiz (void)
3190 void OPPROTO
op_efststlt (void)
3192 T0
= _do_efststlt(T0_64
, T1_64
);
3196 void OPPROTO
op_efststgt (void)
3198 T0
= _do_efststgt(T0_64
, T1_64
);
3202 void OPPROTO
op_efststeq (void)
3204 T0
= _do_efststeq(T0_64
, T1_64
);
3208 void OPPROTO
op_efdsub (void)
3213 u1
.d
= float64_sub(u1
.d
, u2
.d
, &env
->spe_status
);
3218 void OPPROTO
op_efdadd (void)
3223 u1
.d
= float64_add(u1
.d
, u2
.d
, &env
->spe_status
);
3228 void OPPROTO
op_efdcfsid (void)
3234 void OPPROTO
op_efdcfuid (void)
3240 void OPPROTO
op_efdnabs (void)
3242 T0_64
|= 0x8000000000000000ULL
;
3246 void OPPROTO
op_efdabs (void)
3248 T0_64
&= ~0x8000000000000000ULL
;
3252 void OPPROTO
op_efdneg (void)
3254 T0_64
^= 0x8000000000000000ULL
;
3258 void OPPROTO
op_efddiv (void)
3263 u1
.d
= float64_div(u1
.d
, u2
.d
, &env
->spe_status
);
3268 void OPPROTO
op_efdmul (void)
3273 u1
.d
= float64_mul(u1
.d
, u2
.d
, &env
->spe_status
);
3278 void OPPROTO
op_efdctsidz (void)
3284 void OPPROTO
op_efdctuidz (void)
3290 void OPPROTO
op_efdcmplt (void)
3296 void OPPROTO
op_efdcmpgt (void)
3302 void OPPROTO
op_efdcfs (void)
3308 void OPPROTO
op_efdcmpeq (void)
3314 void OPPROTO
op_efdcfsi (void)
3320 void OPPROTO
op_efdcfui (void)
3326 void OPPROTO
op_efdcfsf (void)
3332 void OPPROTO
op_efdcfuf (void)
3338 void OPPROTO
op_efdctsi (void)
3344 void OPPROTO
op_efdctui (void)
3350 void OPPROTO
op_efdctsf (void)
3356 void OPPROTO
op_efdctuf (void)
3362 void OPPROTO
op_efdctuiz (void)
3368 void OPPROTO
op_efdctsiz (void)
3374 void OPPROTO
op_efdtstlt (void)
3376 T0
= _do_efdtstlt(T0_64
, T1_64
);
3380 void OPPROTO
op_efdtstgt (void)
3382 T0
= _do_efdtstgt(T0_64
, T1_64
);
3386 void OPPROTO
op_efdtsteq (void)
3388 T0
= _do_efdtsteq(T0_64
, T1_64
);