kvm: external module: moving source munging for cross-arch support
[qemu-kvm/fedora.git] / target-sh4 / op.c
blob54a5c7b6a87b58bf96607f1c59a4a6eeceb67e66
1 /*
2 * SH4 emulation
4 * Copyright (c) 2005 Samuel Tardieu
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
20 #include "exec.h"
22 static inline void set_t(void)
24 env->sr |= SR_T;
27 static inline void clr_t(void)
29 env->sr &= ~SR_T;
32 static inline void cond_t(int cond)
34 if (cond)
35 set_t();
36 else
37 clr_t();
40 void OPPROTO op_movl_imm_T0(void)
42 T0 = (uint32_t) PARAM1;
43 RETURN();
46 void OPPROTO op_movl_imm_T1(void)
48 T1 = (uint32_t) PARAM1;
49 RETURN();
52 void OPPROTO op_cmp_eq_imm_T0(void)
54 cond_t((int32_t) T0 == (int32_t) PARAM1);
55 RETURN();
58 void OPPROTO op_cmd_eq_T0_T1(void)
60 cond_t(T0 == T1);
61 RETURN();
64 void OPPROTO op_cmd_hs_T0_T1(void)
66 cond_t((uint32_t) T0 <= (uint32_t) T1);
67 RETURN();
70 void OPPROTO op_cmd_ge_T0_T1(void)
72 cond_t((int32_t) T0 <= (int32_t) T1);
73 RETURN();
76 void OPPROTO op_cmd_hi_T0_T1(void)
78 cond_t((uint32_t) T0 < (uint32_t) T1);
79 RETURN();
82 void OPPROTO op_cmd_gt_T0_T1(void)
84 cond_t((int32_t) T0 < (int32_t) T1);
85 RETURN();
88 void OPPROTO op_not_T0(void)
90 T0 = ~T0;
91 RETURN();
94 void OPPROTO op_bf_s(void)
96 env->delayed_pc = PARAM1;
97 if (!(env->sr & SR_T)) {
98 env->flags |= DELAY_SLOT_TRUE;
100 RETURN();
103 void OPPROTO op_bt_s(void)
105 env->delayed_pc = PARAM1;
106 if (env->sr & SR_T) {
107 env->flags |= DELAY_SLOT_TRUE;
109 RETURN();
112 void OPPROTO op_store_flags(void)
114 env->flags &= DELAY_SLOT_TRUE;
115 env->flags |= PARAM1;
116 RETURN();
119 void OPPROTO op_bra(void)
121 env->delayed_pc = PARAM1;
122 RETURN();
125 void OPPROTO op_braf_T0(void)
127 env->delayed_pc = PARAM1 + T0;
128 RETURN();
131 void OPPROTO op_bsr(void)
133 env->pr = PARAM1;
134 env->delayed_pc = PARAM2;
135 RETURN();
138 void OPPROTO op_bsrf_T0(void)
140 env->pr = PARAM1;
141 env->delayed_pc = PARAM1 + T0;
142 RETURN();
145 void OPPROTO op_jsr_T0(void)
147 env->pr = PARAM1;
148 env->delayed_pc = T0;
149 RETURN();
152 void OPPROTO op_rts(void)
154 env->delayed_pc = env->pr;
155 RETURN();
158 void OPPROTO op_addl_imm_T0(void)
160 T0 += PARAM1;
161 RETURN();
164 void OPPROTO op_addl_imm_T1(void)
166 T1 += PARAM1;
167 RETURN();
170 void OPPROTO op_clrmac(void)
172 env->mach = env->macl = 0;
173 RETURN();
176 void OPPROTO op_clrs(void)
178 env->sr &= ~SR_S;
179 RETURN();
182 void OPPROTO op_clrt(void)
184 env->sr &= ~SR_T;
185 RETURN();
188 void OPPROTO op_ldtlb(void)
190 helper_ldtlb();
191 RETURN();
194 void OPPROTO op_sets(void)
196 env->sr |= SR_S;
197 RETURN();
200 void OPPROTO op_sett(void)
202 env->sr |= SR_T;
203 RETURN();
206 void OPPROTO op_frchg(void)
208 env->fpscr ^= FPSCR_FR;
209 RETURN();
212 void OPPROTO op_fschg(void)
214 env->fpscr ^= FPSCR_SZ;
215 RETURN();
218 void OPPROTO op_rte(void)
220 env->sr = env->ssr;
221 env->delayed_pc = env->spc;
222 RETURN();
225 void OPPROTO op_swapb_T0(void)
227 T0 = (T0 & 0xffff0000) | ((T0 & 0xff) << 8) | ((T0 >> 8) & 0xff);
228 RETURN();
231 void OPPROTO op_swapw_T0(void)
233 T0 = ((T0 & 0xffff) << 16) | ((T0 >> 16) & 0xffff);
234 RETURN();
237 void OPPROTO op_xtrct_T0_T1(void)
239 T1 = ((T0 & 0xffff) << 16) | ((T1 >> 16) & 0xffff);
240 RETURN();
243 void OPPROTO op_add_T0_T1(void)
245 T1 += T0;
246 RETURN();
249 void OPPROTO op_addc_T0_T1(void)
251 helper_addc_T0_T1();
252 RETURN();
255 void OPPROTO op_addv_T0_T1(void)
257 helper_addv_T0_T1();
258 RETURN();
261 void OPPROTO op_cmp_eq_T0_T1(void)
263 cond_t(T1 == T0);
264 RETURN();
267 void OPPROTO op_cmp_ge_T0_T1(void)
269 cond_t((int32_t) T1 >= (int32_t) T0);
270 RETURN();
273 void OPPROTO op_cmp_gt_T0_T1(void)
275 cond_t((int32_t) T1 > (int32_t) T0);
276 RETURN();
279 void OPPROTO op_cmp_hi_T0_T1(void)
281 cond_t((uint32_t) T1 > (uint32_t) T0);
282 RETURN();
285 void OPPROTO op_cmp_hs_T0_T1(void)
287 cond_t((uint32_t) T1 >= (uint32_t) T0);
288 RETURN();
291 void OPPROTO op_cmp_str_T0_T1(void)
293 cond_t((T0 & 0x000000ff) == (T1 & 0x000000ff) ||
294 (T0 & 0x0000ff00) == (T1 & 0x0000ff00) ||
295 (T0 & 0x00ff0000) == (T1 & 0x00ff0000) ||
296 (T0 & 0xff000000) == (T1 & 0xff000000));
297 RETURN();
300 void OPPROTO op_tst_T0_T1(void)
302 cond_t((T1 & T0) == 0);
303 RETURN();
306 void OPPROTO op_div0s_T0_T1(void)
308 if (T1 & 0x80000000)
309 env->sr |= SR_Q;
310 else
311 env->sr &= ~SR_Q;
312 if (T0 & 0x80000000)
313 env->sr |= SR_M;
314 else
315 env->sr &= ~SR_M;
316 cond_t((T1 ^ T0) & 0x80000000);
317 RETURN();
320 void OPPROTO op_div0u(void)
322 env->sr &= ~(SR_M | SR_Q | SR_T);
323 RETURN();
326 void OPPROTO op_div1_T0_T1(void)
328 helper_div1_T0_T1();
329 RETURN();
332 void OPPROTO op_dmulsl_T0_T1(void)
334 helper_dmulsl_T0_T1();
335 RETURN();
338 void OPPROTO op_dmulul_T0_T1(void)
340 helper_dmulul_T0_T1();
341 RETURN();
344 void OPPROTO op_macl_T0_T1(void)
346 helper_macl_T0_T1();
347 RETURN();
350 void OPPROTO op_macw_T0_T1(void)
352 helper_macw_T0_T1();
353 RETURN();
356 void OPPROTO op_mull_T0_T1(void)
358 env->macl = (T0 * T1) & 0xffffffff;
359 RETURN();
362 void OPPROTO op_mulsw_T0_T1(void)
364 env->macl = (int32_t)(int16_t) T0 *(int32_t)(int16_t) T1;
365 RETURN();
368 void OPPROTO op_muluw_T0_T1(void)
370 env->macl = (uint32_t)(uint16_t) T0 *(uint32_t)(uint16_t) T1;
371 RETURN();
374 void OPPROTO op_neg_T0(void)
376 T0 = -T0;
377 RETURN();
380 void OPPROTO op_negc_T0(void)
382 helper_negc_T0();
383 RETURN();
386 void OPPROTO op_shad_T0_T1(void)
388 if ((T0 & 0x80000000) == 0)
389 T1 <<= (T0 & 0x1f);
390 else if ((T0 & 0x1f) == 0)
391 T1 = (T1 & 0x80000000)? 0xffffffff : 0;
392 else
393 T1 = ((int32_t) T1) >> ((~T0 & 0x1f) + 1);
394 RETURN();
397 void OPPROTO op_shld_T0_T1(void)
399 if ((T0 & 0x80000000) == 0)
400 T1 <<= (T0 & 0x1f);
401 else if ((T0 & 0x1f) == 0)
402 T1 = 0;
403 else
404 T1 = ((uint32_t) T1) >> ((~T0 & 0x1f) + 1);
405 RETURN();
408 void OPPROTO op_subc_T0_T1(void)
410 helper_subc_T0_T1();
411 RETURN();
414 void OPPROTO op_subv_T0_T1(void)
416 helper_subv_T0_T1();
417 RETURN();
420 void OPPROTO op_trapa(void)
422 env->tra = PARAM1 << 2;
423 env->exception_index = 0x160;
424 do_raise_exception();
425 RETURN();
428 void OPPROTO op_cmp_pl_T0(void)
430 cond_t((int32_t) T0 > 0);
431 RETURN();
434 void OPPROTO op_cmp_pz_T0(void)
436 cond_t((int32_t) T0 >= 0);
437 RETURN();
440 void OPPROTO op_jmp_T0(void)
442 env->delayed_pc = T0;
443 RETURN();
446 void OPPROTO op_movl_rN_rN(void)
448 env->gregs[PARAM2] = env->gregs[PARAM1];
449 RETURN();
452 void OPPROTO op_ldcl_rMplus_rN_bank(void)
454 env->gregs[PARAM2] = env->gregs[PARAM1];
455 env->gregs[PARAM1] += 4;
456 RETURN();
459 void OPPROTO op_ldc_T0_sr(void)
461 env->sr = T0 & 0x700083f3;
462 RETURN();
465 void OPPROTO op_stc_sr_T0(void)
467 T0 = env->sr;
468 RETURN();
471 #define LDSTOPS(target,load,store) \
472 void OPPROTO op_##load##_T0_##target (void) \
473 { env ->target = T0; RETURN(); \
475 void OPPROTO op_##store##_##target##_T0 (void) \
476 { T0 = env->target; RETURN(); \
479 LDSTOPS(gbr, ldc, stc)
480 LDSTOPS(vbr, ldc, stc)
481 LDSTOPS(ssr, ldc, stc)
482 LDSTOPS(spc, ldc, stc)
483 LDSTOPS(sgr, ldc, stc)
484 LDSTOPS(dbr, ldc, stc)
485 LDSTOPS(mach, lds, sts)
486 LDSTOPS(macl, lds, sts)
487 LDSTOPS(pr, lds, sts)
488 LDSTOPS(fpul, lds, sts)
490 void OPPROTO op_lds_T0_fpscr(void)
492 env->fpscr = T0 & 0x003fffff;
493 env->fp_status.float_rounding_mode = T0 & 0x01 ?
494 float_round_to_zero : float_round_nearest_even;
496 RETURN();
499 void OPPROTO op_sts_fpscr_T0(void)
501 T0 = env->fpscr & 0x003fffff;
502 RETURN();
505 void OPPROTO op_movt_rN(void)
507 env->gregs[PARAM1] = env->sr & SR_T;
508 RETURN();
511 void OPPROTO op_rotcl_Rn(void)
513 helper_rotcl(&env->gregs[PARAM1]);
514 RETURN();
517 void OPPROTO op_rotcr_Rn(void)
519 helper_rotcr(&env->gregs[PARAM1]);
520 RETURN();
523 void OPPROTO op_rotl_Rn(void)
525 cond_t(env->gregs[PARAM1] & 0x80000000);
526 env->gregs[PARAM1] = (env->gregs[PARAM1] << 1) | (env->sr & SR_T);
527 RETURN();
530 void OPPROTO op_rotr_Rn(void)
532 cond_t(env->gregs[PARAM1] & 1);
533 env->gregs[PARAM1] = (env->gregs[PARAM1] >> 1) |
534 ((env->sr & SR_T) ? 0x80000000 : 0);
535 RETURN();
538 void OPPROTO op_shal_Rn(void)
540 cond_t(env->gregs[PARAM1] & 0x80000000);
541 env->gregs[PARAM1] <<= 1;
542 RETURN();
545 void OPPROTO op_shar_Rn(void)
547 cond_t(env->gregs[PARAM1] & 1);
548 *(int32_t *)&env->gregs[PARAM1] >>= 1;
549 RETURN();
552 void OPPROTO op_shlr_Rn(void)
554 cond_t(env->gregs[PARAM1] & 1);
555 env->gregs[PARAM1] >>= 1;
556 RETURN();
559 void OPPROTO op_shll2_Rn(void)
561 env->gregs[PARAM1] <<= 2;
562 RETURN();
565 void OPPROTO op_shll8_Rn(void)
567 env->gregs[PARAM1] <<= 8;
568 RETURN();
571 void OPPROTO op_shll16_Rn(void)
573 env->gregs[PARAM1] <<= 16;
574 RETURN();
577 void OPPROTO op_shlr2_Rn(void)
579 env->gregs[PARAM1] >>= 2;
580 RETURN();
583 void OPPROTO op_shlr8_Rn(void)
585 env->gregs[PARAM1] >>= 8;
586 RETURN();
589 void OPPROTO op_shlr16_Rn(void)
591 env->gregs[PARAM1] >>= 16;
592 RETURN();
595 void OPPROTO op_movl_T0_rN(void)
597 env->gregs[PARAM1] = T0;
598 RETURN();
601 void OPPROTO op_movl_T1_rN(void)
603 env->gregs[PARAM1] = T1;
604 RETURN();
607 void OPPROTO op_movb_rN_T0(void)
609 T0 = (int32_t) (int8_t) (env->gregs[PARAM1] & 0xff);
610 RETURN();
613 void OPPROTO op_movub_rN_T0(void)
615 T0 = env->gregs[PARAM1] & 0xff;
616 RETURN();
619 void OPPROTO op_movw_rN_T0(void)
621 T0 = (int32_t) (int16_t) (env->gregs[PARAM1] & 0xffff);
622 RETURN();
625 void OPPROTO op_movuw_rN_T0(void)
627 T0 = env->gregs[PARAM1] & 0xffff;
628 RETURN();
631 void OPPROTO op_movl_rN_T0(void)
633 T0 = env->gregs[PARAM1];
634 RETURN();
637 void OPPROTO op_movb_rN_T1(void)
639 T1 = (int32_t) (int8_t) (env->gregs[PARAM1] & 0xff);
640 RETURN();
643 void OPPROTO op_movub_rN_T1(void)
645 T1 = env->gregs[PARAM1] & 0xff;
646 RETURN();
649 void OPPROTO op_movw_rN_T1(void)
651 T1 = (int32_t) (int16_t) (env->gregs[PARAM1] & 0xffff);
652 RETURN();
655 void OPPROTO op_movuw_rN_T1(void)
657 T1 = env->gregs[PARAM1] & 0xffff;
658 RETURN();
661 void OPPROTO op_movl_rN_T1(void)
663 T1 = env->gregs[PARAM1];
664 RETURN();
667 void OPPROTO op_movl_imm_rN(void)
669 env->gregs[PARAM2] = PARAM1;
670 RETURN();
673 void OPPROTO op_fmov_frN_FT0(void)
675 FT0 = env->fregs[PARAM1];
676 RETURN();
679 void OPPROTO op_fmov_drN_DT0(void)
681 CPU_DoubleU d;
683 d.l.upper = *(uint32_t *)&env->fregs[PARAM1];
684 d.l.lower = *(uint32_t *)&env->fregs[PARAM1 + 1];
685 DT0 = d.d;
686 RETURN();
689 void OPPROTO op_fmov_frN_FT1(void)
691 FT1 = env->fregs[PARAM1];
692 RETURN();
695 void OPPROTO op_fmov_drN_DT1(void)
697 CPU_DoubleU d;
699 d.l.upper = *(uint32_t *)&env->fregs[PARAM1];
700 d.l.lower = *(uint32_t *)&env->fregs[PARAM1 + 1];
701 DT1 = d.d;
702 RETURN();
705 void OPPROTO op_fmov_FT0_frN(void)
707 env->fregs[PARAM1] = FT0;
708 RETURN();
711 void OPPROTO op_fmov_DT0_drN(void)
713 CPU_DoubleU d;
715 d.d = DT0;
716 *(uint32_t *)&env->fregs[PARAM1] = d.l.upper;
717 *(uint32_t *)&env->fregs[PARAM1 + 1] = d.l.lower;
718 RETURN();
721 void OPPROTO op_fadd_FT(void)
723 FT0 = float32_add(FT0, FT1, &env->fp_status);
724 RETURN();
727 void OPPROTO op_fadd_DT(void)
729 DT0 = float64_add(DT0, DT1, &env->fp_status);
730 RETURN();
733 void OPPROTO op_fsub_FT(void)
735 FT0 = float32_sub(FT0, FT1, &env->fp_status);
736 RETURN();
739 void OPPROTO op_fsub_DT(void)
741 DT0 = float64_sub(DT0, DT1, &env->fp_status);
742 RETURN();
745 void OPPROTO op_fmul_FT(void)
747 FT0 = float32_mul(FT0, FT1, &env->fp_status);
748 RETURN();
751 void OPPROTO op_fmul_DT(void)
753 DT0 = float64_mul(DT0, DT1, &env->fp_status);
754 RETURN();
757 void OPPROTO op_fdiv_FT(void)
759 FT0 = float32_div(FT0, FT1, &env->fp_status);
760 RETURN();
763 void OPPROTO op_fdiv_DT(void)
765 DT0 = float64_div(DT0, DT1, &env->fp_status);
766 RETURN();
769 void OPPROTO op_fcmp_eq_FT(void)
771 cond_t(float32_compare(FT0, FT1, &env->fp_status) == 0);
772 RETURN();
775 void OPPROTO op_fcmp_eq_DT(void)
777 cond_t(float64_compare(DT0, DT1, &env->fp_status) == 0);
778 RETURN();
781 void OPPROTO op_fcmp_gt_FT(void)
783 cond_t(float32_compare(FT0, FT1, &env->fp_status) == 1);
784 RETURN();
787 void OPPROTO op_fcmp_gt_DT(void)
789 cond_t(float64_compare(DT0, DT1, &env->fp_status) == 1);
790 RETURN();
793 void OPPROTO op_float_FT(void)
795 FT0 = int32_to_float32(env->fpul, &env->fp_status);
796 RETURN();
799 void OPPROTO op_float_DT(void)
801 DT0 = int32_to_float64(env->fpul, &env->fp_status);
802 RETURN();
805 void OPPROTO op_ftrc_FT(void)
807 env->fpul = float32_to_int32_round_to_zero(FT0, &env->fp_status);
808 RETURN();
811 void OPPROTO op_ftrc_DT(void)
813 env->fpul = float64_to_int32_round_to_zero(DT0, &env->fp_status);
814 RETURN();
817 void OPPROTO op_fneg_frN(void)
819 env->fregs[PARAM1] = float32_chs(env->fregs[PARAM1]);
820 RETURN();
823 void OPPROTO op_fabs_FT(void)
825 FT0 = float32_abs(FT0);
826 RETURN();
829 void OPPROTO op_fabs_DT(void)
831 DT0 = float64_abs(DT0);
832 RETURN();
835 void OPPROTO op_fcnvsd_FT_DT(void)
837 DT0 = float32_to_float64(FT0, &env->fp_status);
838 RETURN();
841 void OPPROTO op_fcnvds_DT_FT(void)
843 FT0 = float64_to_float32(DT0, &env->fp_status);
844 RETURN();
847 void OPPROTO op_fsqrt_FT(void)
849 FT0 = float32_sqrt(FT0, &env->fp_status);
850 RETURN();
853 void OPPROTO op_fsqrt_DT(void)
855 DT0 = float64_sqrt(DT0, &env->fp_status);
856 RETURN();
859 void OPPROTO op_fmov_T0_frN(void)
861 *(uint32_t *)&env->fregs[PARAM1] = T0;
862 RETURN();
865 void OPPROTO op_dec1_rN(void)
867 env->gregs[PARAM1] -= 1;
868 RETURN();
871 void OPPROTO op_dec2_rN(void)
873 env->gregs[PARAM1] -= 2;
874 RETURN();
877 void OPPROTO op_dec4_rN(void)
879 env->gregs[PARAM1] -= 4;
880 RETURN();
883 void OPPROTO op_dec8_rN(void)
885 env->gregs[PARAM1] -= 8;
886 RETURN();
889 void OPPROTO op_inc1_rN(void)
891 env->gregs[PARAM1] += 1;
892 RETURN();
895 void OPPROTO op_inc2_rN(void)
897 env->gregs[PARAM1] += 2;
898 RETURN();
901 void OPPROTO op_inc4_rN(void)
903 env->gregs[PARAM1] += 4;
904 RETURN();
907 void OPPROTO op_inc8_rN(void)
909 env->gregs[PARAM1] += 8;
910 RETURN();
913 void OPPROTO op_add_T0_rN(void)
915 env->gregs[PARAM1] += T0;
916 RETURN();
919 void OPPROTO op_sub_T0_rN(void)
921 env->gregs[PARAM1] -= T0;
922 RETURN();
925 void OPPROTO op_and_T0_rN(void)
927 env->gregs[PARAM1] &= T0;
928 RETURN();
931 void OPPROTO op_or_T0_rN(void)
933 env->gregs[PARAM1] |= T0;
934 RETURN();
937 void OPPROTO op_xor_T0_rN(void)
939 env->gregs[PARAM1] ^= T0;
940 RETURN();
943 void OPPROTO op_add_rN_T0(void)
945 T0 += env->gregs[PARAM1];
946 RETURN();
949 void OPPROTO op_add_rN_T1(void)
951 T1 += env->gregs[PARAM1];
952 RETURN();
955 void OPPROTO op_add_imm_rN(void)
957 env->gregs[PARAM2] += PARAM1;
958 RETURN();
961 void OPPROTO op_and_imm_rN(void)
963 env->gregs[PARAM2] &= PARAM1;
964 RETURN();
967 void OPPROTO op_or_imm_rN(void)
969 env->gregs[PARAM2] |= PARAM1;
970 RETURN();
973 void OPPROTO op_xor_imm_rN(void)
975 env->gregs[PARAM2] ^= PARAM1;
976 RETURN();
979 void OPPROTO op_dt_rN(void)
981 cond_t((--env->gregs[PARAM1]) == 0);
982 RETURN();
985 void OPPROTO op_tst_imm_rN(void)
987 cond_t((env->gregs[PARAM2] & PARAM1) == 0);
988 RETURN();
991 void OPPROTO op_movl_T0_T1(void)
993 T1 = T0;
994 RETURN();
997 void OPPROTO op_movl_fpul_FT0(void)
999 FT0 = *(float32 *)&env->fpul;
1000 RETURN();
1003 void OPPROTO op_movl_FT0_fpul(void)
1005 *(float32 *)&env->fpul = FT0;
1006 RETURN();
1009 void OPPROTO op_movl_imm_PC(void)
1011 env->pc = PARAM1;
1012 RETURN();
1015 void OPPROTO op_jT(void)
1017 if (env->sr & SR_T)
1018 GOTO_LABEL_PARAM(1);
1019 RETURN();
1022 void OPPROTO op_jdelayed(void)
1024 if (env->flags & DELAY_SLOT_TRUE) {
1025 env->flags &= ~DELAY_SLOT_TRUE;
1026 GOTO_LABEL_PARAM(1);
1028 RETURN();
1031 void OPPROTO op_movl_delayed_pc_PC(void)
1033 env->pc = env->delayed_pc;
1034 RETURN();
1037 void OPPROTO op_addl_GBR_T0(void)
1039 T0 += env->gbr;
1040 RETURN();
1043 void OPPROTO op_and_imm_T0(void)
1045 T0 &= PARAM1;
1046 RETURN();
1049 void OPPROTO op_or_imm_T0(void)
1051 T0 |= PARAM1;
1052 RETURN();
1055 void OPPROTO op_xor_imm_T0(void)
1057 T0 ^= PARAM1;
1058 RETURN();
1061 void OPPROTO op_tst_imm_T0(void)
1063 cond_t((T0 & PARAM1) == 0);
1064 RETURN();
1067 void OPPROTO op_raise_illegal_instruction(void)
1069 env->exception_index = 0x180;
1070 do_raise_exception();
1071 RETURN();
1074 void OPPROTO op_raise_slot_illegal_instruction(void)
1076 env->exception_index = 0x1a0;
1077 do_raise_exception();
1078 RETURN();
1081 void OPPROTO op_debug(void)
1083 env->exception_index = EXCP_DEBUG;
1084 cpu_loop_exit();
1087 void OPPROTO op_sleep(void)
1089 env->halted = 1;
1090 env->exception_index = EXCP_HLT;
1091 cpu_loop_exit();
1094 /* Load and store */
1095 #define MEMSUFFIX _raw
1096 #include "op_mem.c"
1097 #undef MEMSUFFIX
1098 #if !defined(CONFIG_USER_ONLY)
1099 #define MEMSUFFIX _user
1100 #include "op_mem.c"
1101 #undef MEMSUFFIX
1103 #define MEMSUFFIX _kernel
1104 #include "op_mem.c"
1105 #undef MEMSUFFIX
1106 #endif