kvm: qemu: ftruncate() is not supported by hugetlbfs on older hosts
[kvm-userspace.git] / qemu / target-ppc / op.c
blob972b8bc29d6eed6dc1a49e4aa6881b03cddda2ea
1 /*
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
21 //#define DEBUG_OP
23 #include "config.h"
24 #include "exec.h"
25 #include "host-utils.h"
26 #include "helper_regs.h"
27 #include "op_helper.h"
29 #define REG 0
30 #include "op_template.h"
32 #define REG 1
33 #include "op_template.h"
35 #define REG 2
36 #include "op_template.h"
38 #define REG 3
39 #include "op_template.h"
41 #define REG 4
42 #include "op_template.h"
44 #define REG 5
45 #include "op_template.h"
47 #define REG 6
48 #include "op_template.h"
50 #define REG 7
51 #include "op_template.h"
53 #define REG 8
54 #include "op_template.h"
56 #define REG 9
57 #include "op_template.h"
59 #define REG 10
60 #include "op_template.h"
62 #define REG 11
63 #include "op_template.h"
65 #define REG 12
66 #include "op_template.h"
68 #define REG 13
69 #include "op_template.h"
71 #define REG 14
72 #include "op_template.h"
74 #define REG 15
75 #include "op_template.h"
77 #define REG 16
78 #include "op_template.h"
80 #define REG 17
81 #include "op_template.h"
83 #define REG 18
84 #include "op_template.h"
86 #define REG 19
87 #include "op_template.h"
89 #define REG 20
90 #include "op_template.h"
92 #define REG 21
93 #include "op_template.h"
95 #define REG 22
96 #include "op_template.h"
98 #define REG 23
99 #include "op_template.h"
101 #define REG 24
102 #include "op_template.h"
104 #define REG 25
105 #include "op_template.h"
107 #define REG 26
108 #include "op_template.h"
110 #define REG 27
111 #include "op_template.h"
113 #define REG 28
114 #include "op_template.h"
116 #define REG 29
117 #include "op_template.h"
119 #define REG 30
120 #include "op_template.h"
122 #define REG 31
123 #include "op_template.h"
125 void OPPROTO op_print_mem_EA (void)
127 do_print_mem_EA(T0);
128 RETURN();
131 /* PowerPC state maintenance operations */
132 /* set_Rc0 */
133 void OPPROTO op_set_Rc0 (void)
135 env->crf[0] = T0 | xer_so;
136 RETURN();
139 /* Constants load */
140 void OPPROTO op_reset_T0 (void)
142 T0 = 0;
143 RETURN();
146 void OPPROTO op_set_T0 (void)
148 T0 = (uint32_t)PARAM1;
149 RETURN();
152 #if defined(TARGET_PPC64)
153 void OPPROTO op_set_T0_64 (void)
155 T0 = ((uint64_t)PARAM1 << 32) | (uint64_t)PARAM2;
156 RETURN();
158 #endif
160 void OPPROTO op_set_T1 (void)
162 T1 = (uint32_t)PARAM1;
163 RETURN();
166 #if defined(TARGET_PPC64)
167 void OPPROTO op_set_T1_64 (void)
169 T1 = ((uint64_t)PARAM1 << 32) | (uint64_t)PARAM2;
170 RETURN();
172 #endif
174 #if 0 // unused
175 void OPPROTO op_set_T2 (void)
177 T2 = (uint32_t)PARAM1;
178 RETURN();
180 #endif
182 void OPPROTO op_move_T1_T0 (void)
184 T1 = T0;
185 RETURN();
188 void OPPROTO op_move_T2_T0 (void)
190 T2 = T0;
191 RETURN();
194 void OPPROTO op_moven_T2_T0 (void)
196 T2 = ~T0;
197 RETURN();
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;
209 RETURN();
212 #if defined(TARGET_PPC64)
213 void OPPROTO op_update_nip_64 (void)
215 env->nip = ((uint64_t)PARAM1 << 32) | (uint64_t)PARAM2;
216 RETURN();
218 #endif
220 void OPPROTO op_debug (void)
222 do_raise_exception(EXCP_DEBUG);
225 /* Load/store special registers */
226 void OPPROTO op_load_cr (void)
228 do_load_cr();
229 RETURN();
232 void OPPROTO op_store_cr (void)
234 do_store_cr(PARAM1);
235 RETURN();
238 void OPPROTO op_load_cro (void)
240 T0 = env->crf[PARAM1];
241 RETURN();
244 void OPPROTO op_store_cro (void)
246 env->crf[PARAM1] = T0;
247 RETURN();
250 void OPPROTO op_load_xer_cr (void)
252 T0 = (xer_so << 3) | (xer_ov << 2) | (xer_ca << 1);
253 RETURN();
256 void OPPROTO op_clear_xer_ov (void)
258 xer_so = 0;
259 xer_ov = 0;
260 RETURN();
263 void OPPROTO op_clear_xer_ca (void)
265 xer_ca = 0;
266 RETURN();
269 void OPPROTO op_load_xer_bc (void)
271 T1 = xer_bc;
272 RETURN();
275 void OPPROTO op_store_xer_bc (void)
277 xer_bc = T0;
278 RETURN();
281 void OPPROTO op_load_xer (void)
283 T0 = hreg_load_xer(env);
284 RETURN();
287 void OPPROTO op_store_xer (void)
289 hreg_store_xer(env, T0);
290 RETURN();
293 #if defined(TARGET_PPC64)
294 void OPPROTO op_store_pri (void)
296 do_store_pri(PARAM1);
297 RETURN();
299 #endif
301 #if !defined(CONFIG_USER_ONLY)
302 /* Segment registers load and store */
303 void OPPROTO op_load_sr (void)
305 T0 = env->sr[T1];
306 RETURN();
309 void OPPROTO op_store_sr (void)
311 do_store_sr(env, T1, T0);
312 RETURN();
315 #if defined(TARGET_PPC64)
316 void OPPROTO op_load_slb (void)
318 T0 = ppc_load_slb(env, T1);
319 RETURN();
322 void OPPROTO op_store_slb (void)
324 ppc_store_slb(env, T1, T0);
325 RETURN();
327 #endif /* defined(TARGET_PPC64) */
329 void OPPROTO op_load_sdr1 (void)
331 T0 = env->sdr1;
332 RETURN();
335 void OPPROTO op_store_sdr1 (void)
337 do_store_sdr1(env, T0);
338 RETURN();
341 #if defined (TARGET_PPC64)
342 void OPPROTO op_load_asr (void)
344 T0 = env->asr;
345 RETURN();
348 void OPPROTO op_store_asr (void)
350 ppc_store_asr(env, T0);
351 RETURN();
353 #endif
355 void OPPROTO op_load_msr (void)
357 T0 = env->msr;
358 RETURN();
361 void OPPROTO op_store_msr (void)
363 do_store_msr();
364 RETURN();
367 #if defined (TARGET_PPC64)
368 void OPPROTO op_store_msr_32 (void)
370 T0 = (env->msr & ~0xFFFFFFFFULL) | (T0 & 0xFFFFFFFF);
371 do_store_msr();
372 RETURN();
374 #endif
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);
383 env->msr |= T0;
384 RETURN();
386 #endif
388 /* SPR */
389 void OPPROTO op_load_spr (void)
391 T0 = env->spr[PARAM1];
392 RETURN();
395 void OPPROTO op_store_spr (void)
397 env->spr[PARAM1] = T0;
398 RETURN();
401 void OPPROTO op_load_dump_spr (void)
403 T0 = ppc_load_dump_spr(PARAM1);
404 RETURN();
407 void OPPROTO op_store_dump_spr (void)
409 ppc_store_dump_spr(PARAM1, T0);
410 RETURN();
413 void OPPROTO op_mask_spr (void)
415 env->spr[PARAM1] &= ~T0;
416 RETURN();
419 void OPPROTO op_load_lr (void)
421 T0 = env->lr;
422 RETURN();
425 void OPPROTO op_store_lr (void)
427 env->lr = T0;
428 RETURN();
431 void OPPROTO op_load_ctr (void)
433 T0 = env->ctr;
434 RETURN();
437 void OPPROTO op_store_ctr (void)
439 env->ctr = T0;
440 RETURN();
443 void OPPROTO op_load_tbl (void)
445 T0 = cpu_ppc_load_tbl(env);
446 RETURN();
449 void OPPROTO op_load_tbu (void)
451 T0 = cpu_ppc_load_tbu(env);
452 RETURN();
455 void OPPROTO op_load_atbl (void)
457 T0 = cpu_ppc_load_atbl(env);
458 RETURN();
461 void OPPROTO op_load_atbu (void)
463 T0 = cpu_ppc_load_atbu(env);
464 RETURN();
467 #if !defined(CONFIG_USER_ONLY)
468 void OPPROTO op_store_tbl (void)
470 cpu_ppc_store_tbl(env, T0);
471 RETURN();
474 void OPPROTO op_store_tbu (void)
476 cpu_ppc_store_tbu(env, T0);
477 RETURN();
480 void OPPROTO op_store_atbl (void)
482 cpu_ppc_store_atbl(env, T0);
483 RETURN();
486 void OPPROTO op_store_atbu (void)
488 cpu_ppc_store_atbu(env, T0);
489 RETURN();
492 void OPPROTO op_load_decr (void)
494 T0 = cpu_ppc_load_decr(env);
495 RETURN();
498 void OPPROTO op_store_decr (void)
500 cpu_ppc_store_decr(env, T0);
501 RETURN();
504 void OPPROTO op_load_ibat (void)
506 T0 = env->IBAT[PARAM1][PARAM2];
507 RETURN();
510 void OPPROTO op_store_ibatu (void)
512 do_store_ibatu(env, PARAM1, T0);
513 RETURN();
516 void OPPROTO op_store_ibatl (void)
518 #if 1
519 env->IBAT[1][PARAM1] = T0;
520 #else
521 do_store_ibatl(env, PARAM1, T0);
522 #endif
523 RETURN();
526 void OPPROTO op_load_dbat (void)
528 T0 = env->DBAT[PARAM1][PARAM2];
529 RETURN();
532 void OPPROTO op_store_dbatu (void)
534 do_store_dbatu(env, PARAM1, T0);
535 RETURN();
538 void OPPROTO op_store_dbatl (void)
540 #if 1
541 env->DBAT[1][PARAM1] = T0;
542 #else
543 do_store_dbatl(env, PARAM1, T0);
544 #endif
545 RETURN();
547 #endif /* !defined(CONFIG_USER_ONLY) */
549 /* FPSCR */
550 #ifdef CONFIG_SOFTFLOAT
551 void OPPROTO op_reset_fpstatus (void)
553 env->fp_status.float_exception_flags = 0;
554 RETURN();
556 #endif
558 void OPPROTO op_compute_fprf (void)
560 do_compute_fprf(PARAM1);
561 RETURN();
564 #ifdef CONFIG_SOFTFLOAT
565 void OPPROTO op_float_check_status (void)
567 do_float_check_status();
568 RETURN();
570 #else
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);
579 RETURN();
581 #endif
583 void OPPROTO op_load_fpscr_FT0 (void)
585 /* The 32 MSB of the target fpr are undefined.
586 * They'll be zero...
588 CPU_DoubleU u;
590 u.l.upper = 0;
591 u.l.lower = env->fpscr;
592 FT0 = u.d;
593 RETURN();
596 void OPPROTO op_set_FT0 (void)
598 CPU_DoubleU u;
600 u.l.upper = 0;
601 u.l.lower = PARAM1;
602 FT0 = u.d;
603 RETURN();
606 void OPPROTO op_load_fpscr_T0 (void)
608 T0 = (env->fpscr >> PARAM1) & 0xF;
609 RETURN();
612 void OPPROTO op_load_fpcc (void)
614 T0 = fpscr_fpcc;
615 RETURN();
618 void OPPROTO op_fpscr_resetbit (void)
620 env->fpscr &= PARAM1;
621 RETURN();
624 void OPPROTO op_fpscr_setbit (void)
626 do_fpscr_setbit(PARAM1);
627 RETURN();
630 void OPPROTO op_store_fpscr (void)
632 do_store_fpscr(PARAM1);
633 RETURN();
636 /* Branch */
637 #define EIP env->nip
639 void OPPROTO op_setlr (void)
641 env->lr = (uint32_t)PARAM1;
642 RETURN();
645 #if defined (TARGET_PPC64)
646 void OPPROTO op_setlr_64 (void)
648 env->lr = ((uint64_t)PARAM1 << 32) | (uint64_t)PARAM2;
649 RETURN();
651 #endif
653 void OPPROTO op_b_T1 (void)
655 env->nip = (uint32_t)(T1 & ~3);
656 RETURN();
659 #if defined (TARGET_PPC64)
660 void OPPROTO op_b_T1_64 (void)
662 env->nip = (uint64_t)(T1 & ~3);
663 RETURN();
665 #endif
667 void OPPROTO op_jz_T0 (void)
669 if (!T0)
670 GOTO_LABEL_PARAM(1);
671 RETURN();
674 void OPPROTO op_btest_T1 (void)
676 if (T0) {
677 env->nip = (uint32_t)(T1 & ~3);
678 } else {
679 env->nip = (uint32_t)PARAM1;
681 RETURN();
684 #if defined (TARGET_PPC64)
685 void OPPROTO op_btest_T1_64 (void)
687 if (T0) {
688 env->nip = (uint64_t)(T1 & ~3);
689 } else {
690 env->nip = ((uint64_t)PARAM1 << 32) | (uint64_t)PARAM2;
692 RETURN();
694 #endif
696 void OPPROTO op_movl_T1_ctr (void)
698 T1 = env->ctr;
699 RETURN();
702 void OPPROTO op_movl_T1_lr (void)
704 T1 = env->lr;
705 RETURN();
708 /* tests with result in T0 */
709 void OPPROTO op_test_ctr (void)
711 T0 = (uint32_t)env->ctr;
712 RETURN();
715 #if defined(TARGET_PPC64)
716 void OPPROTO op_test_ctr_64 (void)
718 T0 = (uint64_t)env->ctr;
719 RETURN();
721 #endif
723 void OPPROTO op_test_ctr_true (void)
725 T0 = ((uint32_t)env->ctr != 0 && (T0 & PARAM1) != 0);
726 RETURN();
729 #if defined(TARGET_PPC64)
730 void OPPROTO op_test_ctr_true_64 (void)
732 T0 = ((uint64_t)env->ctr != 0 && (T0 & PARAM1) != 0);
733 RETURN();
735 #endif
737 void OPPROTO op_test_ctr_false (void)
739 T0 = ((uint32_t)env->ctr != 0 && (T0 & PARAM1) == 0);
740 RETURN();
743 #if defined(TARGET_PPC64)
744 void OPPROTO op_test_ctr_false_64 (void)
746 T0 = ((uint64_t)env->ctr != 0 && (T0 & PARAM1) == 0);
747 RETURN();
749 #endif
751 void OPPROTO op_test_ctrz (void)
753 T0 = ((uint32_t)env->ctr == 0);
754 RETURN();
757 #if defined(TARGET_PPC64)
758 void OPPROTO op_test_ctrz_64 (void)
760 T0 = ((uint64_t)env->ctr == 0);
761 RETURN();
763 #endif
765 void OPPROTO op_test_ctrz_true (void)
767 T0 = ((uint32_t)env->ctr == 0 && (T0 & PARAM1) != 0);
768 RETURN();
771 #if defined(TARGET_PPC64)
772 void OPPROTO op_test_ctrz_true_64 (void)
774 T0 = ((uint64_t)env->ctr == 0 && (T0 & PARAM1) != 0);
775 RETURN();
777 #endif
779 void OPPROTO op_test_ctrz_false (void)
781 T0 = ((uint32_t)env->ctr == 0 && (T0 & PARAM1) == 0);
782 RETURN();
785 #if defined(TARGET_PPC64)
786 void OPPROTO op_test_ctrz_false_64 (void)
788 T0 = ((uint64_t)env->ctr == 0 && (T0 & PARAM1) == 0);
789 RETURN();
791 #endif
793 void OPPROTO op_test_true (void)
795 T0 = (T0 & PARAM1);
796 RETURN();
799 void OPPROTO op_test_false (void)
801 T0 = ((T0 & PARAM1) == 0);
802 RETURN();
805 /* CTR maintenance */
806 void OPPROTO op_dec_ctr (void)
808 env->ctr--;
809 RETURN();
812 /*** Integer arithmetic ***/
813 /* add */
814 void OPPROTO op_add (void)
816 T0 += T1;
817 RETURN();
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;
824 xer_so |= xer_ov;
825 RETURN();
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;
833 xer_so |= xer_ov;
834 RETURN();
836 #endif
838 /* add carrying */
839 void OPPROTO op_check_addc (void)
841 if (likely((uint32_t)T0 >= (uint32_t)T2)) {
842 xer_ca = 0;
843 } else {
844 xer_ca = 1;
846 RETURN();
849 #if defined(TARGET_PPC64)
850 void OPPROTO op_check_addc_64 (void)
852 if (likely((uint64_t)T0 >= (uint64_t)T2)) {
853 xer_ca = 0;
854 } else {
855 xer_ca = 1;
857 RETURN();
859 #endif
861 /* add extended */
862 void OPPROTO op_adde (void)
864 do_adde();
865 RETURN();
868 #if defined(TARGET_PPC64)
869 void OPPROTO op_adde_64 (void)
871 do_adde_64();
872 RETURN();
874 #endif
876 /* add immediate */
877 void OPPROTO op_addi (void)
879 T0 += (int32_t)PARAM1;
880 RETURN();
883 /* add to minus one extended */
884 void OPPROTO op_add_me (void)
886 T0 += xer_ca + (-1);
887 if (likely((uint32_t)T1 != 0))
888 xer_ca = 1;
889 else
890 xer_ca = 0;
891 RETURN();
894 #if defined(TARGET_PPC64)
895 void OPPROTO op_add_me_64 (void)
897 T0 += xer_ca + (-1);
898 if (likely((uint64_t)T1 != 0))
899 xer_ca = 1;
900 else
901 xer_ca = 0;
902 RETURN();
904 #endif
906 void OPPROTO op_addmeo (void)
908 do_addmeo();
909 RETURN();
912 void OPPROTO op_addmeo_64 (void)
914 do_addmeo();
915 RETURN();
918 /* add to zero extended */
919 void OPPROTO op_add_ze (void)
921 T0 += xer_ca;
922 RETURN();
925 /* divide word */
926 void OPPROTO op_divw (void)
928 if (unlikely(((int32_t)T0 == INT32_MIN && (int32_t)T1 == (int32_t)-1) ||
929 (int32_t)T1 == 0)) {
930 T0 = (int32_t)(UINT32_MAX * ((uint32_t)T0 >> 31));
931 } else {
932 T0 = (int32_t)T0 / (int32_t)T1;
934 RETURN();
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) ||
941 (int64_t)T1 == 0)) {
942 T0 = (int64_t)(UINT64_MAX * ((uint64_t)T0 >> 63));
943 } else {
944 T0 = (int64_t)T0 / (int64_t)T1;
946 RETURN();
948 #endif
950 void OPPROTO op_divwo (void)
952 do_divwo();
953 RETURN();
956 #if defined(TARGET_PPC64)
957 void OPPROTO op_divdo (void)
959 do_divdo();
960 RETURN();
962 #endif
964 /* divide word unsigned */
965 void OPPROTO op_divwu (void)
967 if (unlikely(T1 == 0)) {
968 T0 = 0;
969 } else {
970 T0 = (uint32_t)T0 / (uint32_t)T1;
972 RETURN();
975 #if defined(TARGET_PPC64)
976 void OPPROTO op_divdu (void)
978 if (unlikely(T1 == 0)) {
979 T0 = 0;
980 } else {
981 T0 /= T1;
983 RETURN();
985 #endif
987 void OPPROTO op_divwuo (void)
989 do_divwuo();
990 RETURN();
993 #if defined(TARGET_PPC64)
994 void OPPROTO op_divduo (void)
996 do_divduo();
997 RETURN();
999 #endif
1001 /* multiply high word */
1002 void OPPROTO op_mulhw (void)
1004 T0 = ((int64_t)((int32_t)T0) * (int64_t)((int32_t)T1)) >> 32;
1005 RETURN();
1008 #if defined(TARGET_PPC64)
1009 void OPPROTO op_mulhd (void)
1011 uint64_t tl, th;
1013 muls64(&tl, &th, T0, T1);
1014 T0 = th;
1015 RETURN();
1017 #endif
1019 /* multiply high word unsigned */
1020 void OPPROTO op_mulhwu (void)
1022 T0 = ((uint64_t)(uint32_t)T0 * (uint64_t)(uint32_t)T1) >> 32;
1023 RETURN();
1026 #if defined(TARGET_PPC64)
1027 void OPPROTO op_mulhdu (void)
1029 uint64_t tl, th;
1031 mulu64(&tl, &th, T0, T1);
1032 T0 = th;
1033 RETURN();
1035 #endif
1037 /* multiply low immediate */
1038 void OPPROTO op_mulli (void)
1040 T0 = ((int32_t)T0 * (int32_t)PARAM1);
1041 RETURN();
1044 /* multiply low word */
1045 void OPPROTO op_mullw (void)
1047 T0 = (int32_t)(T0 * T1);
1048 RETURN();
1051 #if defined(TARGET_PPC64)
1052 void OPPROTO op_mulld (void)
1054 T0 *= T1;
1055 RETURN();
1057 #endif
1059 void OPPROTO op_mullwo (void)
1061 do_mullwo();
1062 RETURN();
1065 #if defined(TARGET_PPC64)
1066 void OPPROTO op_mulldo (void)
1068 do_mulldo();
1069 RETURN();
1071 #endif
1073 /* negate */
1074 void OPPROTO op_neg (void)
1076 if (likely(T0 != INT32_MIN)) {
1077 T0 = -(int32_t)T0;
1079 RETURN();
1082 #if defined(TARGET_PPC64)
1083 void OPPROTO op_neg_64 (void)
1085 if (likely(T0 != INT64_MIN)) {
1086 T0 = -(int64_t)T0;
1088 RETURN();
1090 #endif
1092 void OPPROTO op_nego (void)
1094 do_nego();
1095 RETURN();
1098 #if defined(TARGET_PPC64)
1099 void OPPROTO op_nego_64 (void)
1101 do_nego_64();
1102 RETURN();
1104 #endif
1106 /* subtract from */
1107 void OPPROTO op_subf (void)
1109 T0 = T1 - T0;
1110 RETURN();
1113 /* subtract from carrying */
1114 void OPPROTO op_check_subfc (void)
1116 if (likely((uint32_t)T0 > (uint32_t)T1)) {
1117 xer_ca = 0;
1118 } else {
1119 xer_ca = 1;
1121 RETURN();
1124 #if defined(TARGET_PPC64)
1125 void OPPROTO op_check_subfc_64 (void)
1127 if (likely((uint64_t)T0 > (uint64_t)T1)) {
1128 xer_ca = 0;
1129 } else {
1130 xer_ca = 1;
1132 RETURN();
1134 #endif
1136 /* subtract from extended */
1137 void OPPROTO op_subfe (void)
1139 do_subfe();
1140 RETURN();
1143 #if defined(TARGET_PPC64)
1144 void OPPROTO op_subfe_64 (void)
1146 do_subfe_64();
1147 RETURN();
1149 #endif
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) {
1156 xer_ca = 1;
1157 } else {
1158 xer_ca = 0;
1160 RETURN();
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) {
1168 xer_ca = 1;
1169 } else {
1170 xer_ca = 0;
1172 RETURN();
1174 #endif
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))
1181 xer_ca = 1;
1182 else
1183 xer_ca = 0;
1184 RETURN();
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))
1192 xer_ca = 1;
1193 else
1194 xer_ca = 0;
1195 RETURN();
1197 #endif
1199 void OPPROTO op_subfmeo (void)
1201 do_subfmeo();
1202 RETURN();
1205 #if defined(TARGET_PPC64)
1206 void OPPROTO op_subfmeo_64 (void)
1208 do_subfmeo_64();
1209 RETURN();
1211 #endif
1213 /* subtract from zero extended */
1214 void OPPROTO op_subfze (void)
1216 T1 = ~T0;
1217 T0 = T1 + xer_ca;
1218 if ((uint32_t)T0 < (uint32_t)T1) {
1219 xer_ca = 1;
1220 } else {
1221 xer_ca = 0;
1223 RETURN();
1226 #if defined(TARGET_PPC64)
1227 void OPPROTO op_subfze_64 (void)
1229 T1 = ~T0;
1230 T0 = T1 + xer_ca;
1231 if ((uint64_t)T0 < (uint64_t)T1) {
1232 xer_ca = 1;
1233 } else {
1234 xer_ca = 0;
1236 RETURN();
1238 #endif
1240 void OPPROTO op_subfzeo (void)
1242 do_subfzeo();
1243 RETURN();
1246 #if defined(TARGET_PPC64)
1247 void OPPROTO op_subfzeo_64 (void)
1249 do_subfzeo_64();
1250 RETURN();
1252 #endif
1254 /*** Integer comparison ***/
1255 /* compare */
1256 void OPPROTO op_cmp (void)
1258 if ((int32_t)T0 < (int32_t)T1) {
1259 T0 = 0x08;
1260 } else if ((int32_t)T0 > (int32_t)T1) {
1261 T0 = 0x04;
1262 } else {
1263 T0 = 0x02;
1265 T0 |= xer_so;
1266 RETURN();
1269 #if defined(TARGET_PPC64)
1270 void OPPROTO op_cmp_64 (void)
1272 if ((int64_t)T0 < (int64_t)T1) {
1273 T0 = 0x08;
1274 } else if ((int64_t)T0 > (int64_t)T1) {
1275 T0 = 0x04;
1276 } else {
1277 T0 = 0x02;
1279 T0 |= xer_so;
1280 RETURN();
1282 #endif
1284 /* compare immediate */
1285 void OPPROTO op_cmpi (void)
1287 if ((int32_t)T0 < (int32_t)PARAM1) {
1288 T0 = 0x08;
1289 } else if ((int32_t)T0 > (int32_t)PARAM1) {
1290 T0 = 0x04;
1291 } else {
1292 T0 = 0x02;
1294 T0 |= xer_so;
1295 RETURN();
1298 #if defined(TARGET_PPC64)
1299 void OPPROTO op_cmpi_64 (void)
1301 if ((int64_t)T0 < (int64_t)((int32_t)PARAM1)) {
1302 T0 = 0x08;
1303 } else if ((int64_t)T0 > (int64_t)((int32_t)PARAM1)) {
1304 T0 = 0x04;
1305 } else {
1306 T0 = 0x02;
1308 T0 |= xer_so;
1309 RETURN();
1311 #endif
1313 /* compare logical */
1314 void OPPROTO op_cmpl (void)
1316 if ((uint32_t)T0 < (uint32_t)T1) {
1317 T0 = 0x08;
1318 } else if ((uint32_t)T0 > (uint32_t)T1) {
1319 T0 = 0x04;
1320 } else {
1321 T0 = 0x02;
1323 T0 |= xer_so;
1324 RETURN();
1327 #if defined(TARGET_PPC64)
1328 void OPPROTO op_cmpl_64 (void)
1330 if ((uint64_t)T0 < (uint64_t)T1) {
1331 T0 = 0x08;
1332 } else if ((uint64_t)T0 > (uint64_t)T1) {
1333 T0 = 0x04;
1334 } else {
1335 T0 = 0x02;
1337 T0 |= xer_so;
1338 RETURN();
1340 #endif
1342 /* compare logical immediate */
1343 void OPPROTO op_cmpli (void)
1345 if ((uint32_t)T0 < (uint32_t)PARAM1) {
1346 T0 = 0x08;
1347 } else if ((uint32_t)T0 > (uint32_t)PARAM1) {
1348 T0 = 0x04;
1349 } else {
1350 T0 = 0x02;
1352 T0 |= xer_so;
1353 RETURN();
1356 #if defined(TARGET_PPC64)
1357 void OPPROTO op_cmpli_64 (void)
1359 if ((uint64_t)T0 < (uint64_t)PARAM1) {
1360 T0 = 0x08;
1361 } else if ((uint64_t)T0 > (uint64_t)PARAM1) {
1362 T0 = 0x04;
1363 } else {
1364 T0 = 0x02;
1366 T0 |= xer_so;
1367 RETURN();
1369 #endif
1371 void OPPROTO op_isel (void)
1373 if (T0)
1374 T0 = T1;
1375 else
1376 T0 = T2;
1377 RETURN();
1380 void OPPROTO op_popcntb (void)
1382 do_popcntb();
1383 RETURN();
1386 #if defined(TARGET_PPC64)
1387 void OPPROTO op_popcntb_64 (void)
1389 do_popcntb_64();
1390 RETURN();
1392 #endif
1394 /*** Integer logical ***/
1395 /* and */
1396 void OPPROTO op_and (void)
1398 T0 &= T1;
1399 RETURN();
1402 /* andc */
1403 void OPPROTO op_andc (void)
1405 T0 &= ~T1;
1406 RETURN();
1409 /* andi. */
1410 void OPPROTO op_andi_T0 (void)
1412 T0 &= (uint32_t)PARAM1;
1413 RETURN();
1416 void OPPROTO op_andi_T1 (void)
1418 T1 &= (uint32_t)PARAM1;
1419 RETURN();
1422 #if defined(TARGET_PPC64)
1423 void OPPROTO op_andi_T0_64 (void)
1425 T0 &= ((uint64_t)PARAM1 << 32) | (uint64_t)PARAM2;
1426 RETURN();
1429 void OPPROTO op_andi_T1_64 (void)
1431 T1 &= ((uint64_t)PARAM1 << 32) | (uint64_t)PARAM2;
1432 RETURN();
1434 #endif
1436 /* count leading zero */
1437 void OPPROTO op_cntlzw (void)
1439 do_cntlzw();
1440 RETURN();
1443 #if defined(TARGET_PPC64)
1444 void OPPROTO op_cntlzd (void)
1446 do_cntlzd();
1447 RETURN();
1449 #endif
1451 /* eqv */
1452 void OPPROTO op_eqv (void)
1454 T0 = ~(T0 ^ T1);
1455 RETURN();
1458 /* extend sign byte */
1459 void OPPROTO op_extsb (void)
1461 #if defined (TARGET_PPC64)
1462 T0 = (int64_t)((int8_t)T0);
1463 #else
1464 T0 = (int32_t)((int8_t)T0);
1465 #endif
1466 RETURN();
1469 /* extend sign half word */
1470 void OPPROTO op_extsh (void)
1472 #if defined (TARGET_PPC64)
1473 T0 = (int64_t)((int16_t)T0);
1474 #else
1475 T0 = (int32_t)((int16_t)T0);
1476 #endif
1477 RETURN();
1480 #if defined (TARGET_PPC64)
1481 void OPPROTO op_extsw (void)
1483 T0 = (int64_t)((int32_t)T0);
1484 RETURN();
1486 #endif
1488 /* nand */
1489 void OPPROTO op_nand (void)
1491 T0 = ~(T0 & T1);
1492 RETURN();
1495 /* nor */
1496 void OPPROTO op_nor (void)
1498 T0 = ~(T0 | T1);
1499 RETURN();
1502 /* or */
1503 void OPPROTO op_or (void)
1505 T0 |= T1;
1506 RETURN();
1509 /* orc */
1510 void OPPROTO op_orc (void)
1512 T0 |= ~T1;
1513 RETURN();
1516 /* ori */
1517 void OPPROTO op_ori (void)
1519 T0 |= (uint32_t)PARAM1;
1520 RETURN();
1523 /* xor */
1524 void OPPROTO op_xor (void)
1526 T0 ^= T1;
1527 RETURN();
1530 /* xori */
1531 void OPPROTO op_xori (void)
1533 T0 ^= (uint32_t)PARAM1;
1534 RETURN();
1537 /*** Integer rotate ***/
1538 void OPPROTO op_rotl32_T0_T1 (void)
1540 T0 = rotl32(T0, T1 & 0x1F);
1541 RETURN();
1544 void OPPROTO op_rotli32_T0 (void)
1546 T0 = rotl32(T0, PARAM1);
1547 RETURN();
1550 #if defined(TARGET_PPC64)
1551 void OPPROTO op_rotl64_T0_T1 (void)
1553 T0 = rotl64(T0, T1 & 0x3F);
1554 RETURN();
1557 void OPPROTO op_rotli64_T0 (void)
1559 T0 = rotl64(T0, PARAM1);
1560 RETURN();
1562 #endif
1564 /*** Integer shift ***/
1565 /* shift left word */
1566 void OPPROTO op_slw (void)
1568 if (T1 & 0x20) {
1569 T0 = 0;
1570 } else {
1571 T0 = (uint32_t)(T0 << T1);
1573 RETURN();
1576 #if defined(TARGET_PPC64)
1577 void OPPROTO op_sld (void)
1579 if (T1 & 0x40) {
1580 T0 = 0;
1581 } else {
1582 T0 = T0 << T1;
1584 RETURN();
1586 #endif
1588 /* shift right algebraic word */
1589 void OPPROTO op_sraw (void)
1591 do_sraw();
1592 RETURN();
1595 #if defined(TARGET_PPC64)
1596 void OPPROTO op_srad (void)
1598 do_srad();
1599 RETURN();
1601 #endif
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) {
1610 xer_ca = 1;
1611 } else {
1612 xer_ca = 0;
1614 RETURN();
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) {
1624 xer_ca = 1;
1625 } else {
1626 xer_ca = 0;
1628 RETURN();
1630 #endif
1632 /* shift right word */
1633 void OPPROTO op_srw (void)
1635 if (T1 & 0x20) {
1636 T0 = 0;
1637 } else {
1638 T0 = (uint32_t)T0 >> T1;
1640 RETURN();
1643 #if defined(TARGET_PPC64)
1644 void OPPROTO op_srd (void)
1646 if (T1 & 0x40) {
1647 T0 = 0;
1648 } else {
1649 T0 = (uint64_t)T0 >> T1;
1651 RETURN();
1653 #endif
1655 void OPPROTO op_sl_T0_T1 (void)
1657 T0 = T0 << T1;
1658 RETURN();
1661 void OPPROTO op_sli_T0 (void)
1663 T0 = T0 << PARAM1;
1664 RETURN();
1667 void OPPROTO op_sli_T1 (void)
1669 T1 = T1 << PARAM1;
1670 RETURN();
1673 void OPPROTO op_srl_T0_T1 (void)
1675 T0 = (uint32_t)T0 >> T1;
1676 RETURN();
1679 #if defined(TARGET_PPC64)
1680 void OPPROTO op_srl_T0_T1_64 (void)
1682 T0 = (uint32_t)T0 >> T1;
1683 RETURN();
1685 #endif
1687 void OPPROTO op_srli_T0 (void)
1689 T0 = (uint32_t)T0 >> PARAM1;
1690 RETURN();
1693 #if defined(TARGET_PPC64)
1694 void OPPROTO op_srli_T0_64 (void)
1696 T0 = (uint64_t)T0 >> PARAM1;
1697 RETURN();
1699 #endif
1701 void OPPROTO op_srli_T1 (void)
1703 T1 = (uint32_t)T1 >> PARAM1;
1704 RETURN();
1707 #if defined(TARGET_PPC64)
1708 void OPPROTO op_srli_T1_64 (void)
1710 T1 = (uint64_t)T1 >> PARAM1;
1711 RETURN();
1713 #endif
1715 /*** Floating-Point arithmetic ***/
1716 /* fadd - fadd. */
1717 void OPPROTO op_fadd (void)
1719 #if USE_PRECISE_EMULATION
1720 do_fadd();
1721 #else
1722 FT0 = float64_add(FT0, FT1, &env->fp_status);
1723 #endif
1724 RETURN();
1727 /* fsub - fsub. */
1728 void OPPROTO op_fsub (void)
1730 #if USE_PRECISE_EMULATION
1731 do_fsub();
1732 #else
1733 FT0 = float64_sub(FT0, FT1, &env->fp_status);
1734 #endif
1735 RETURN();
1738 /* fmul - fmul. */
1739 void OPPROTO op_fmul (void)
1741 #if USE_PRECISE_EMULATION
1742 do_fmul();
1743 #else
1744 FT0 = float64_mul(FT0, FT1, &env->fp_status);
1745 #endif
1746 RETURN();
1749 /* fdiv - fdiv. */
1750 void OPPROTO op_fdiv (void)
1752 #if USE_PRECISE_EMULATION
1753 do_fdiv();
1754 #else
1755 FT0 = float64_div(FT0, FT1, &env->fp_status);
1756 #endif
1757 RETURN();
1760 /* fsqrt - fsqrt. */
1761 void OPPROTO op_fsqrt (void)
1763 do_fsqrt();
1764 RETURN();
1767 /* fre - fre. */
1768 void OPPROTO op_fre (void)
1770 do_fre();
1771 RETURN();
1774 /* fres - fres. */
1775 void OPPROTO op_fres (void)
1777 do_fres();
1778 RETURN();
1781 /* frsqrte - frsqrte. */
1782 void OPPROTO op_frsqrte (void)
1784 do_frsqrte();
1785 RETURN();
1788 /* fsel - fsel. */
1789 void OPPROTO op_fsel (void)
1791 do_fsel();
1792 RETURN();
1795 /*** Floating-Point multiply-and-add ***/
1796 /* fmadd - fmadd. */
1797 void OPPROTO op_fmadd (void)
1799 #if USE_PRECISE_EMULATION
1800 do_fmadd();
1801 #else
1802 FT0 = float64_mul(FT0, FT1, &env->fp_status);
1803 FT0 = float64_add(FT0, FT2, &env->fp_status);
1804 #endif
1805 RETURN();
1808 /* fmsub - fmsub. */
1809 void OPPROTO op_fmsub (void)
1811 #if USE_PRECISE_EMULATION
1812 do_fmsub();
1813 #else
1814 FT0 = float64_mul(FT0, FT1, &env->fp_status);
1815 FT0 = float64_sub(FT0, FT2, &env->fp_status);
1816 #endif
1817 RETURN();
1820 /* fnmadd - fnmadd. - fnmadds - fnmadds. */
1821 void OPPROTO op_fnmadd (void)
1823 do_fnmadd();
1824 RETURN();
1827 /* fnmsub - fnmsub. */
1828 void OPPROTO op_fnmsub (void)
1830 do_fnmsub();
1831 RETURN();
1834 /*** Floating-Point round & convert ***/
1835 /* frsp - frsp. */
1836 void OPPROTO op_frsp (void)
1838 #if USE_PRECISE_EMULATION
1839 do_frsp();
1840 #else
1841 FT0 = float64_to_float32(FT0, &env->fp_status);
1842 #endif
1843 RETURN();
1846 /* fctiw - fctiw. */
1847 void OPPROTO op_fctiw (void)
1849 do_fctiw();
1850 RETURN();
1853 /* fctiwz - fctiwz. */
1854 void OPPROTO op_fctiwz (void)
1856 do_fctiwz();
1857 RETURN();
1860 #if defined(TARGET_PPC64)
1861 /* fcfid - fcfid. */
1862 void OPPROTO op_fcfid (void)
1864 do_fcfid();
1865 RETURN();
1868 /* fctid - fctid. */
1869 void OPPROTO op_fctid (void)
1871 do_fctid();
1872 RETURN();
1875 /* fctidz - fctidz. */
1876 void OPPROTO op_fctidz (void)
1878 do_fctidz();
1879 RETURN();
1881 #endif
1883 void OPPROTO op_frin (void)
1885 do_frin();
1886 RETURN();
1889 void OPPROTO op_friz (void)
1891 do_friz();
1892 RETURN();
1895 void OPPROTO op_frip (void)
1897 do_frip();
1898 RETURN();
1901 void OPPROTO op_frim (void)
1903 do_frim();
1904 RETURN();
1907 /*** Floating-Point compare ***/
1908 /* fcmpu */
1909 void OPPROTO op_fcmpu (void)
1911 do_fcmpu();
1912 RETURN();
1915 /* fcmpo */
1916 void OPPROTO op_fcmpo (void)
1918 do_fcmpo();
1919 RETURN();
1922 /*** Floating-point move ***/
1923 /* fabs */
1924 void OPPROTO op_fabs (void)
1926 FT0 = float64_abs(FT0);
1927 RETURN();
1930 /* fnabs */
1931 void OPPROTO op_fnabs (void)
1933 FT0 = float64_abs(FT0);
1934 FT0 = float64_chs(FT0);
1935 RETURN();
1938 /* fneg */
1939 void OPPROTO op_fneg (void)
1941 FT0 = float64_chs(FT0);
1942 RETURN();
1945 /* Load and store */
1946 #define MEMSUFFIX _raw
1947 #include "op_helper.h"
1948 #include "op_mem.h"
1949 #if !defined(CONFIG_USER_ONLY)
1950 #define MEMSUFFIX _user
1951 #include "op_helper.h"
1952 #include "op_mem.h"
1953 #define MEMSUFFIX _kernel
1954 #include "op_helper.h"
1955 #include "op_mem.h"
1956 #define MEMSUFFIX _hypv
1957 #include "op_helper.h"
1958 #include "op_mem.h"
1959 #endif
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;
1966 RETURN();
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;
1974 RETURN();
1976 #endif
1978 void OPPROTO op_wait (void)
1980 env->halted = 1;
1981 RETURN();
1984 /* Return from interrupt */
1985 #if !defined(CONFIG_USER_ONLY)
1986 void OPPROTO op_rfi (void)
1988 do_rfi();
1989 RETURN();
1992 #if defined(TARGET_PPC64)
1993 void OPPROTO op_rfid (void)
1995 do_rfid();
1996 RETURN();
1999 void OPPROTO op_hrfid (void)
2001 do_hrfid();
2002 RETURN();
2004 #endif
2006 /* Exception vectors */
2007 void OPPROTO op_store_excp_prefix (void)
2009 T0 &= env->ivpr_mask;
2010 env->excp_prefix = T0;
2011 RETURN();
2014 void OPPROTO op_store_excp_vector (void)
2016 T0 &= env->ivor_mask;
2017 env->excp_vectors[PARAM1] = T0;
2018 RETURN();
2020 #endif
2022 /* Trap word */
2023 void OPPROTO op_tw (void)
2025 do_tw(PARAM1);
2026 RETURN();
2029 #if defined(TARGET_PPC64)
2030 void OPPROTO op_td (void)
2032 do_td(PARAM1);
2033 RETURN();
2035 #endif
2037 #if !defined(CONFIG_USER_ONLY)
2038 /* tlbia */
2039 void OPPROTO op_tlbia (void)
2041 ppc_tlb_invalidate_all(env);
2042 RETURN();
2045 /* tlbie */
2046 void OPPROTO op_tlbie (void)
2048 ppc_tlb_invalidate_one(env, (uint32_t)T0);
2049 RETURN();
2052 #if defined(TARGET_PPC64)
2053 void OPPROTO op_tlbie_64 (void)
2055 ppc_tlb_invalidate_one(env, T0);
2056 RETURN();
2058 #endif
2060 #if defined(TARGET_PPC64)
2061 void OPPROTO op_slbia (void)
2063 ppc_slb_invalidate_all(env);
2064 RETURN();
2067 void OPPROTO op_slbie (void)
2069 ppc_slb_invalidate_one(env, (uint32_t)T0);
2070 RETURN();
2073 void OPPROTO op_slbie_64 (void)
2075 ppc_slb_invalidate_one(env, T0);
2076 RETURN();
2078 #endif
2079 #endif
2081 #if !defined(CONFIG_USER_ONLY)
2082 /* PowerPC 602/603/755 software TLB load instructions */
2083 void OPPROTO op_6xx_tlbld (void)
2085 do_load_6xx_tlb(0);
2086 RETURN();
2089 void OPPROTO op_6xx_tlbli (void)
2091 do_load_6xx_tlb(1);
2092 RETURN();
2095 /* PowerPC 74xx software TLB load instructions */
2096 void OPPROTO op_74xx_tlbld (void)
2098 do_load_74xx_tlb(0);
2099 RETURN();
2102 void OPPROTO op_74xx_tlbli (void)
2104 do_load_74xx_tlb(1);
2105 RETURN();
2107 #endif
2109 /* 601 specific */
2110 void OPPROTO op_load_601_rtcl (void)
2112 T0 = cpu_ppc601_load_rtcl(env);
2113 RETURN();
2116 void OPPROTO op_load_601_rtcu (void)
2118 T0 = cpu_ppc601_load_rtcu(env);
2119 RETURN();
2122 #if !defined(CONFIG_USER_ONLY)
2123 void OPPROTO op_store_601_rtcl (void)
2125 cpu_ppc601_store_rtcl(env, T0);
2126 RETURN();
2129 void OPPROTO op_store_601_rtcu (void)
2131 cpu_ppc601_store_rtcu(env, T0);
2132 RETURN();
2135 void OPPROTO op_store_hid0_601 (void)
2137 do_store_hid0_601();
2138 RETURN();
2141 void OPPROTO op_load_601_bat (void)
2143 T0 = env->IBAT[PARAM1][PARAM2];
2144 RETURN();
2147 void OPPROTO op_store_601_batl (void)
2149 do_store_ibatl_601(env, PARAM1, T0);
2150 RETURN();
2153 void OPPROTO op_store_601_batu (void)
2155 do_store_ibatu_601(env, PARAM1, T0);
2156 RETURN();
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)
2165 T0 = INT32_MAX;
2166 else if ((int32_t)T0 < 0)
2167 T0 = -T0;
2168 RETURN();
2171 void OPPROTO op_POWER_abso (void)
2173 do_POWER_abso();
2174 RETURN();
2177 void OPPROTO op_POWER_clcs (void)
2179 do_POWER_clcs();
2180 RETURN();
2183 void OPPROTO op_POWER_div (void)
2185 do_POWER_div();
2186 RETURN();
2189 void OPPROTO op_POWER_divo (void)
2191 do_POWER_divo();
2192 RETURN();
2195 void OPPROTO op_POWER_divs (void)
2197 do_POWER_divs();
2198 RETURN();
2201 void OPPROTO op_POWER_divso (void)
2203 do_POWER_divso();
2204 RETURN();
2207 void OPPROTO op_POWER_doz (void)
2209 if ((int32_t)T1 > (int32_t)T0)
2210 T0 = T1 - T0;
2211 else
2212 T0 = 0;
2213 RETURN();
2216 void OPPROTO op_POWER_dozo (void)
2218 do_POWER_dozo();
2219 RETURN();
2222 void OPPROTO op_load_xer_cmp (void)
2224 T2 = xer_cmp;
2225 RETURN();
2228 void OPPROTO op_POWER_maskg (void)
2230 do_POWER_maskg();
2231 RETURN();
2234 void OPPROTO op_POWER_maskir (void)
2236 T0 = (T0 & ~T2) | (T1 & T2);
2237 RETURN();
2240 void OPPROTO op_POWER_mul (void)
2242 uint64_t tmp;
2244 tmp = (uint64_t)T0 * (uint64_t)T1;
2245 env->spr[SPR_MQ] = tmp >> 32;
2246 T0 = tmp;
2247 RETURN();
2250 void OPPROTO op_POWER_mulo (void)
2252 do_POWER_mulo();
2253 RETURN();
2256 void OPPROTO op_POWER_nabs (void)
2258 if (T0 > 0)
2259 T0 = -T0;
2260 RETURN();
2263 void OPPROTO op_POWER_nabso (void)
2265 /* nabs never overflows */
2266 if (T0 > 0)
2267 T0 = -T0;
2268 xer_ov = 0;
2269 RETURN();
2272 /* XXX: factorise POWER rotates... */
2273 void OPPROTO op_POWER_rlmi (void)
2275 T0 = rotl32(T0, T2) & PARAM1;
2276 T0 |= T1 & (uint32_t)PARAM2;
2277 RETURN();
2280 void OPPROTO op_POWER_rrib (void)
2282 T2 &= 0x1FUL;
2283 T0 = rotl32(T0 & INT32_MIN, T2);
2284 T0 |= T1 & ~rotl32(INT32_MIN, T2);
2285 RETURN();
2288 void OPPROTO op_POWER_sle (void)
2290 T1 &= 0x1FUL;
2291 env->spr[SPR_MQ] = rotl32(T0, T1);
2292 T0 = T0 << T1;
2293 RETURN();
2296 void OPPROTO op_POWER_sleq (void)
2298 uint32_t tmp = env->spr[SPR_MQ];
2300 T1 &= 0x1FUL;
2301 env->spr[SPR_MQ] = rotl32(T0, T1);
2302 T0 = T0 << T1;
2303 T0 |= tmp >> (32 - T1);
2304 RETURN();
2307 void OPPROTO op_POWER_sllq (void)
2309 uint32_t msk = UINT32_MAX;
2311 msk = msk << (T1 & 0x1FUL);
2312 if (T1 & 0x20UL)
2313 msk = ~msk;
2314 T1 &= 0x1FUL;
2315 T0 = (T0 << T1) & msk;
2316 T0 |= env->spr[SPR_MQ] & ~msk;
2317 RETURN();
2320 void OPPROTO op_POWER_slq (void)
2322 uint32_t msk = UINT32_MAX, tmp;
2324 msk = msk << (T1 & 0x1FUL);
2325 if (T1 & 0x20UL)
2326 msk = ~msk;
2327 T1 &= 0x1FUL;
2328 tmp = rotl32(T0, T1);
2329 T0 = tmp & msk;
2330 env->spr[SPR_MQ] = tmp;
2331 RETURN();
2334 void OPPROTO op_POWER_sraq (void)
2336 env->spr[SPR_MQ] = rotl32(T0, 32 - (T1 & 0x1FUL));
2337 if (T1 & 0x20UL)
2338 T0 = UINT32_MAX;
2339 else
2340 T0 = (int32_t)T0 >> T1;
2341 RETURN();
2344 void OPPROTO op_POWER_sre (void)
2346 T1 &= 0x1FUL;
2347 env->spr[SPR_MQ] = rotl32(T0, 32 - T1);
2348 T0 = (int32_t)T0 >> T1;
2349 RETURN();
2352 void OPPROTO op_POWER_srea (void)
2354 T1 &= 0x1FUL;
2355 env->spr[SPR_MQ] = T0 >> T1;
2356 T0 = (int32_t)T0 >> T1;
2357 RETURN();
2360 void OPPROTO op_POWER_sreq (void)
2362 uint32_t tmp;
2363 int32_t msk;
2365 T1 &= 0x1FUL;
2366 msk = INT32_MIN >> T1;
2367 tmp = env->spr[SPR_MQ];
2368 env->spr[SPR_MQ] = rotl32(T0, 32 - T1);
2369 T0 = T0 >> T1;
2370 T0 |= tmp & msk;
2371 RETURN();
2374 void OPPROTO op_POWER_srlq (void)
2376 uint32_t tmp;
2377 int32_t msk;
2379 msk = INT32_MIN >> (T1 & 0x1FUL);
2380 if (T1 & 0x20UL)
2381 msk = ~msk;
2382 T1 &= 0x1FUL;
2383 tmp = env->spr[SPR_MQ];
2384 env->spr[SPR_MQ] = rotl32(T0, 32 - T1);
2385 T0 = T0 >> T1;
2386 T0 &= msk;
2387 T0 |= tmp & ~msk;
2388 RETURN();
2391 void OPPROTO op_POWER_srq (void)
2393 T1 &= 0x1FUL;
2394 env->spr[SPR_MQ] = rotl32(T0, 32 - T1);
2395 T0 = T0 >> T1;
2396 RETURN();
2399 /* POWER instructions not implemented in PowerPC 601 */
2400 #if !defined(CONFIG_USER_ONLY)
2401 void OPPROTO op_POWER_mfsri (void)
2403 T1 = T0 >> 28;
2404 T0 = env->sr[T1];
2405 RETURN();
2408 void OPPROTO op_POWER_rac (void)
2410 do_POWER_rac();
2411 RETURN();
2414 void OPPROTO op_POWER_rfsvc (void)
2416 do_POWER_rfsvc();
2417 RETURN();
2419 #endif
2421 /* PowerPC 602 specific instruction */
2422 #if !defined(CONFIG_USER_ONLY)
2423 void OPPROTO op_602_mfrom (void)
2425 do_op_602_mfrom();
2426 RETURN();
2428 #endif
2430 /* PowerPC 4xx specific micro-ops */
2431 void OPPROTO op_405_add_T0_T2 (void)
2433 T0 = (int32_t)T0 + (int32_t)T2;
2434 RETURN();
2437 void OPPROTO op_405_mulchw (void)
2439 T0 = ((int16_t)T0) * ((int16_t)(T1 >> 16));
2440 RETURN();
2443 void OPPROTO op_405_mulchwu (void)
2445 T0 = ((uint16_t)T0) * ((uint16_t)(T1 >> 16));
2446 RETURN();
2449 void OPPROTO op_405_mulhhw (void)
2451 T0 = ((int16_t)(T0 >> 16)) * ((int16_t)(T1 >> 16));
2452 RETURN();
2455 void OPPROTO op_405_mulhhwu (void)
2457 T0 = ((uint16_t)(T0 >> 16)) * ((uint16_t)(T1 >> 16));
2458 RETURN();
2461 void OPPROTO op_405_mullhw (void)
2463 T0 = ((int16_t)T0) * ((int16_t)T1);
2464 RETURN();
2467 void OPPROTO op_405_mullhwu (void)
2469 T0 = ((uint16_t)T0) * ((uint16_t)T1);
2470 RETURN();
2473 void OPPROTO op_405_check_sat (void)
2475 do_405_check_sat();
2476 RETURN();
2479 void OPPROTO op_405_check_ovu (void)
2481 if (likely(T0 >= T2)) {
2482 xer_ov = 0;
2483 } else {
2484 xer_ov = 1;
2485 xer_so = 1;
2487 RETURN();
2490 void OPPROTO op_405_check_satu (void)
2492 if (unlikely(T0 < T2)) {
2493 /* Saturate result */
2494 T0 = UINT32_MAX;
2496 RETURN();
2499 void OPPROTO op_load_dcr (void)
2501 do_load_dcr();
2502 RETURN();
2505 void OPPROTO op_store_dcr (void)
2507 do_store_dcr();
2508 RETURN();
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)
2517 do_40x_rfci();
2518 RETURN();
2521 void OPPROTO op_rfci (void)
2523 do_rfci();
2524 RETURN();
2527 void OPPROTO op_rfdi (void)
2529 do_rfdi();
2530 RETURN();
2533 void OPPROTO op_rfmci (void)
2535 do_rfmci();
2536 RETURN();
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
2544 T0 &= 1 << MSR_EE;
2545 env->msr &= ~(1 << MSR_EE);
2546 env->msr |= T0;
2547 RETURN();
2550 void OPPROTO op_440_tlbre (void)
2552 do_440_tlbre(PARAM1);
2553 RETURN();
2556 void OPPROTO op_440_tlbsx (void)
2558 T0 = ppcemb_tlb_search(env, T0, env->spr[SPR_440_MMUCR] & 0xFF);
2559 RETURN();
2562 void OPPROTO op_4xx_tlbsx_check (void)
2564 int tmp;
2566 tmp = xer_so;
2567 if ((int)T0 != -1)
2568 tmp |= 0x02;
2569 env->crf[0] = tmp;
2570 RETURN();
2573 void OPPROTO op_440_tlbwe (void)
2575 do_440_tlbwe(PARAM1);
2576 RETURN();
2579 void OPPROTO op_4xx_tlbre_lo (void)
2581 do_4xx_tlbre_lo();
2582 RETURN();
2585 void OPPROTO op_4xx_tlbre_hi (void)
2587 do_4xx_tlbre_hi();
2588 RETURN();
2591 void OPPROTO op_4xx_tlbsx (void)
2593 T0 = ppcemb_tlb_search(env, T0, env->spr[SPR_40x_PID]);
2594 RETURN();
2597 void OPPROTO op_4xx_tlbwe_lo (void)
2599 do_4xx_tlbwe_lo();
2600 RETURN();
2603 void OPPROTO op_4xx_tlbwe_hi (void)
2605 do_4xx_tlbwe_hi();
2606 RETURN();
2608 #endif
2610 /* SPR micro-ops */
2611 /* 440 specific */
2612 void OPPROTO op_440_dlmzb (void)
2614 do_440_dlmzb();
2615 RETURN();
2618 void OPPROTO op_440_dlmzb_update_Rc (void)
2620 if (T0 == 8)
2621 T0 = 0x2;
2622 else if (T0 < 4)
2623 T0 = 0x4;
2624 else
2625 T0 = 0x8;
2626 RETURN();
2629 #if !defined(CONFIG_USER_ONLY)
2630 void OPPROTO op_store_pir (void)
2632 env->spr[SPR_PIR] = T0 & 0x0000000FUL;
2633 RETURN();
2636 void OPPROTO op_load_403_pb (void)
2638 do_load_403_pb(PARAM1);
2639 RETURN();
2642 void OPPROTO op_store_403_pb (void)
2644 do_store_403_pb(PARAM1);
2645 RETURN();
2648 void OPPROTO op_load_40x_pit (void)
2650 T0 = load_40x_pit(env);
2651 RETURN();
2654 void OPPROTO op_store_40x_pit (void)
2656 store_40x_pit(env, T0);
2657 RETURN();
2660 void OPPROTO op_store_40x_dbcr0 (void)
2662 store_40x_dbcr0(env, T0);
2663 RETURN();
2666 void OPPROTO op_store_40x_sler (void)
2668 store_40x_sler(env, T0);
2669 RETURN();
2672 void OPPROTO op_store_booke_tcr (void)
2674 store_booke_tcr(env, T0);
2675 RETURN();
2678 void OPPROTO op_store_booke_tsr (void)
2680 store_booke_tsr(env, T0);
2681 RETURN();
2683 #endif /* !defined(CONFIG_USER_ONLY) */
2685 /* SPE extension */
2686 void OPPROTO op_splatw_T1_64 (void)
2688 T1_64 = (T1_64 << 32) | (T1_64 & 0x00000000FFFFFFFFULL);
2689 RETURN();
2692 void OPPROTO op_splatwi_T0_64 (void)
2694 uint64_t tmp = PARAM1;
2696 T0_64 = (tmp << 32) | tmp;
2697 RETURN();
2700 void OPPROTO op_splatwi_T1_64 (void)
2702 uint64_t tmp = PARAM1;
2704 T1_64 = (tmp << 32) | tmp;
2705 RETURN();
2708 void OPPROTO op_extsh_T1_64 (void)
2710 T1_64 = (int32_t)((int16_t)T1_64);
2711 RETURN();
2714 void OPPROTO op_sli16_T1_64 (void)
2716 T1_64 = T1_64 << 16;
2717 RETURN();
2720 void OPPROTO op_sli32_T1_64 (void)
2722 T1_64 = T1_64 << 32;
2723 RETURN();
2726 void OPPROTO op_srli32_T1_64 (void)
2728 T1_64 = T1_64 >> 32;
2729 RETURN();
2732 void OPPROTO op_evsel (void)
2734 do_evsel();
2735 RETURN();
2738 void OPPROTO op_evaddw (void)
2740 do_evaddw();
2741 RETURN();
2744 void OPPROTO op_evsubfw (void)
2746 do_evsubfw();
2747 RETURN();
2750 void OPPROTO op_evneg (void)
2752 do_evneg();
2753 RETURN();
2756 void OPPROTO op_evabs (void)
2758 do_evabs();
2759 RETURN();
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);
2766 RETURN();
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);
2773 RETURN();
2776 void OPPROTO op_evcntlzw (void)
2778 do_evcntlzw();
2779 RETURN();
2782 void OPPROTO op_evrndw (void)
2784 do_evrndw();
2785 RETURN();
2788 void OPPROTO op_brinc (void)
2790 do_brinc();
2791 RETURN();
2794 void OPPROTO op_evcntlsw (void)
2796 do_evcntlsw();
2797 RETURN();
2800 void OPPROTO op_evand (void)
2802 T0_64 &= T1_64;
2803 RETURN();
2806 void OPPROTO op_evandc (void)
2808 T0_64 &= ~T1_64;
2809 RETURN();
2812 void OPPROTO op_evor (void)
2814 T0_64 |= T1_64;
2815 RETURN();
2818 void OPPROTO op_evxor (void)
2820 T0_64 ^= T1_64;
2821 RETURN();
2824 void OPPROTO op_eveqv (void)
2826 T0_64 = ~(T0_64 ^ T1_64);
2827 RETURN();
2830 void OPPROTO op_evnor (void)
2832 T0_64 = ~(T0_64 | T1_64);
2833 RETURN();
2836 void OPPROTO op_evorc (void)
2838 T0_64 |= ~T1_64;
2839 RETURN();
2842 void OPPROTO op_evnand (void)
2844 T0_64 = ~(T0_64 & T1_64);
2845 RETURN();
2848 void OPPROTO op_evsrws (void)
2850 do_evsrws();
2851 RETURN();
2854 void OPPROTO op_evsrwu (void)
2856 do_evsrwu();
2857 RETURN();
2860 void OPPROTO op_evslw (void)
2862 do_evslw();
2863 RETURN();
2866 void OPPROTO op_evrlw (void)
2868 do_evrlw();
2869 RETURN();
2872 void OPPROTO op_evmergelo (void)
2874 T0_64 = (T0_64 << 32) | (T1_64 & 0x00000000FFFFFFFFULL);
2875 RETURN();
2878 void OPPROTO op_evmergehi (void)
2880 T0_64 = (T0_64 & 0xFFFFFFFF00000000ULL) | (T1_64 >> 32);
2881 RETURN();
2884 void OPPROTO op_evmergelohi (void)
2886 T0_64 = (T0_64 << 32) | (T1_64 >> 32);
2887 RETURN();
2890 void OPPROTO op_evmergehilo (void)
2892 T0_64 = (T0_64 & 0xFFFFFFFF00000000ULL) | (T1_64 & 0x00000000FFFFFFFFULL);
2893 RETURN();
2896 void OPPROTO op_evcmpgts (void)
2898 do_evcmpgts();
2899 RETURN();
2902 void OPPROTO op_evcmpgtu (void)
2904 do_evcmpgtu();
2905 RETURN();
2908 void OPPROTO op_evcmplts (void)
2910 do_evcmplts();
2911 RETURN();
2914 void OPPROTO op_evcmpltu (void)
2916 do_evcmpltu();
2917 RETURN();
2920 void OPPROTO op_evcmpeq (void)
2922 do_evcmpeq();
2923 RETURN();
2926 void OPPROTO op_evfssub (void)
2928 do_evfssub();
2929 RETURN();
2932 void OPPROTO op_evfsadd (void)
2934 do_evfsadd();
2935 RETURN();
2938 void OPPROTO op_evfsnabs (void)
2940 do_evfsnabs();
2941 RETURN();
2944 void OPPROTO op_evfsabs (void)
2946 do_evfsabs();
2947 RETURN();
2950 void OPPROTO op_evfsneg (void)
2952 do_evfsneg();
2953 RETURN();
2956 void OPPROTO op_evfsdiv (void)
2958 do_evfsdiv();
2959 RETURN();
2962 void OPPROTO op_evfsmul (void)
2964 do_evfsmul();
2965 RETURN();
2968 void OPPROTO op_evfscmplt (void)
2970 do_evfscmplt();
2971 RETURN();
2974 void OPPROTO op_evfscmpgt (void)
2976 do_evfscmpgt();
2977 RETURN();
2980 void OPPROTO op_evfscmpeq (void)
2982 do_evfscmpeq();
2983 RETURN();
2986 void OPPROTO op_evfscfsi (void)
2988 do_evfscfsi();
2989 RETURN();
2992 void OPPROTO op_evfscfui (void)
2994 do_evfscfui();
2995 RETURN();
2998 void OPPROTO op_evfscfsf (void)
3000 do_evfscfsf();
3001 RETURN();
3004 void OPPROTO op_evfscfuf (void)
3006 do_evfscfuf();
3007 RETURN();
3010 void OPPROTO op_evfsctsi (void)
3012 do_evfsctsi();
3013 RETURN();
3016 void OPPROTO op_evfsctui (void)
3018 do_evfsctui();
3019 RETURN();
3022 void OPPROTO op_evfsctsf (void)
3024 do_evfsctsf();
3025 RETURN();
3028 void OPPROTO op_evfsctuf (void)
3030 do_evfsctuf();
3031 RETURN();
3034 void OPPROTO op_evfsctuiz (void)
3036 do_evfsctuiz();
3037 RETURN();
3040 void OPPROTO op_evfsctsiz (void)
3042 do_evfsctsiz();
3043 RETURN();
3046 void OPPROTO op_evfststlt (void)
3048 do_evfststlt();
3049 RETURN();
3052 void OPPROTO op_evfststgt (void)
3054 do_evfststgt();
3055 RETURN();
3058 void OPPROTO op_evfststeq (void)
3060 do_evfststeq();
3061 RETURN();
3064 void OPPROTO op_efssub (void)
3066 T0_64 = _do_efssub(T0_64, T1_64);
3067 RETURN();
3070 void OPPROTO op_efsadd (void)
3072 T0_64 = _do_efsadd(T0_64, T1_64);
3073 RETURN();
3076 void OPPROTO op_efsnabs (void)
3078 T0_64 = _do_efsnabs(T0_64);
3079 RETURN();
3082 void OPPROTO op_efsabs (void)
3084 T0_64 = _do_efsabs(T0_64);
3085 RETURN();
3088 void OPPROTO op_efsneg (void)
3090 T0_64 = _do_efsneg(T0_64);
3091 RETURN();
3094 void OPPROTO op_efsdiv (void)
3096 T0_64 = _do_efsdiv(T0_64, T1_64);
3097 RETURN();
3100 void OPPROTO op_efsmul (void)
3102 T0_64 = _do_efsmul(T0_64, T1_64);
3103 RETURN();
3106 void OPPROTO op_efscmplt (void)
3108 do_efscmplt();
3109 RETURN();
3112 void OPPROTO op_efscmpgt (void)
3114 do_efscmpgt();
3115 RETURN();
3118 void OPPROTO op_efscfd (void)
3120 do_efscfd();
3121 RETURN();
3124 void OPPROTO op_efscmpeq (void)
3126 do_efscmpeq();
3127 RETURN();
3130 void OPPROTO op_efscfsi (void)
3132 do_efscfsi();
3133 RETURN();
3136 void OPPROTO op_efscfui (void)
3138 do_efscfui();
3139 RETURN();
3142 void OPPROTO op_efscfsf (void)
3144 do_efscfsf();
3145 RETURN();
3148 void OPPROTO op_efscfuf (void)
3150 do_efscfuf();
3151 RETURN();
3154 void OPPROTO op_efsctsi (void)
3156 do_efsctsi();
3157 RETURN();
3160 void OPPROTO op_efsctui (void)
3162 do_efsctui();
3163 RETURN();
3166 void OPPROTO op_efsctsf (void)
3168 do_efsctsf();
3169 RETURN();
3172 void OPPROTO op_efsctuf (void)
3174 do_efsctuf();
3175 RETURN();
3178 void OPPROTO op_efsctsiz (void)
3180 do_efsctsiz();
3181 RETURN();
3184 void OPPROTO op_efsctuiz (void)
3186 do_efsctuiz();
3187 RETURN();
3190 void OPPROTO op_efststlt (void)
3192 T0 = _do_efststlt(T0_64, T1_64);
3193 RETURN();
3196 void OPPROTO op_efststgt (void)
3198 T0 = _do_efststgt(T0_64, T1_64);
3199 RETURN();
3202 void OPPROTO op_efststeq (void)
3204 T0 = _do_efststeq(T0_64, T1_64);
3205 RETURN();
3208 void OPPROTO op_efdsub (void)
3210 CPU_DoubleU u1, u2;
3211 u1.ll = T0_64;
3212 u2.ll = T1_64;
3213 u1.d = float64_sub(u1.d, u2.d, &env->spe_status);
3214 T0_64 = u1.ll;
3215 RETURN();
3218 void OPPROTO op_efdadd (void)
3220 CPU_DoubleU u1, u2;
3221 u1.ll = T0_64;
3222 u2.ll = T1_64;
3223 u1.d = float64_add(u1.d, u2.d, &env->spe_status);
3224 T0_64 = u1.ll;
3225 RETURN();
3228 void OPPROTO op_efdcfsid (void)
3230 do_efdcfsi();
3231 RETURN();
3234 void OPPROTO op_efdcfuid (void)
3236 do_efdcfui();
3237 RETURN();
3240 void OPPROTO op_efdnabs (void)
3242 T0_64 |= 0x8000000000000000ULL;
3243 RETURN();
3246 void OPPROTO op_efdabs (void)
3248 T0_64 &= ~0x8000000000000000ULL;
3249 RETURN();
3252 void OPPROTO op_efdneg (void)
3254 T0_64 ^= 0x8000000000000000ULL;
3255 RETURN();
3258 void OPPROTO op_efddiv (void)
3260 CPU_DoubleU u1, u2;
3261 u1.ll = T0_64;
3262 u2.ll = T1_64;
3263 u1.d = float64_div(u1.d, u2.d, &env->spe_status);
3264 T0_64 = u1.ll;
3265 RETURN();
3268 void OPPROTO op_efdmul (void)
3270 CPU_DoubleU u1, u2;
3271 u1.ll = T0_64;
3272 u2.ll = T1_64;
3273 u1.d = float64_mul(u1.d, u2.d, &env->spe_status);
3274 T0_64 = u1.ll;
3275 RETURN();
3278 void OPPROTO op_efdctsidz (void)
3280 do_efdctsiz();
3281 RETURN();
3284 void OPPROTO op_efdctuidz (void)
3286 do_efdctuiz();
3287 RETURN();
3290 void OPPROTO op_efdcmplt (void)
3292 do_efdcmplt();
3293 RETURN();
3296 void OPPROTO op_efdcmpgt (void)
3298 do_efdcmpgt();
3299 RETURN();
3302 void OPPROTO op_efdcfs (void)
3304 do_efdcfs();
3305 RETURN();
3308 void OPPROTO op_efdcmpeq (void)
3310 do_efdcmpeq();
3311 RETURN();
3314 void OPPROTO op_efdcfsi (void)
3316 do_efdcfsi();
3317 RETURN();
3320 void OPPROTO op_efdcfui (void)
3322 do_efdcfui();
3323 RETURN();
3326 void OPPROTO op_efdcfsf (void)
3328 do_efdcfsf();
3329 RETURN();
3332 void OPPROTO op_efdcfuf (void)
3334 do_efdcfuf();
3335 RETURN();
3338 void OPPROTO op_efdctsi (void)
3340 do_efdctsi();
3341 RETURN();
3344 void OPPROTO op_efdctui (void)
3346 do_efdctui();
3347 RETURN();
3350 void OPPROTO op_efdctsf (void)
3352 do_efdctsf();
3353 RETURN();
3356 void OPPROTO op_efdctuf (void)
3358 do_efdctuf();
3359 RETURN();
3362 void OPPROTO op_efdctuiz (void)
3364 do_efdctuiz();
3365 RETURN();
3368 void OPPROTO op_efdctsiz (void)
3370 do_efdctsiz();
3371 RETURN();
3374 void OPPROTO op_efdtstlt (void)
3376 T0 = _do_efdtstlt(T0_64, T1_64);
3377 RETURN();
3380 void OPPROTO op_efdtstgt (void)
3382 T0 = _do_efdtstgt(T0_64, T1_64);
3383 RETURN();
3386 void OPPROTO op_efdtsteq (void)
3388 T0 = _do_efdtsteq(T0_64, T1_64);
3389 RETURN();