op.c 49.8 KB
Newer Older
B
bellard 已提交
1
/*
2
 *  PowerPC emulation micro-operations for qemu.
3
 *
4
 *  Copyright (c) 2003-2007 Jocelyn Mayer
B
bellard 已提交
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

21 22
//#define DEBUG_OP

B
bellard 已提交
23 24
#include "config.h"
#include "exec.h"
25
#include "host-utils.h"
26
#include "helper_regs.h"
27
#include "op_helper.h"
B
bellard 已提交
28

29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
#define REG 0
#include "op_template.h"

#define REG 1
#include "op_template.h"

#define REG 2
#include "op_template.h"

#define REG 3
#include "op_template.h"

#define REG 4
#include "op_template.h"

#define REG 5
#include "op_template.h"

#define REG 6
#include "op_template.h"

#define REG 7
#include "op_template.h"

#define REG 8
#include "op_template.h"

#define REG 9
#include "op_template.h"

#define REG 10
#include "op_template.h"

#define REG 11
#include "op_template.h"

#define REG 12
#include "op_template.h"

#define REG 13
#include "op_template.h"

#define REG 14
#include "op_template.h"

#define REG 15
#include "op_template.h"

#define REG 16
#include "op_template.h"

#define REG 17
#include "op_template.h"

#define REG 18
#include "op_template.h"

#define REG 19
#include "op_template.h"

#define REG 20
#include "op_template.h"

#define REG 21
#include "op_template.h"

#define REG 22
#include "op_template.h"

#define REG 23
#include "op_template.h"

#define REG 24
#include "op_template.h"

#define REG 25
#include "op_template.h"

#define REG 26
#include "op_template.h"

#define REG 27
#include "op_template.h"

#define REG 28
#include "op_template.h"

#define REG 29
#include "op_template.h"

#define REG 30
#include "op_template.h"

#define REG 31
#include "op_template.h"

A
aurel32 已提交
125 126 127 128 129 130
void OPPROTO op_print_mem_EA (void)
{
    do_print_mem_EA(T0);
    RETURN();
}

131
/* PowerPC state maintenance operations */
B
bellard 已提交
132
/* set_Rc0 */
133
void OPPROTO op_set_Rc0 (void)
B
bellard 已提交
134
{
J
j_mayer 已提交
135
    env->crf[0] = T0 | xer_so;
B
bellard 已提交
136 137 138
    RETURN();
}

A
aurel32 已提交
139 140 141 142 143 144 145
/* Constants load */
void OPPROTO op_reset_T0 (void)
{
    T0 = 0;
    RETURN();
}

146
void OPPROTO op_set_T0 (void)
B
bellard 已提交
147
{
148
    T0 = (uint32_t)PARAM1;
B
bellard 已提交
149 150 151
    RETURN();
}

152 153 154 155 156 157 158 159
#if defined(TARGET_PPC64)
void OPPROTO op_set_T0_64 (void)
{
    T0 = ((uint64_t)PARAM1 << 32) | (uint64_t)PARAM2;
    RETURN();
}
#endif

160
void OPPROTO op_set_T1 (void)
B
bellard 已提交
161
{
162 163 164 165 166 167 168 169
    T1 = (uint32_t)PARAM1;
    RETURN();
}

#if defined(TARGET_PPC64)
void OPPROTO op_set_T1_64 (void)
{
    T1 = ((uint64_t)PARAM1 << 32) | (uint64_t)PARAM2;
B
bellard 已提交
170 171
    RETURN();
}
172
#endif
B
bellard 已提交
173

174
#if 0 // unused
175
void OPPROTO op_set_T2 (void)
B
bellard 已提交
176
{
177
    T2 = (uint32_t)PARAM1;
B
bellard 已提交
178 179
    RETURN();
}
180
#endif
B
bellard 已提交
181

182 183 184 185 186 187
void OPPROTO op_moven_T2_T0 (void)
{
    T2 = ~T0;
    RETURN();
}

188
/* Generate exceptions */
189
void OPPROTO op_raise_exception_err (void)
190
{
191
    do_raise_exception_err(PARAM1, PARAM2);
192 193
}

A
aurel32 已提交
194 195 196 197 198 199 200 201 202 203 204 205 206 207
void OPPROTO op_update_nip (void)
{
    env->nip = (uint32_t)PARAM1;
    RETURN();
}

#if defined(TARGET_PPC64)
void OPPROTO op_update_nip_64 (void)
{
    env->nip = ((uint64_t)PARAM1 << 32) | (uint64_t)PARAM2;
    RETURN();
}
#endif

208
void OPPROTO op_debug (void)
209 210 211 212
{
    do_raise_exception(EXCP_DEBUG);
}

A
aurel32 已提交
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
/* Load/store special registers */
void OPPROTO op_load_cr (void)
{
    do_load_cr();
    RETURN();
}

void OPPROTO op_store_cr (void)
{
    do_store_cr(PARAM1);
    RETURN();
}

void OPPROTO op_load_cro (void)
{
    T0 = env->crf[PARAM1];
    RETURN();
}

void OPPROTO op_store_cro (void)
{
    env->crf[PARAM1] = T0;
    RETURN();
}

238
void OPPROTO op_load_xer_cr (void)
B
bellard 已提交
239 240 241 242 243
{
    T0 = (xer_so << 3) | (xer_ov << 2) | (xer_ca << 1);
    RETURN();
}

244
void OPPROTO op_clear_xer_ov (void)
B
bellard 已提交
245 246 247
{
    xer_so = 0;
    xer_ov = 0;
J
j_mayer 已提交
248 249 250
    RETURN();
}

251
void OPPROTO op_clear_xer_ca (void)
J
j_mayer 已提交
252
{
B
bellard 已提交
253 254 255 256
    xer_ca = 0;
    RETURN();
}

257
void OPPROTO op_load_xer_bc (void)
B
bellard 已提交
258
{
259
    T1 = xer_bc;
B
bellard 已提交
260 261 262
    RETURN();
}

263 264 265 266 267 268
void OPPROTO op_store_xer_bc (void)
{
    xer_bc = T0;
    RETURN();
}

269
void OPPROTO op_load_xer (void)
B
bellard 已提交
270
{
271
    T0 = hreg_load_xer(env);
B
bellard 已提交
272 273 274
    RETURN();
}

275
void OPPROTO op_store_xer (void)
B
bellard 已提交
276
{
277
    hreg_store_xer(env, T0);
278 279 280
    RETURN();
}

281 282 283 284 285 286 287 288
#if defined(TARGET_PPC64)
void OPPROTO op_store_pri (void)
{
    do_store_pri(PARAM1);
    RETURN();
}
#endif

289 290
#if !defined(CONFIG_USER_ONLY)
/* Segment registers load and store */
291
void OPPROTO op_load_sr (void)
292
{
293
    T0 = env->sr[T1];
294 295 296
    RETURN();
}

297
void OPPROTO op_store_sr (void)
298 299 300 301 302
{
    do_store_sr(env, T1, T0);
    RETURN();
}

303 304 305 306 307 308 309 310 311 312 313 314 315 316
#if defined(TARGET_PPC64)
void OPPROTO op_load_slb (void)
{
    T0 = ppc_load_slb(env, T1);
    RETURN();
}

void OPPROTO op_store_slb (void)
{
    ppc_store_slb(env, T1, T0);
    RETURN();
}
#endif /* defined(TARGET_PPC64) */

317
void OPPROTO op_load_sdr1 (void)
318
{
319
    T0 = env->sdr1;
320 321 322
    RETURN();
}

323
void OPPROTO op_store_sdr1 (void)
324 325
{
    do_store_sdr1(env, T0);
B
bellard 已提交
326 327 328
    RETURN();
}

329 330 331 332 333 334 335 336 337 338 339 340 341 342
#if defined (TARGET_PPC64)
void OPPROTO op_load_asr (void)
{
    T0 = env->asr;
    RETURN();
}

void OPPROTO op_store_asr (void)
{
    ppc_store_asr(env, T0);
    RETURN();
}
#endif

A
aurel32 已提交
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363
void OPPROTO op_load_msr (void)
{
    T0 = env->msr;
    RETURN();
}

void OPPROTO op_store_msr (void)
{
    do_store_msr();
    RETURN();
}

#if defined (TARGET_PPC64)
void OPPROTO op_store_msr_32 (void)
{
    T0 = (env->msr & ~0xFFFFFFFFULL) | (T0 & 0xFFFFFFFF);
    do_store_msr();
    RETURN();
}
#endif

364
void OPPROTO op_update_riee (void)
365
{
366 367 368 369 370 371
    /* We don't call do_store_msr here as we won't trigger
     * any special case nor change hflags
     */
    T0 &= (1 << MSR_RI) | (1 << MSR_EE);
    env->msr &= ~(1 << MSR_RI) | (1 << MSR_EE);
    env->msr |= T0;
372 373 374
    RETURN();
}
#endif
375 376

/* SPR */
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395
void OPPROTO op_load_spr (void)
{
    T0 = env->spr[PARAM1];
    RETURN();
}

void OPPROTO op_store_spr (void)
{
    env->spr[PARAM1] = T0;
    RETURN();
}

void OPPROTO op_load_dump_spr (void)
{
    T0 = ppc_load_dump_spr(PARAM1);
    RETURN();
}

void OPPROTO op_store_dump_spr (void)
396
{
397
    ppc_store_dump_spr(PARAM1, T0);
398 399 400
    RETURN();
}

401
void OPPROTO op_mask_spr (void)
402
{
403
    env->spr[PARAM1] &= ~T0;
B
bellard 已提交
404 405 406
    RETURN();
}

407
void OPPROTO op_load_lr (void)
B
bellard 已提交
408
{
409
    T0 = env->lr;
410 411 412
    RETURN();
}

413
void OPPROTO op_store_lr (void)
414
{
415
    env->lr = T0;
416 417 418
    RETURN();
}

419
void OPPROTO op_load_ctr (void)
420
{
421
    T0 = env->ctr;
422 423 424
    RETURN();
}

425
void OPPROTO op_store_ctr (void)
426
{
427
    env->ctr = T0;
428 429 430
    RETURN();
}

431
void OPPROTO op_load_tbl (void)
432
{
433
    T0 = cpu_ppc_load_tbl(env);
434 435 436
    RETURN();
}

437
void OPPROTO op_load_tbu (void)
438
{
439
    T0 = cpu_ppc_load_tbu(env);
440 441 442
    RETURN();
}

443 444 445 446 447 448 449 450 451 452 453 454
void OPPROTO op_load_atbl (void)
{
    T0 = cpu_ppc_load_atbl(env);
    RETURN();
}

void OPPROTO op_load_atbu (void)
{
    T0 = cpu_ppc_load_atbu(env);
    RETURN();
}

455
#if !defined(CONFIG_USER_ONLY)
456
void OPPROTO op_store_tbl (void)
457
{
458
    cpu_ppc_store_tbl(env, T0);
B
bellard 已提交
459 460 461
    RETURN();
}

462
void OPPROTO op_store_tbu (void)
463
{
464
    cpu_ppc_store_tbu(env, T0);
465 466 467
    RETURN();
}

468 469 470 471 472 473 474 475 476 477 478 479
void OPPROTO op_store_atbl (void)
{
    cpu_ppc_store_atbl(env, T0);
    RETURN();
}

void OPPROTO op_store_atbu (void)
{
    cpu_ppc_store_atbu(env, T0);
    RETURN();
}

480
void OPPROTO op_load_decr (void)
481
{
482
    T0 = cpu_ppc_load_decr(env);
483 484
    RETURN();
}
485

486
void OPPROTO op_store_decr (void)
487
{
488
    cpu_ppc_store_decr(env, T0);
489 490 491
    RETURN();
}

492
void OPPROTO op_load_ibat (void)
493
{
494
    T0 = env->IBAT[PARAM1][PARAM2];
495
    RETURN();
496 497
}

498
void OPPROTO op_store_ibatu (void)
499
{
500 501 502 503
    do_store_ibatu(env, PARAM1, T0);
    RETURN();
}

504
void OPPROTO op_store_ibatl (void)
505 506 507 508 509 510 511
{
#if 1
    env->IBAT[1][PARAM1] = T0;
#else
    do_store_ibatl(env, PARAM1, T0);
#endif
    RETURN();
512 513
}

514
void OPPROTO op_load_dbat (void)
515
{
516
    T0 = env->DBAT[PARAM1][PARAM2];
517
    RETURN();
518 519
}

520
void OPPROTO op_store_dbatu (void)
521 522 523 524 525
{
    do_store_dbatu(env, PARAM1, T0);
    RETURN();
}

526
void OPPROTO op_store_dbatl (void)
527
{
528 529 530 531 532 533
#if 1
    env->DBAT[1][PARAM1] = T0;
#else
    do_store_dbatl(env, PARAM1, T0);
#endif
    RETURN();
534
}
535
#endif /* !defined(CONFIG_USER_ONLY) */
536

B
bellard 已提交
537
/* FPSCR */
538 539
#ifdef CONFIG_SOFTFLOAT
void OPPROTO op_reset_fpstatus (void)
B
bellard 已提交
540
{
541
    env->fp_status.float_exception_flags = 0;
B
bellard 已提交
542 543
    RETURN();
}
544
#endif
B
bellard 已提交
545

546
void OPPROTO op_compute_fprf (void)
B
bellard 已提交
547
{
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566
    do_compute_fprf(PARAM1);
    RETURN();
}

#ifdef CONFIG_SOFTFLOAT
void OPPROTO op_float_check_status (void)
{
    do_float_check_status();
    RETURN();
}
#else
void OPPROTO op_float_check_status (void)
{
    if (env->exception_index == POWERPC_EXCP_PROGRAM &&
        (env->error_code & POWERPC_EXCP_FP)) {
        /* Differred floating-point exception after target FPR update */
        if (msr_fe0 != 0 || msr_fe1 != 0)
            do_raise_exception_err(env->exception_index, env->error_code);
    }
B
bellard 已提交
567 568
    RETURN();
}
569 570 571 572 573 574 575
#endif

void OPPROTO op_load_fpscr_FT0 (void)
{
    /* The 32 MSB of the target fpr are undefined.
     * They'll be zero...
     */
576 577 578 579
    CPU_DoubleU u;

    u.l.upper = 0;
    u.l.lower = env->fpscr;
580 581 582 583 584 585
    FT0 = u.d;
    RETURN();
}

void OPPROTO op_set_FT0 (void)
{
586
    CPU_DoubleU u;
587

588 589
    u.l.upper = 0;
    u.l.lower = PARAM1;
590 591 592
    FT0 = u.d;
    RETURN();
}
B
bellard 已提交
593

594
void OPPROTO op_load_fpscr_T0 (void)
B
bellard 已提交
595
{
596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620
    T0 = (env->fpscr >> PARAM1) & 0xF;
    RETURN();
}

void OPPROTO op_load_fpcc (void)
{
    T0 = fpscr_fpcc;
    RETURN();
}

void OPPROTO op_fpscr_resetbit (void)
{
    env->fpscr &= PARAM1;
    RETURN();
}

void OPPROTO op_fpscr_setbit (void)
{
    do_fpscr_setbit(PARAM1);
    RETURN();
}

void OPPROTO op_store_fpscr (void)
{
    do_store_fpscr(PARAM1);
B
bellard 已提交
621 622 623
    RETURN();
}

B
bellard 已提交
624
/* Branch */
625
#define EIP env->nip
626

627
void OPPROTO op_setlr (void)
628
{
629
    env->lr = (uint32_t)PARAM1;
630
    RETURN();
631 632
}

633 634 635
#if defined (TARGET_PPC64)
void OPPROTO op_setlr_64 (void)
{
636
    env->lr = ((uint64_t)PARAM1 << 32) | (uint64_t)PARAM2;
637 638 639 640 641
    RETURN();
}
#endif

void OPPROTO op_b_T1 (void)
642
{
643
    env->nip = (uint32_t)(T1 & ~3);
644
    RETURN();
645 646
}

647 648 649
#if defined (TARGET_PPC64)
void OPPROTO op_b_T1_64 (void)
{
650
    env->nip = (uint64_t)(T1 & ~3);
651 652 653 654
    RETURN();
}
#endif

655
void OPPROTO op_jz_T0 (void)
656
{
B
bellard 已提交
657 658
    if (!T0)
        GOTO_LABEL_PARAM(1);
659 660 661
    RETURN();
}

662
void OPPROTO op_btest_T1 (void)
663 664
{
    if (T0) {
665
        env->nip = (uint32_t)(T1 & ~3);
666
    } else {
667
        env->nip = (uint32_t)PARAM1;
668 669 670 671
    }
    RETURN();
}

672 673 674 675
#if defined (TARGET_PPC64)
void OPPROTO op_btest_T1_64 (void)
{
    if (T0) {
676
        env->nip = (uint64_t)(T1 & ~3);
677
    } else {
678
        env->nip = ((uint64_t)PARAM1 << 32) | (uint64_t)PARAM2;
679 680 681 682 683
    }
    RETURN();
}
#endif

684
void OPPROTO op_movl_T1_ctr (void)
685
{
686
    T1 = env->ctr;
687
    RETURN();
688 689
}

690
void OPPROTO op_movl_T1_lr (void)
691
{
692
    T1 = env->lr;
693
    RETURN();
694 695 696
}

/* tests with result in T0 */
697 698
void OPPROTO op_test_ctr (void)
{
699
    T0 = (uint32_t)env->ctr;
700 701
    RETURN();
}
702

703 704
#if defined(TARGET_PPC64)
void OPPROTO op_test_ctr_64 (void)
705
{
706
    T0 = (uint64_t)env->ctr;
707 708 709 710 711 712
    RETURN();
}
#endif

void OPPROTO op_test_ctr_true (void)
{
713
    T0 = ((uint32_t)env->ctr != 0 && (T0 & PARAM1) != 0);
714
    RETURN();
715 716
}

717 718
#if defined(TARGET_PPC64)
void OPPROTO op_test_ctr_true_64 (void)
719
{
720
    T0 = ((uint64_t)env->ctr != 0 && (T0 & PARAM1) != 0);
721
    RETURN();
722
}
723
#endif
724

725
void OPPROTO op_test_ctr_false (void)
726
{
727
    T0 = ((uint32_t)env->ctr != 0 && (T0 & PARAM1) == 0);
728
    RETURN();
729 730
}

731 732
#if defined(TARGET_PPC64)
void OPPROTO op_test_ctr_false_64 (void)
733
{
734
    T0 = ((uint64_t)env->ctr != 0 && (T0 & PARAM1) == 0);
735
    RETURN();
736
}
737 738 739 740
#endif

void OPPROTO op_test_ctrz (void)
{
741
    T0 = ((uint32_t)env->ctr == 0);
742 743 744 745 746 747
    RETURN();
}

#if defined(TARGET_PPC64)
void OPPROTO op_test_ctrz_64 (void)
{
748
    T0 = ((uint64_t)env->ctr == 0);
749 750 751 752 753 754
    RETURN();
}
#endif

void OPPROTO op_test_ctrz_true (void)
{
755
    T0 = ((uint32_t)env->ctr == 0 && (T0 & PARAM1) != 0);
756 757 758 759 760 761
    RETURN();
}

#if defined(TARGET_PPC64)
void OPPROTO op_test_ctrz_true_64 (void)
{
762
    T0 = ((uint64_t)env->ctr == 0 && (T0 & PARAM1) != 0);
763 764 765
    RETURN();
}
#endif
766

767
void OPPROTO op_test_ctrz_false (void)
768
{
769
    T0 = ((uint32_t)env->ctr == 0 && (T0 & PARAM1) == 0);
770
    RETURN();
771 772
}

773 774
#if defined(TARGET_PPC64)
void OPPROTO op_test_ctrz_false_64 (void)
775
{
776
    T0 = ((uint64_t)env->ctr == 0 && (T0 & PARAM1) == 0);
777
    RETURN();
778
}
779
#endif
780

781
void OPPROTO op_test_true (void)
782
{
783
    T0 = (T0 & PARAM1);
784
    RETURN();
785 786
}

787
void OPPROTO op_test_false (void)
788
{
789
    T0 = ((T0 & PARAM1) == 0);
790
    RETURN();
791
}
B
bellard 已提交
792 793

/* CTR maintenance */
794
void OPPROTO op_dec_ctr (void)
B
bellard 已提交
795
{
796
    env->ctr--;
B
bellard 已提交
797 798 799 800 801
    RETURN();
}

/***                           Integer arithmetic                          ***/
/* add */
802
void OPPROTO op_add (void)
B
bellard 已提交
803 804 805 806 807
{
    T0 += T1;
    RETURN();
}

808
void OPPROTO op_check_addo (void)
B
bellard 已提交
809
{
810 811 812
    xer_ov = (((uint32_t)T2 ^ (uint32_t)T1 ^ UINT32_MAX) &
              ((uint32_t)T2 ^ (uint32_t)T0)) >> 31;
    xer_so |= xer_ov;
J
j_mayer 已提交
813
    RETURN();
B
bellard 已提交
814 815
}

816 817
#if defined(TARGET_PPC64)
void OPPROTO op_check_addo_64 (void)
B
bellard 已提交
818
{
819 820 821
    xer_ov = (((uint64_t)T2 ^ (uint64_t)T1 ^ UINT64_MAX) &
              ((uint64_t)T2 ^ (uint64_t)T0)) >> 63;
    xer_so |= xer_ov;
J
j_mayer 已提交
822
    RETURN();
823 824 825 826 827 828 829
}
#endif

/* add carrying */
void OPPROTO op_check_addc (void)
{
    if (likely((uint32_t)T0 >= (uint32_t)T2)) {
B
bellard 已提交
830
        xer_ca = 0;
831 832
    } else {
        xer_ca = 1;
B
bellard 已提交
833 834 835 836
    }
    RETURN();
}

837 838
#if defined(TARGET_PPC64)
void OPPROTO op_check_addc_64 (void)
B
bellard 已提交
839
{
840 841 842 843 844
    if (likely((uint64_t)T0 >= (uint64_t)T2)) {
        xer_ca = 0;
    } else {
        xer_ca = 1;
    }
B
bellard 已提交
845 846
    RETURN();
}
847
#endif
B
bellard 已提交
848 849

/* add extended */
850
void OPPROTO op_adde (void)
B
bellard 已提交
851
{
852
    do_adde();
853
    RETURN();
B
bellard 已提交
854 855
}

856 857
#if defined(TARGET_PPC64)
void OPPROTO op_adde_64 (void)
B
bellard 已提交
858
{
859
    do_adde_64();
B
bellard 已提交
860 861
    RETURN();
}
862
#endif
B
bellard 已提交
863 864

/* add immediate */
865
void OPPROTO op_addi (void)
B
bellard 已提交
866
{
867
    T0 += (int32_t)PARAM1;
B
bellard 已提交
868 869 870
    RETURN();
}

871 872
/* add to minus one extended */
void OPPROTO op_add_me (void)
B
bellard 已提交
873
{
874 875
    T0 += xer_ca + (-1);
    if (likely((uint32_t)T1 != 0))
B
bellard 已提交
876
        xer_ca = 1;
877 878
    else
        xer_ca = 0;
B
bellard 已提交
879 880 881
    RETURN();
}

882 883
#if defined(TARGET_PPC64)
void OPPROTO op_add_me_64 (void)
B
bellard 已提交
884 885
{
    T0 += xer_ca + (-1);
886
    if (likely((uint64_t)T1 != 0))
B
bellard 已提交
887
        xer_ca = 1;
888 889
    else
        xer_ca = 0;
B
bellard 已提交
890 891
    RETURN();
}
892
#endif
B
bellard 已提交
893

894
void OPPROTO op_addmeo (void)
B
bellard 已提交
895
{
896
    do_addmeo();
B
bellard 已提交
897 898 899
    RETURN();
}

900 901 902 903 904 905
void OPPROTO op_addmeo_64 (void)
{
    do_addmeo();
    RETURN();
}

B
bellard 已提交
906
/* add to zero extended */
907
void OPPROTO op_add_ze (void)
B
bellard 已提交
908 909 910 911 912
{
    T0 += xer_ca;
    RETURN();
}

913 914
/* divide word */
void OPPROTO op_divw (void)
B
bellard 已提交
915
{
916
    if (unlikely(((int32_t)T0 == INT32_MIN && (int32_t)T1 == (int32_t)-1) ||
917
                 (int32_t)T1 == 0)) {
918
        T0 = (int32_t)(UINT32_MAX * ((uint32_t)T0 >> 31));
919 920 921
    } else {
        T0 = (int32_t)T0 / (int32_t)T1;
    }
B
bellard 已提交
922 923 924
    RETURN();
}

925 926
#if defined(TARGET_PPC64)
void OPPROTO op_divd (void)
B
bellard 已提交
927
{
928
    if (unlikely(((int64_t)T0 == INT64_MIN && (int64_t)T1 == (int64_t)-1LL) ||
929
                 (int64_t)T1 == 0)) {
930
        T0 = (int64_t)(UINT64_MAX * ((uint64_t)T0 >> 63));
B
bellard 已提交
931
    } else {
932
        T0 = (int64_t)T0 / (int64_t)T1;
B
bellard 已提交
933 934 935
    }
    RETURN();
}
936
#endif
B
bellard 已提交
937

938
void OPPROTO op_divwo (void)
B
bellard 已提交
939
{
940
    do_divwo();
B
bellard 已提交
941 942 943
    RETURN();
}

944 945 946 947 948 949 950 951
#if defined(TARGET_PPC64)
void OPPROTO op_divdo (void)
{
    do_divdo();
    RETURN();
}
#endif

B
bellard 已提交
952
/* divide word unsigned */
953 954 955 956 957 958 959 960 961 962 963 964
void OPPROTO op_divwu (void)
{
    if (unlikely(T1 == 0)) {
        T0 = 0;
    } else {
        T0 = (uint32_t)T0 / (uint32_t)T1;
    }
    RETURN();
}

#if defined(TARGET_PPC64)
void OPPROTO op_divdu (void)
B
bellard 已提交
965
{
966
    if (unlikely(T1 == 0)) {
B
bellard 已提交
967 968 969 970 971 972
        T0 = 0;
    } else {
        T0 /= T1;
    }
    RETURN();
}
973
#endif
B
bellard 已提交
974

975
void OPPROTO op_divwuo (void)
B
bellard 已提交
976
{
977
    do_divwuo();
B
bellard 已提交
978 979 980
    RETURN();
}

981 982 983 984 985 986 987 988
#if defined(TARGET_PPC64)
void OPPROTO op_divduo (void)
{
    do_divduo();
    RETURN();
}
#endif

B
bellard 已提交
989
/* multiply high word */
990
void OPPROTO op_mulhw (void)
B
bellard 已提交
991
{
992
    T0 = ((int64_t)((int32_t)T0) * (int64_t)((int32_t)T1)) >> 32;
B
bellard 已提交
993 994 995
    RETURN();
}

996 997 998 999 1000
#if defined(TARGET_PPC64)
void OPPROTO op_mulhd (void)
{
    uint64_t tl, th;

1001
    muls64(&tl, &th, T0, T1);
1002 1003 1004 1005 1006
    T0 = th;
    RETURN();
}
#endif

B
bellard 已提交
1007
/* multiply high word unsigned */
1008
void OPPROTO op_mulhwu (void)
B
bellard 已提交
1009
{
1010
    T0 = ((uint64_t)(uint32_t)T0 * (uint64_t)(uint32_t)T1) >> 32;
B
bellard 已提交
1011 1012 1013
    RETURN();
}

1014 1015 1016 1017 1018
#if defined(TARGET_PPC64)
void OPPROTO op_mulhdu (void)
{
    uint64_t tl, th;

1019
    mulu64(&tl, &th, T0, T1);
1020 1021 1022 1023 1024
    T0 = th;
    RETURN();
}
#endif

B
bellard 已提交
1025
/* multiply low immediate */
1026
void OPPROTO op_mulli (void)
B
bellard 已提交
1027
{
1028
    T0 = ((int32_t)T0 * (int32_t)PARAM1);
B
bellard 已提交
1029 1030 1031 1032
    RETURN();
}

/* multiply low word */
1033
void OPPROTO op_mullw (void)
1034 1035 1036 1037 1038 1039 1040
{
    T0 = (int32_t)(T0 * T1);
    RETURN();
}

#if defined(TARGET_PPC64)
void OPPROTO op_mulld (void)
B
bellard 已提交
1041 1042 1043 1044
{
    T0 *= T1;
    RETURN();
}
1045
#endif
B
bellard 已提交
1046

1047
void OPPROTO op_mullwo (void)
B
bellard 已提交
1048
{
1049
    do_mullwo();
B
bellard 已提交
1050 1051 1052
    RETURN();
}

1053 1054 1055 1056 1057 1058 1059 1060
#if defined(TARGET_PPC64)
void OPPROTO op_mulldo (void)
{
    do_mulldo();
    RETURN();
}
#endif

B
bellard 已提交
1061
/* negate */
1062
void OPPROTO op_neg (void)
B
bellard 已提交
1063
{
1064 1065
    if (likely(T0 != INT32_MIN)) {
        T0 = -(int32_t)T0;
B
bellard 已提交
1066 1067 1068 1069
    }
    RETURN();
}

1070 1071 1072 1073 1074 1075 1076 1077 1078 1079
#if defined(TARGET_PPC64)
void OPPROTO op_neg_64 (void)
{
    if (likely(T0 != INT64_MIN)) {
        T0 = -(int64_t)T0;
    }
    RETURN();
}
#endif

1080
void OPPROTO op_nego (void)
B
bellard 已提交
1081
{
1082
    do_nego();
B
bellard 已提交
1083 1084 1085
    RETURN();
}

1086 1087 1088 1089 1090 1091 1092 1093
#if defined(TARGET_PPC64)
void OPPROTO op_nego_64 (void)
{
    do_nego_64();
    RETURN();
}
#endif

T
ths 已提交
1094
/* subtract from */
1095
void OPPROTO op_subf (void)
B
bellard 已提交
1096 1097 1098 1099 1100
{
    T0 = T1 - T0;
    RETURN();
}

T
ths 已提交
1101
/* subtract from carrying */
1102
void OPPROTO op_check_subfc (void)
B
bellard 已提交
1103
{
1104
    if (likely((uint32_t)T0 > (uint32_t)T1)) {
B
bellard 已提交
1105
        xer_ca = 0;
1106 1107
    } else {
        xer_ca = 1;
B
bellard 已提交
1108 1109 1110 1111
    }
    RETURN();
}

1112 1113
#if defined(TARGET_PPC64)
void OPPROTO op_check_subfc_64 (void)
B
bellard 已提交
1114
{
1115 1116 1117 1118 1119
    if (likely((uint64_t)T0 > (uint64_t)T1)) {
        xer_ca = 0;
    } else {
        xer_ca = 1;
    }
B
bellard 已提交
1120 1121
    RETURN();
}
1122
#endif
B
bellard 已提交
1123

T
ths 已提交
1124
/* subtract from extended */
1125
void OPPROTO op_subfe (void)
B
bellard 已提交
1126
{
1127
    do_subfe();
B
bellard 已提交
1128 1129 1130
    RETURN();
}

1131 1132
#if defined(TARGET_PPC64)
void OPPROTO op_subfe_64 (void)
B
bellard 已提交
1133
{
1134
    do_subfe_64();
B
bellard 已提交
1135 1136
    RETURN();
}
1137
#endif
B
bellard 已提交
1138

T
ths 已提交
1139
/* subtract from immediate carrying */
1140
void OPPROTO op_subfic (void)
B
bellard 已提交
1141
{
J
j_mayer 已提交
1142
    T0 = (int32_t)PARAM1 + ~T0 + 1;
1143
    if ((uint32_t)T0 <= (uint32_t)PARAM1) {
B
bellard 已提交
1144 1145 1146 1147 1148 1149 1150
        xer_ca = 1;
    } else {
        xer_ca = 0;
    }
    RETURN();
}

1151 1152 1153
#if defined(TARGET_PPC64)
void OPPROTO op_subfic_64 (void)
{
1154
    T0 = (int64_t)PARAM1 + ~T0 + 1;
1155 1156 1157 1158 1159 1160 1161 1162 1163
    if ((uint64_t)T0 <= (uint64_t)PARAM1) {
        xer_ca = 1;
    } else {
        xer_ca = 0;
    }
    RETURN();
}
#endif

T
ths 已提交
1164
/* subtract from minus one extended */
1165
void OPPROTO op_subfme (void)
B
bellard 已提交
1166 1167
{
    T0 = ~T0 + xer_ca - 1;
1168
    if (likely((uint32_t)T0 != UINT32_MAX))
1169
        xer_ca = 1;
1170 1171
    else
        xer_ca = 0;
1172 1173
    RETURN();
}
B
bellard 已提交
1174

1175 1176 1177 1178
#if defined(TARGET_PPC64)
void OPPROTO op_subfme_64 (void)
{
    T0 = ~T0 + xer_ca - 1;
1179
    if (likely((uint64_t)T0 != UINT64_MAX))
B
bellard 已提交
1180
        xer_ca = 1;
1181 1182
    else
        xer_ca = 0;
B
bellard 已提交
1183 1184
    RETURN();
}
1185
#endif
B
bellard 已提交
1186

1187
void OPPROTO op_subfmeo (void)
B
bellard 已提交
1188
{
1189
    do_subfmeo();
B
bellard 已提交
1190 1191 1192
    RETURN();
}

1193 1194 1195 1196 1197 1198 1199 1200
#if defined(TARGET_PPC64)
void OPPROTO op_subfmeo_64 (void)
{
    do_subfmeo_64();
    RETURN();
}
#endif

T
ths 已提交
1201
/* subtract from zero extended */
1202
void OPPROTO op_subfze (void)
B
bellard 已提交
1203 1204 1205
{
    T1 = ~T0;
    T0 = T1 + xer_ca;
1206
    if ((uint32_t)T0 < (uint32_t)T1) {
B
bellard 已提交
1207 1208 1209 1210 1211 1212 1213
        xer_ca = 1;
    } else {
        xer_ca = 0;
    }
    RETURN();
}

1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227
#if defined(TARGET_PPC64)
void OPPROTO op_subfze_64 (void)
{
    T1 = ~T0;
    T0 = T1 + xer_ca;
    if ((uint64_t)T0 < (uint64_t)T1) {
        xer_ca = 1;
    } else {
        xer_ca = 0;
    }
    RETURN();
}
#endif

1228
void OPPROTO op_subfzeo (void)
B
bellard 已提交
1229
{
1230
    do_subfzeo();
B
bellard 已提交
1231 1232 1233
    RETURN();
}

1234 1235 1236 1237 1238 1239 1240 1241
#if defined(TARGET_PPC64)
void OPPROTO op_subfzeo_64 (void)
{
    do_subfzeo_64();
    RETURN();
}
#endif

B
bellard 已提交
1242 1243
/***                           Integer comparison                          ***/
/* compare */
1244 1245 1246 1247 1248 1249 1250 1251 1252
void OPPROTO op_cmp (void)
{
    if ((int32_t)T0 < (int32_t)T1) {
        T0 = 0x08;
    } else if ((int32_t)T0 > (int32_t)T1) {
        T0 = 0x04;
    } else {
        T0 = 0x02;
    }
J
j_mayer 已提交
1253
    T0 |= xer_so;
1254 1255 1256 1257 1258
    RETURN();
}

#if defined(TARGET_PPC64)
void OPPROTO op_cmp_64 (void)
B
bellard 已提交
1259
{
1260
    if ((int64_t)T0 < (int64_t)T1) {
B
bellard 已提交
1261
        T0 = 0x08;
1262
    } else if ((int64_t)T0 > (int64_t)T1) {
B
bellard 已提交
1263 1264 1265 1266
        T0 = 0x04;
    } else {
        T0 = 0x02;
    }
J
j_mayer 已提交
1267
    T0 |= xer_so;
B
bellard 已提交
1268 1269
    RETURN();
}
1270
#endif
B
bellard 已提交
1271 1272

/* compare immediate */
1273
void OPPROTO op_cmpi (void)
B
bellard 已提交
1274
{
1275
    if ((int32_t)T0 < (int32_t)PARAM1) {
B
bellard 已提交
1276
        T0 = 0x08;
1277
    } else if ((int32_t)T0 > (int32_t)PARAM1) {
B
bellard 已提交
1278 1279 1280 1281
        T0 = 0x04;
    } else {
        T0 = 0x02;
    }
J
j_mayer 已提交
1282
    T0 |= xer_so;
B
bellard 已提交
1283 1284 1285
    RETURN();
}

1286 1287 1288 1289 1290 1291 1292 1293 1294 1295
#if defined(TARGET_PPC64)
void OPPROTO op_cmpi_64 (void)
{
    if ((int64_t)T0 < (int64_t)((int32_t)PARAM1)) {
        T0 = 0x08;
    } else if ((int64_t)T0 > (int64_t)((int32_t)PARAM1)) {
        T0 = 0x04;
    } else {
        T0 = 0x02;
    }
J
j_mayer 已提交
1296
    T0 |= xer_so;
1297 1298 1299 1300
    RETURN();
}
#endif

B
bellard 已提交
1301
/* compare logical */
1302
void OPPROTO op_cmpl (void)
B
bellard 已提交
1303
{
1304
    if ((uint32_t)T0 < (uint32_t)T1) {
B
bellard 已提交
1305
        T0 = 0x08;
1306
    } else if ((uint32_t)T0 > (uint32_t)T1) {
B
bellard 已提交
1307 1308 1309 1310
        T0 = 0x04;
    } else {
        T0 = 0x02;
    }
J
j_mayer 已提交
1311
    T0 |= xer_so;
B
bellard 已提交
1312 1313 1314
    RETURN();
}

1315 1316 1317 1318 1319 1320 1321 1322 1323 1324
#if defined(TARGET_PPC64)
void OPPROTO op_cmpl_64 (void)
{
    if ((uint64_t)T0 < (uint64_t)T1) {
        T0 = 0x08;
    } else if ((uint64_t)T0 > (uint64_t)T1) {
        T0 = 0x04;
    } else {
        T0 = 0x02;
    }
J
j_mayer 已提交
1325
    T0 |= xer_so;
1326 1327 1328 1329
    RETURN();
}
#endif

B
bellard 已提交
1330
/* compare logical immediate */
1331 1332 1333 1334 1335 1336 1337 1338 1339
void OPPROTO op_cmpli (void)
{
    if ((uint32_t)T0 < (uint32_t)PARAM1) {
        T0 = 0x08;
    } else if ((uint32_t)T0 > (uint32_t)PARAM1) {
        T0 = 0x04;
    } else {
        T0 = 0x02;
    }
J
j_mayer 已提交
1340
    T0 |= xer_so;
1341 1342 1343 1344 1345
    RETURN();
}

#if defined(TARGET_PPC64)
void OPPROTO op_cmpli_64 (void)
B
bellard 已提交
1346
{
1347
    if ((uint64_t)T0 < (uint64_t)PARAM1) {
B
bellard 已提交
1348
        T0 = 0x08;
1349
    } else if ((uint64_t)T0 > (uint64_t)PARAM1) {
B
bellard 已提交
1350 1351 1352 1353
        T0 = 0x04;
    } else {
        T0 = 0x02;
    }
J
j_mayer 已提交
1354
    T0 |= xer_so;
B
bellard 已提交
1355 1356
    RETURN();
}
1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367
#endif

void OPPROTO op_isel (void)
{
    if (T0)
        T0 = T1;
    else
        T0 = T2;
    RETURN();
}

A
aurel32 已提交
1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381
void OPPROTO op_popcntb (void)
{
    do_popcntb();
    RETURN();
}

#if defined(TARGET_PPC64)
void OPPROTO op_popcntb_64 (void)
{
    do_popcntb_64();
    RETURN();
}
#endif

B
bellard 已提交
1382 1383
/***                            Integer logical                            ***/
/* and */
1384
void OPPROTO op_and (void)
B
bellard 已提交
1385 1386 1387 1388 1389 1390
{
    T0 &= T1;
    RETURN();
}

/* andc */
1391
void OPPROTO op_andc (void)
B
bellard 已提交
1392 1393 1394 1395 1396 1397
{
    T0 &= ~T1;
    RETURN();
}

/* andi. */
1398
void OPPROTO op_andi_T0 (void)
B
bellard 已提交
1399
{
1400
    T0 &= (uint32_t)PARAM1;
B
bellard 已提交
1401 1402 1403
    RETURN();
}

1404 1405
void OPPROTO op_andi_T1 (void)
{
1406
    T1 &= (uint32_t)PARAM1;
1407 1408 1409
    RETURN();
}

1410 1411 1412
#if defined(TARGET_PPC64)
void OPPROTO op_andi_T0_64 (void)
{
1413
    T0 &= ((uint64_t)PARAM1 << 32) | (uint64_t)PARAM2;
1414 1415 1416 1417 1418
    RETURN();
}

void OPPROTO op_andi_T1_64 (void)
{
1419
    T1 &= ((uint64_t)PARAM1 << 32) | (uint64_t)PARAM2;
1420 1421 1422 1423
    RETURN();
}
#endif

B
bellard 已提交
1424
/* count leading zero */
1425
void OPPROTO op_cntlzw (void)
B
bellard 已提交
1426
{
1427
    do_cntlzw();
B
bellard 已提交
1428 1429 1430
    RETURN();
}

1431 1432 1433
#if defined(TARGET_PPC64)
void OPPROTO op_cntlzd (void)
{
1434
    do_cntlzd();
1435 1436 1437 1438
    RETURN();
}
#endif

B
bellard 已提交
1439
/* eqv */
1440
void OPPROTO op_eqv (void)
B
bellard 已提交
1441 1442 1443 1444 1445 1446
{
    T0 = ~(T0 ^ T1);
    RETURN();
}

/* extend sign byte */
1447
void OPPROTO op_extsb (void)
B
bellard 已提交
1448
{
1449 1450 1451 1452 1453
#if defined (TARGET_PPC64)
    T0 = (int64_t)((int8_t)T0);
#else
    T0 = (int32_t)((int8_t)T0);
#endif
B
bellard 已提交
1454 1455 1456 1457
    RETURN();
}

/* extend sign half word */
1458
void OPPROTO op_extsh (void)
B
bellard 已提交
1459
{
1460 1461 1462 1463 1464
#if defined (TARGET_PPC64)
    T0 = (int64_t)((int16_t)T0);
#else
    T0 = (int32_t)((int16_t)T0);
#endif
B
bellard 已提交
1465 1466 1467
    RETURN();
}

1468 1469 1470 1471 1472 1473 1474 1475
#if defined (TARGET_PPC64)
void OPPROTO op_extsw (void)
{
    T0 = (int64_t)((int32_t)T0);
    RETURN();
}
#endif

B
bellard 已提交
1476
/* nand */
1477
void OPPROTO op_nand (void)
B
bellard 已提交
1478 1479 1480 1481 1482 1483
{
    T0 = ~(T0 & T1);
    RETURN();
}

/* nor */
1484
void OPPROTO op_nor (void)
B
bellard 已提交
1485 1486 1487 1488 1489 1490
{
    T0 = ~(T0 | T1);
    RETURN();
}

/* or */
1491
void OPPROTO op_or (void)
B
bellard 已提交
1492 1493 1494 1495 1496 1497
{
    T0 |= T1;
    RETURN();
}

/* orc */
1498
void OPPROTO op_orc (void)
B
bellard 已提交
1499 1500 1501 1502 1503 1504
{
    T0 |= ~T1;
    RETURN();
}

/* ori */
1505
void OPPROTO op_ori (void)
B
bellard 已提交
1506
{
1507
    T0 |= (uint32_t)PARAM1;
B
bellard 已提交
1508 1509 1510 1511
    RETURN();
}

/* xor */
1512
void OPPROTO op_xor (void)
B
bellard 已提交
1513 1514 1515 1516 1517 1518
{
    T0 ^= T1;
    RETURN();
}

/* xori */
1519
void OPPROTO op_xori (void)
B
bellard 已提交
1520
{
1521
    T0 ^= (uint32_t)PARAM1;
B
bellard 已提交
1522 1523 1524 1525
    RETURN();
}

/***                             Integer rotate                            ***/
1526
void OPPROTO op_rotl32_T0_T1 (void)
B
bellard 已提交
1527
{
1528
    T0 = rotl32(T0, T1 & 0x1F);
B
bellard 已提交
1529 1530 1531
    RETURN();
}

1532
void OPPROTO op_rotli32_T0 (void)
B
bellard 已提交
1533
{
1534
    T0 = rotl32(T0, PARAM1);
B
bellard 已提交
1535 1536 1537
    RETURN();
}

J
j_mayer 已提交
1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551
#if defined(TARGET_PPC64)
void OPPROTO op_rotl64_T0_T1 (void)
{
    T0 = rotl64(T0, T1 & 0x3F);
    RETURN();
}

void OPPROTO op_rotli64_T0 (void)
{
    T0 = rotl64(T0, PARAM1);
    RETURN();
}
#endif

B
bellard 已提交
1552 1553
/***                             Integer shift                             ***/
/* shift left word */
1554
void OPPROTO op_slw (void)
B
bellard 已提交
1555 1556 1557
{
    if (T1 & 0x20) {
        T0 = 0;
1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568
    } else {
        T0 = (uint32_t)(T0 << T1);
    }
    RETURN();
}

#if defined(TARGET_PPC64)
void OPPROTO op_sld (void)
{
    if (T1 & 0x40) {
        T0 = 0;
B
bellard 已提交
1569 1570 1571 1572 1573
    } else {
        T0 = T0 << T1;
    }
    RETURN();
}
1574
#endif
B
bellard 已提交
1575 1576

/* shift right algebraic word */
1577
void OPPROTO op_sraw (void)
B
bellard 已提交
1578
{
1579
    do_sraw();
B
bellard 已提交
1580 1581 1582
    RETURN();
}

1583 1584 1585 1586 1587 1588 1589 1590
#if defined(TARGET_PPC64)
void OPPROTO op_srad (void)
{
    do_srad();
    RETURN();
}
#endif

B
bellard 已提交
1591
/* shift right algebraic word immediate */
1592
void OPPROTO op_srawi (void)
B
bellard 已提交
1593
{
1594 1595 1596 1597
    uint32_t mask = (uint32_t)PARAM2;

    T0 = (int32_t)T0 >> PARAM1;
    if ((int32_t)T1 < 0 && (T1 & mask) != 0) {
B
bellard 已提交
1598 1599 1600 1601 1602 1603 1604
        xer_ca = 1;
    } else {
        xer_ca = 0;
    }
    RETURN();
}

1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619
#if defined(TARGET_PPC64)
void OPPROTO op_sradi (void)
{
    uint64_t mask = ((uint64_t)PARAM2 << 32) | (uint64_t)PARAM3;

    T0 = (int64_t)T0 >> PARAM1;
    if ((int64_t)T1 < 0 && ((uint64_t)T1 & mask) != 0) {
        xer_ca = 1;
    } else {
        xer_ca = 0;
    }
    RETURN();
}
#endif

B
bellard 已提交
1620
/* shift right word */
1621
void OPPROTO op_srw (void)
B
bellard 已提交
1622 1623 1624 1625
{
    if (T1 & 0x20) {
        T0 = 0;
    } else {
1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637
        T0 = (uint32_t)T0 >> T1;
    }
    RETURN();
}

#if defined(TARGET_PPC64)
void OPPROTO op_srd (void)
{
    if (T1 & 0x40) {
        T0 = 0;
    } else {
        T0 = (uint64_t)T0 >> T1;
B
bellard 已提交
1638 1639 1640
    }
    RETURN();
}
1641
#endif
B
bellard 已提交
1642

1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654
void OPPROTO op_sl_T0_T1 (void)
{
    T0 = T0 << T1;
    RETURN();
}

void OPPROTO op_sli_T0 (void)
{
    T0 = T0 << PARAM1;
    RETURN();
}

1655 1656 1657 1658 1659 1660
void OPPROTO op_sli_T1 (void)
{
    T1 = T1 << PARAM1;
    RETURN();
}

1661 1662
void OPPROTO op_srl_T0_T1 (void)
{
1663 1664 1665 1666 1667 1668 1669 1670
    T0 = (uint32_t)T0 >> T1;
    RETURN();
}

#if defined(TARGET_PPC64)
void OPPROTO op_srl_T0_T1_64 (void)
{
    T0 = (uint32_t)T0 >> T1;
1671 1672
    RETURN();
}
1673
#endif
1674 1675 1676

void OPPROTO op_srli_T0 (void)
{
1677
    T0 = (uint32_t)T0 >> PARAM1;
1678 1679 1680
    RETURN();
}

1681 1682 1683 1684 1685 1686 1687 1688
#if defined(TARGET_PPC64)
void OPPROTO op_srli_T0_64 (void)
{
    T0 = (uint64_t)T0 >> PARAM1;
    RETURN();
}
#endif

1689 1690
void OPPROTO op_srli_T1 (void)
{
1691
    T1 = (uint32_t)T1 >> PARAM1;
1692 1693 1694
    RETURN();
}

1695 1696 1697 1698 1699 1700 1701 1702
#if defined(TARGET_PPC64)
void OPPROTO op_srli_T1_64 (void)
{
    T1 = (uint64_t)T1 >> PARAM1;
    RETURN();
}
#endif

B
bellard 已提交
1703
/***                       Floating-Point arithmetic                       ***/
1704
/* fadd - fadd. */
1705
void OPPROTO op_fadd (void)
B
bellard 已提交
1706
{
1707
#if USE_PRECISE_EMULATION
1708 1709
    do_fadd();
#else
1710
    FT0 = float64_add(FT0, FT1, &env->fp_status);
1711
#endif
B
bellard 已提交
1712 1713 1714
    RETURN();
}

1715
/* fsub - fsub. */
1716
void OPPROTO op_fsub (void)
B
bellard 已提交
1717
{
1718
#if USE_PRECISE_EMULATION
1719 1720
    do_fsub();
#else
1721
    FT0 = float64_sub(FT0, FT1, &env->fp_status);
1722
#endif
B
bellard 已提交
1723 1724 1725
    RETURN();
}

1726
/* fmul - fmul. */
1727
void OPPROTO op_fmul (void)
B
bellard 已提交
1728
{
1729
#if USE_PRECISE_EMULATION
1730 1731
    do_fmul();
#else
1732
    FT0 = float64_mul(FT0, FT1, &env->fp_status);
1733
#endif
B
bellard 已提交
1734 1735 1736
    RETURN();
}

1737
/* fdiv - fdiv. */
1738
void OPPROTO op_fdiv (void)
B
bellard 已提交
1739
{
1740
#if USE_PRECISE_EMULATION
1741 1742
    do_fdiv();
#else
1743
    FT0 = float64_div(FT0, FT1, &env->fp_status);
1744
#endif
B
bellard 已提交
1745 1746
    RETURN();
}
1747

1748
/* fsqrt - fsqrt. */
1749
void OPPROTO op_fsqrt (void)
1750
{
1751 1752
    do_fsqrt();
    RETURN();
1753 1754
}

1755 1756 1757 1758 1759 1760 1761
/* fre - fre. */
void OPPROTO op_fre (void)
{
    do_fre();
    RETURN();
}

1762
/* fres - fres. */
1763
void OPPROTO op_fres (void)
1764
{
1765 1766
    do_fres();
    RETURN();
1767 1768
}

1769
/* frsqrte  - frsqrte. */
1770
void OPPROTO op_frsqrte (void)
1771
{
1772
    do_frsqrte();
1773
    RETURN();
1774 1775
}

1776
/* fsel - fsel. */
1777
void OPPROTO op_fsel (void)
1778
{
1779 1780
    do_fsel();
    RETURN();
1781 1782
}

1783 1784
/***                     Floating-Point multiply-and-add                   ***/
/* fmadd - fmadd. */
1785
void OPPROTO op_fmadd (void)
1786
{
1787
#if USE_PRECISE_EMULATION
J
j_mayer 已提交
1788 1789
    do_fmadd();
#else
1790 1791
    FT0 = float64_mul(FT0, FT1, &env->fp_status);
    FT0 = float64_add(FT0, FT2, &env->fp_status);
J
j_mayer 已提交
1792
#endif
1793
    RETURN();
1794 1795
}

1796
/* fmsub - fmsub. */
1797
void OPPROTO op_fmsub (void)
1798
{
1799
#if USE_PRECISE_EMULATION
J
j_mayer 已提交
1800 1801
    do_fmsub();
#else
1802 1803
    FT0 = float64_mul(FT0, FT1, &env->fp_status);
    FT0 = float64_sub(FT0, FT2, &env->fp_status);
J
j_mayer 已提交
1804
#endif
1805
    RETURN();
1806 1807
}

1808
/* fnmadd - fnmadd. - fnmadds - fnmadds. */
1809
void OPPROTO op_fnmadd (void)
1810
{
B
bellard 已提交
1811
    do_fnmadd();
1812
    RETURN();
1813 1814
}

1815
/* fnmsub - fnmsub. */
1816
void OPPROTO op_fnmsub (void)
1817
{
B
bellard 已提交
1818
    do_fnmsub();
1819
    RETURN();
1820 1821
}

1822 1823
/***                     Floating-Point round & convert                    ***/
/* frsp - frsp. */
1824
void OPPROTO op_frsp (void)
1825
{
1826
#if USE_PRECISE_EMULATION
1827 1828
    do_frsp();
#else
1829
    FT0 = float64_to_float32(FT0, &env->fp_status);
1830
#endif
1831
    RETURN();
1832 1833
}

1834
/* fctiw - fctiw. */
1835
void OPPROTO op_fctiw (void)
1836
{
1837 1838
    do_fctiw();
    RETURN();
1839 1840
}

1841
/* fctiwz - fctiwz. */
1842
void OPPROTO op_fctiwz (void)
1843
{
1844 1845
    do_fctiwz();
    RETURN();
1846 1847
}

1848 1849
#if defined(TARGET_PPC64)
/* fcfid - fcfid. */
1850
void OPPROTO op_fcfid (void)
1851 1852 1853 1854 1855 1856
{
    do_fcfid();
    RETURN();
}

/* fctid - fctid. */
1857
void OPPROTO op_fctid (void)
1858 1859 1860 1861 1862 1863
{
    do_fctid();
    RETURN();
}

/* fctidz - fctidz. */
1864
void OPPROTO op_fctidz (void)
1865 1866 1867 1868 1869 1870
{
    do_fctidz();
    RETURN();
}
#endif

1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894
void OPPROTO op_frin (void)
{
    do_frin();
    RETURN();
}

void OPPROTO op_friz (void)
{
    do_friz();
    RETURN();
}

void OPPROTO op_frip (void)
{
    do_frip();
    RETURN();
}

void OPPROTO op_frim (void)
{
    do_frim();
    RETURN();
}

1895 1896
/***                         Floating-Point compare                        ***/
/* fcmpu */
1897
void OPPROTO op_fcmpu (void)
1898
{
1899 1900
    do_fcmpu();
    RETURN();
1901 1902
}

1903
/* fcmpo */
1904
void OPPROTO op_fcmpo (void)
B
bellard 已提交
1905
{
1906 1907
    do_fcmpo();
    RETURN();
B
bellard 已提交
1908 1909
}

1910 1911
/***                         Floating-point move                           ***/
/* fabs */
1912
void OPPROTO op_fabs (void)
B
bellard 已提交
1913
{
1914
    FT0 = float64_abs(FT0);
B
bellard 已提交
1915 1916 1917
    RETURN();
}

1918
/* fnabs */
1919
void OPPROTO op_fnabs (void)
B
bellard 已提交
1920
{
1921 1922
    FT0 = float64_abs(FT0);
    FT0 = float64_chs(FT0);
B
bellard 已提交
1923 1924 1925
    RETURN();
}

1926
/* fneg */
1927
void OPPROTO op_fneg (void)
B
bellard 已提交
1928
{
1929
    FT0 = float64_chs(FT0);
B
bellard 已提交
1930 1931 1932
    RETURN();
}

1933 1934
/* Load and store */
#define MEMSUFFIX _raw
1935
#include "op_helper.h"
1936
#include "op_mem.h"
1937
#if !defined(CONFIG_USER_ONLY)
1938
#define MEMSUFFIX _user
1939
#include "op_helper.h"
1940 1941
#include "op_mem.h"
#define MEMSUFFIX _kernel
1942
#include "op_helper.h"
1943
#include "op_mem.h"
1944 1945 1946 1947
#define MEMSUFFIX _hypv
#include "op_helper.h"
#include "op_mem.h"
#endif
1948

B
bellard 已提交
1949
/* Special op to check and maybe clear reservation */
1950
void OPPROTO op_check_reservation (void)
B
bellard 已提交
1951
{
1952
    if ((uint32_t)env->reserve == (uint32_t)(T0 & ~0x00000003))
1953
        env->reserve = (target_ulong)-1ULL;
B
bellard 已提交
1954 1955 1956
    RETURN();
}

1957 1958 1959 1960
#if defined(TARGET_PPC64)
void OPPROTO op_check_reservation_64 (void)
{
    if ((uint64_t)env->reserve == (uint64_t)(T0 & ~0x00000003))
1961
        env->reserve = (target_ulong)-1ULL;
1962 1963 1964 1965
    RETURN();
}
#endif

1966 1967 1968 1969 1970 1971
void OPPROTO op_wait (void)
{
    env->halted = 1;
    RETURN();
}

1972
/* Return from interrupt */
1973 1974
#if !defined(CONFIG_USER_ONLY)
void OPPROTO op_rfi (void)
1975
{
1976
    do_rfi();
B
bellard 已提交
1977 1978
    RETURN();
}
1979 1980

#if defined(TARGET_PPC64)
1981 1982 1983 1984 1985
void OPPROTO op_rfid (void)
{
    do_rfid();
    RETURN();
}
1986 1987 1988 1989 1990 1991 1992

void OPPROTO op_hrfid (void)
{
    do_hrfid();
    RETURN();
}
#endif
1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007

/* Exception vectors */
void OPPROTO op_store_excp_prefix (void)
{
    T0 &= env->ivpr_mask;
    env->excp_prefix = T0;
    RETURN();
}

void OPPROTO op_store_excp_vector (void)
{
    T0 &= env->ivor_mask;
    env->excp_vectors[PARAM1] = T0;
    RETURN();
}
2008
#endif
B
bellard 已提交
2009

2010
/* Trap word */
2011
void OPPROTO op_tw (void)
B
bellard 已提交
2012
{
2013
    do_tw(PARAM1);
B
bellard 已提交
2014 2015 2016
    RETURN();
}

2017 2018 2019 2020 2021 2022 2023 2024
#if defined(TARGET_PPC64)
void OPPROTO op_td (void)
{
    do_td(PARAM1);
    RETURN();
}
#endif

2025
#if !defined(CONFIG_USER_ONLY)
2026
/* tlbia */
2027
void OPPROTO op_tlbia (void)
B
bellard 已提交
2028
{
2029
    ppc_tlb_invalidate_all(env);
2030 2031 2032 2033
    RETURN();
}

/* tlbie */
2034
void OPPROTO op_tlbie (void)
2035
{
2036
    ppc_tlb_invalidate_one(env, (uint32_t)T0);
B
bellard 已提交
2037
    RETURN();
2038
}
2039 2040 2041 2042

#if defined(TARGET_PPC64)
void OPPROTO op_tlbie_64 (void)
{
2043
    ppc_tlb_invalidate_one(env, T0);
2044 2045 2046 2047 2048 2049 2050
    RETURN();
}
#endif

#if defined(TARGET_PPC64)
void OPPROTO op_slbia (void)
{
2051
    ppc_slb_invalidate_all(env);
2052 2053 2054 2055 2056
    RETURN();
}

void OPPROTO op_slbie (void)
{
2057 2058 2059 2060 2061 2062 2063
    ppc_slb_invalidate_one(env, (uint32_t)T0);
    RETURN();
}

void OPPROTO op_slbie_64 (void)
{
    ppc_slb_invalidate_one(env, T0);
2064 2065 2066
    RETURN();
}
#endif
2067
#endif
2068

2069
#if !defined(CONFIG_USER_ONLY)
2070
/* PowerPC 602/603/755 software TLB load instructions */
2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081
void OPPROTO op_6xx_tlbld (void)
{
    do_load_6xx_tlb(0);
    RETURN();
}

void OPPROTO op_6xx_tlbli (void)
{
    do_load_6xx_tlb(1);
    RETURN();
}
2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094

/* PowerPC 74xx software TLB load instructions */
void OPPROTO op_74xx_tlbld (void)
{
    do_load_74xx_tlb(0);
    RETURN();
}

void OPPROTO op_74xx_tlbli (void)
{
    do_load_74xx_tlb(1);
    RETURN();
}
2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122
#endif

/* 601 specific */
void OPPROTO op_load_601_rtcl (void)
{
    T0 = cpu_ppc601_load_rtcl(env);
    RETURN();
}

void OPPROTO op_load_601_rtcu (void)
{
    T0 = cpu_ppc601_load_rtcu(env);
    RETURN();
}

#if !defined(CONFIG_USER_ONLY)
void OPPROTO op_store_601_rtcl (void)
{
    cpu_ppc601_store_rtcl(env, T0);
    RETURN();
}

void OPPROTO op_store_601_rtcu (void)
{
    cpu_ppc601_store_rtcu(env, T0);
    RETURN();
}

2123 2124 2125 2126 2127 2128
void OPPROTO op_store_hid0_601 (void)
{
    do_store_hid0_601();
    RETURN();
}

2129 2130 2131 2132 2133 2134 2135 2136
void OPPROTO op_load_601_bat (void)
{
    T0 = env->IBAT[PARAM1][PARAM2];
    RETURN();
}

void OPPROTO op_store_601_batl (void)
{
2137
    do_store_ibatl_601(env, PARAM1, T0);
2138 2139 2140 2141 2142
    RETURN();
}

void OPPROTO op_store_601_batu (void)
{
2143
    do_store_ibatu_601(env, PARAM1, T0);
2144 2145 2146 2147 2148 2149 2150 2151
    RETURN();
}
#endif /* !defined(CONFIG_USER_ONLY) */

/* PowerPC 601 specific instructions (POWER bridge) */
/* XXX: those micro-ops need tests ! */
void OPPROTO op_POWER_abs (void)
{
2152
    if ((int32_t)T0 == INT32_MIN)
2153
        T0 = INT32_MAX;
2154
    else if ((int32_t)T0 < 0)
2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196
        T0 = -T0;
    RETURN();
}

void OPPROTO op_POWER_abso (void)
{
    do_POWER_abso();
    RETURN();
}

void OPPROTO op_POWER_clcs (void)
{
    do_POWER_clcs();
    RETURN();
}

void OPPROTO op_POWER_div (void)
{
    do_POWER_div();
    RETURN();
}

void OPPROTO op_POWER_divo (void)
{
    do_POWER_divo();
    RETURN();
}

void OPPROTO op_POWER_divs (void)
{
    do_POWER_divs();
    RETURN();
}

void OPPROTO op_POWER_divso (void)
{
    do_POWER_divso();
    RETURN();
}

void OPPROTO op_POWER_doz (void)
{
2197
    if ((int32_t)T1 > (int32_t)T0)
2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263
        T0 = T1 - T0;
    else
        T0 = 0;
    RETURN();
}

void OPPROTO op_POWER_dozo (void)
{
    do_POWER_dozo();
    RETURN();
}

void OPPROTO op_load_xer_cmp (void)
{
    T2 = xer_cmp;
    RETURN();
}

void OPPROTO op_POWER_maskg (void)
{
    do_POWER_maskg();
    RETURN();
}

void OPPROTO op_POWER_maskir (void)
{
    T0 = (T0 & ~T2) | (T1 & T2);
    RETURN();
}

void OPPROTO op_POWER_mul (void)
{
    uint64_t tmp;

    tmp = (uint64_t)T0 * (uint64_t)T1;
    env->spr[SPR_MQ] = tmp >> 32;
    T0 = tmp;
    RETURN();
}

void OPPROTO op_POWER_mulo (void)
{
    do_POWER_mulo();
    RETURN();
}

void OPPROTO op_POWER_nabs (void)
{
    if (T0 > 0)
        T0 = -T0;
    RETURN();
}

void OPPROTO op_POWER_nabso (void)
{
    /* nabs never overflows */
    if (T0 > 0)
        T0 = -T0;
    xer_ov = 0;
    RETURN();
}

/* XXX: factorise POWER rotates... */
void OPPROTO op_POWER_rlmi (void)
{
    T0 = rotl32(T0, T2) & PARAM1;
2264
    T0 |= T1 & (uint32_t)PARAM2;
2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296
    RETURN();
}

void OPPROTO op_POWER_rrib (void)
{
    T2 &= 0x1FUL;
    T0 = rotl32(T0 & INT32_MIN, T2);
    T0 |= T1 & ~rotl32(INT32_MIN, T2);
    RETURN();
}

void OPPROTO op_POWER_sle (void)
{
    T1 &= 0x1FUL;
    env->spr[SPR_MQ] = rotl32(T0, T1);
    T0 = T0 << T1;
    RETURN();
}

void OPPROTO op_POWER_sleq (void)
{
    uint32_t tmp = env->spr[SPR_MQ];

    T1 &= 0x1FUL;
    env->spr[SPR_MQ] = rotl32(T0, T1);
    T0 = T0 << T1;
    T0 |= tmp >> (32 - T1);
    RETURN();
}

void OPPROTO op_POWER_sllq (void)
{
2297
    uint32_t msk = UINT32_MAX;
2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309

    msk = msk << (T1 & 0x1FUL);
    if (T1 & 0x20UL)
        msk = ~msk;
    T1 &= 0x1FUL;
    T0 = (T0 << T1) & msk;
    T0 |= env->spr[SPR_MQ] & ~msk;
    RETURN();
}

void OPPROTO op_POWER_slq (void)
{
2310
    uint32_t msk = UINT32_MAX, tmp;
2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325

    msk = msk << (T1 & 0x1FUL);
    if (T1 & 0x20UL)
        msk = ~msk;
    T1 &= 0x1FUL;
    tmp = rotl32(T0, T1);
    T0 = tmp & msk;
    env->spr[SPR_MQ] = tmp;
    RETURN();
}

void OPPROTO op_POWER_sraq (void)
{
    env->spr[SPR_MQ] = rotl32(T0, 32 - (T1 & 0x1FUL));
    if (T1 & 0x20UL)
2326
        T0 = UINT32_MAX;
2327
    else
2328
        T0 = (int32_t)T0 >> T1;
2329 2330 2331 2332 2333 2334 2335
    RETURN();
}

void OPPROTO op_POWER_sre (void)
{
    T1 &= 0x1FUL;
    env->spr[SPR_MQ] = rotl32(T0, 32 - T1);
2336
    T0 = (int32_t)T0 >> T1;
2337 2338 2339 2340 2341 2342 2343
    RETURN();
}

void OPPROTO op_POWER_srea (void)
{
    T1 &= 0x1FUL;
    env->spr[SPR_MQ] = T0 >> T1;
2344
    T0 = (int32_t)T0 >> T1;
2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481
    RETURN();
}

void OPPROTO op_POWER_sreq (void)
{
    uint32_t tmp;
    int32_t msk;

    T1 &= 0x1FUL;
    msk = INT32_MIN >> T1;
    tmp = env->spr[SPR_MQ];
    env->spr[SPR_MQ] = rotl32(T0, 32 - T1);
    T0 = T0 >> T1;
    T0 |= tmp & msk;
    RETURN();
}

void OPPROTO op_POWER_srlq (void)
{
    uint32_t tmp;
    int32_t msk;

    msk = INT32_MIN >> (T1 & 0x1FUL);
    if (T1 & 0x20UL)
        msk = ~msk;
    T1 &= 0x1FUL;
    tmp = env->spr[SPR_MQ];
    env->spr[SPR_MQ] = rotl32(T0, 32 - T1);
    T0 = T0 >> T1;
    T0 &= msk;
    T0 |= tmp & ~msk;
    RETURN();
}

void OPPROTO op_POWER_srq (void)
{
    T1 &= 0x1FUL;
    env->spr[SPR_MQ] = rotl32(T0, 32 - T1);
    T0 = T0 >> T1;
    RETURN();
}

/* POWER instructions not implemented in PowerPC 601 */
#if !defined(CONFIG_USER_ONLY)
void OPPROTO op_POWER_mfsri (void)
{
    T1 = T0 >> 28;
    T0 = env->sr[T1];
    RETURN();
}

void OPPROTO op_POWER_rac (void)
{
    do_POWER_rac();
    RETURN();
}

void OPPROTO op_POWER_rfsvc (void)
{
    do_POWER_rfsvc();
    RETURN();
}
#endif

/* PowerPC 602 specific instruction */
#if !defined(CONFIG_USER_ONLY)
void OPPROTO op_602_mfrom (void)
{
    do_op_602_mfrom();
    RETURN();
}
#endif

/* PowerPC 4xx specific micro-ops */
void OPPROTO op_405_add_T0_T2 (void)
{
    T0 = (int32_t)T0 + (int32_t)T2;
    RETURN();
}

void OPPROTO op_405_mulchw (void)
{
    T0 = ((int16_t)T0) * ((int16_t)(T1 >> 16));
    RETURN();
}

void OPPROTO op_405_mulchwu (void)
{
    T0 = ((uint16_t)T0) * ((uint16_t)(T1 >> 16));
    RETURN();
}

void OPPROTO op_405_mulhhw (void)
{
    T0 = ((int16_t)(T0 >> 16)) * ((int16_t)(T1 >> 16));
    RETURN();
}

void OPPROTO op_405_mulhhwu (void)
{
    T0 = ((uint16_t)(T0 >> 16)) * ((uint16_t)(T1 >> 16));
    RETURN();
}

void OPPROTO op_405_mullhw (void)
{
    T0 = ((int16_t)T0) * ((int16_t)T1);
    RETURN();
}

void OPPROTO op_405_mullhwu (void)
{
    T0 = ((uint16_t)T0) * ((uint16_t)T1);
    RETURN();
}

void OPPROTO op_405_check_sat (void)
{
    do_405_check_sat();
    RETURN();
}

void OPPROTO op_405_check_ovu (void)
{
    if (likely(T0 >= T2)) {
        xer_ov = 0;
    } else {
        xer_ov = 1;
        xer_so = 1;
    }
    RETURN();
}

void OPPROTO op_405_check_satu (void)
{
    if (unlikely(T0 < T2)) {
        /* Saturate result */
2482
        T0 = UINT32_MAX;
2483 2484 2485 2486
    }
    RETURN();
}

2487
void OPPROTO op_load_dcr (void)
2488
{
2489
    do_load_dcr();
2490 2491 2492
    RETURN();
}

2493
void OPPROTO op_store_dcr (void)
2494
{
2495
    do_store_dcr();
2496 2497 2498
    RETURN();
}

2499
#if !defined(CONFIG_USER_ONLY)
2500 2501 2502
/* Return from critical interrupt :
 * same as rfi, except nip & MSR are loaded from SRR2/3 instead of SRR0/1
 */
2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521
void OPPROTO op_40x_rfci (void)
{
    do_40x_rfci();
    RETURN();
}

void OPPROTO op_rfci (void)
{
    do_rfci();
    RETURN();
}

void OPPROTO op_rfdi (void)
{
    do_rfdi();
    RETURN();
}

void OPPROTO op_rfmci (void)
2522
{
2523
    do_rfmci();
2524 2525 2526
    RETURN();
}

2527
void OPPROTO op_wrte (void)
2528
{
2529 2530 2531 2532 2533 2534
    /* We don't call do_store_msr here as we won't trigger
     * any special case nor change hflags
     */
    T0 &= 1 << MSR_EE;
    env->msr &= ~(1 << MSR_EE);
    env->msr |= T0;
2535 2536 2537
    RETURN();
}

2538
void OPPROTO op_440_tlbre (void)
2539
{
2540
    do_440_tlbre(PARAM1);
2541 2542 2543
    RETURN();
}

2544
void OPPROTO op_440_tlbsx (void)
2545
{
2546
    T0 = ppcemb_tlb_search(env, T0, env->spr[SPR_440_MMUCR] & 0xFF);
2547 2548 2549
    RETURN();
}

2550
void OPPROTO op_4xx_tlbsx_check (void)
2551
{
2552 2553 2554
    int tmp;

    tmp = xer_so;
2555
    if ((int)T0 != -1)
2556 2557
        tmp |= 0x02;
    env->crf[0] = tmp;
2558 2559 2560
    RETURN();
}

2561
void OPPROTO op_440_tlbwe (void)
2562
{
2563
    do_440_tlbwe(PARAM1);
2564 2565 2566
    RETURN();
}

2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580
void OPPROTO op_4xx_tlbre_lo (void)
{
    do_4xx_tlbre_lo();
    RETURN();
}

void OPPROTO op_4xx_tlbre_hi (void)
{
    do_4xx_tlbre_hi();
    RETURN();
}

void OPPROTO op_4xx_tlbsx (void)
{
2581
    T0 = ppcemb_tlb_search(env, T0, env->spr[SPR_40x_PID]);
2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618
    RETURN();
}

void OPPROTO op_4xx_tlbwe_lo (void)
{
    do_4xx_tlbwe_lo();
    RETURN();
}

void OPPROTO op_4xx_tlbwe_hi (void)
{
    do_4xx_tlbwe_hi();
    RETURN();
}
#endif

/* SPR micro-ops */
/* 440 specific */
void OPPROTO op_440_dlmzb (void)
{
    do_440_dlmzb();
    RETURN();
}

void OPPROTO op_440_dlmzb_update_Rc (void)
{
    if (T0 == 8)
        T0 = 0x2;
    else if (T0 < 4)
        T0 = 0x4;
    else
        T0 = 0x8;
    RETURN();
}

#if !defined(CONFIG_USER_ONLY)
void OPPROTO op_store_pir (void)
2619 2620 2621 2622
{
    env->spr[SPR_PIR] = T0 & 0x0000000FUL;
    RETURN();
}
2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647

void OPPROTO op_load_403_pb (void)
{
    do_load_403_pb(PARAM1);
    RETURN();
}

void OPPROTO op_store_403_pb (void)
{
    do_store_403_pb(PARAM1);
    RETURN();
}

void OPPROTO op_load_40x_pit (void)
{
    T0 = load_40x_pit(env);
    RETURN();
}

void OPPROTO op_store_40x_pit (void)
{
    store_40x_pit(env, T0);
    RETURN();
}

2648 2649 2650
void OPPROTO op_store_40x_dbcr0 (void)
{
    store_40x_dbcr0(env, T0);
2651
    RETURN();
2652 2653
}

2654 2655 2656 2657 2658 2659
void OPPROTO op_store_40x_sler (void)
{
    store_40x_sler(env, T0);
    RETURN();
}

2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671
void OPPROTO op_store_booke_tcr (void)
{
    store_booke_tcr(env, T0);
    RETURN();
}

void OPPROTO op_store_booke_tsr (void)
{
    store_booke_tsr(env, T0);
    RETURN();
}
#endif /* !defined(CONFIG_USER_ONLY) */
2672 2673 2674 2675 2676

/* SPE extension */
void OPPROTO op_splatw_T1_64 (void)
{
    T1_64 = (T1_64 << 32) | (T1_64 & 0x00000000FFFFFFFFULL);
J
j_mayer 已提交
2677
    RETURN();
2678 2679 2680 2681 2682 2683 2684
}

void OPPROTO op_splatwi_T0_64 (void)
{
    uint64_t tmp = PARAM1;

    T0_64 = (tmp << 32) | tmp;
J
j_mayer 已提交
2685
    RETURN();
2686 2687 2688 2689 2690 2691 2692
}

void OPPROTO op_splatwi_T1_64 (void)
{
    uint64_t tmp = PARAM1;

    T1_64 = (tmp << 32) | tmp;
J
j_mayer 已提交
2693
    RETURN();
2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197
}

void OPPROTO op_extsh_T1_64 (void)
{
    T1_64 = (int32_t)((int16_t)T1_64);
    RETURN();
}

void OPPROTO op_sli16_T1_64 (void)
{
    T1_64 = T1_64 << 16;
    RETURN();
}

void OPPROTO op_sli32_T1_64 (void)
{
    T1_64 = T1_64 << 32;
    RETURN();
}

void OPPROTO op_srli32_T1_64 (void)
{
    T1_64 = T1_64 >> 32;
    RETURN();
}

void OPPROTO op_evsel (void)
{
    do_evsel();
    RETURN();
}

void OPPROTO op_evaddw (void)
{
    do_evaddw();
    RETURN();
}

void OPPROTO op_evsubfw (void)
{
    do_evsubfw();
    RETURN();
}

void OPPROTO op_evneg (void)
{
    do_evneg();
    RETURN();
}

void OPPROTO op_evabs (void)
{
    do_evabs();
    RETURN();
}

void OPPROTO op_evextsh (void)
{
    T0_64 = ((uint64_t)((int32_t)(int16_t)(T0_64 >> 32)) << 32) |
        (uint64_t)((int32_t)(int16_t)T0_64);
    RETURN();
}

void OPPROTO op_evextsb (void)
{
    T0_64 = ((uint64_t)((int32_t)(int8_t)(T0_64 >> 32)) << 32) |
        (uint64_t)((int32_t)(int8_t)T0_64);
    RETURN();
}

void OPPROTO op_evcntlzw (void)
{
    do_evcntlzw();
    RETURN();
}

void OPPROTO op_evrndw (void)
{
    do_evrndw();
    RETURN();
}

void OPPROTO op_brinc (void)
{
    do_brinc();
    RETURN();
}

void OPPROTO op_evcntlsw (void)
{
    do_evcntlsw();
    RETURN();
}

void OPPROTO op_evand (void)
{
    T0_64 &= T1_64;
    RETURN();
}

void OPPROTO op_evandc (void)
{
    T0_64 &= ~T1_64;
    RETURN();
}

void OPPROTO op_evor (void)
{
    T0_64 |= T1_64;
    RETURN();
}

void OPPROTO op_evxor (void)
{
    T0_64 ^= T1_64;
    RETURN();
}

void OPPROTO op_eveqv (void)
{
    T0_64 = ~(T0_64 ^ T1_64);
    RETURN();
}

void OPPROTO op_evnor (void)
{
    T0_64 = ~(T0_64 | T1_64);
    RETURN();
}

void OPPROTO op_evorc (void)
{
    T0_64 |= ~T1_64;
    RETURN();
}

void OPPROTO op_evnand (void)
{
    T0_64 = ~(T0_64 & T1_64);
    RETURN();
}

void OPPROTO op_evsrws (void)
{
    do_evsrws();
    RETURN();
}

void OPPROTO op_evsrwu (void)
{
    do_evsrwu();
    RETURN();
}

void OPPROTO op_evslw (void)
{
    do_evslw();
    RETURN();
}

void OPPROTO op_evrlw (void)
{
    do_evrlw();
    RETURN();
}

void OPPROTO op_evmergelo (void)
{
    T0_64 = (T0_64 << 32) | (T1_64 & 0x00000000FFFFFFFFULL);
    RETURN();
}

void OPPROTO op_evmergehi (void)
{
    T0_64 = (T0_64 & 0xFFFFFFFF00000000ULL) | (T1_64 >> 32);
    RETURN();
}

void OPPROTO op_evmergelohi (void)
{
    T0_64 = (T0_64 << 32) | (T1_64 >> 32);
    RETURN();
}

void OPPROTO op_evmergehilo (void)
{
    T0_64 = (T0_64 & 0xFFFFFFFF00000000ULL) | (T1_64 & 0x00000000FFFFFFFFULL);
    RETURN();
}

void OPPROTO op_evcmpgts (void)
{
    do_evcmpgts();
    RETURN();
}

void OPPROTO op_evcmpgtu (void)
{
    do_evcmpgtu();
    RETURN();
}

void OPPROTO op_evcmplts (void)
{
    do_evcmplts();
    RETURN();
}

void OPPROTO op_evcmpltu (void)
{
    do_evcmpltu();
    RETURN();
}

void OPPROTO op_evcmpeq (void)
{
    do_evcmpeq();
    RETURN();
}

void OPPROTO op_evfssub (void)
{
    do_evfssub();
    RETURN();
}

void OPPROTO op_evfsadd (void)
{
    do_evfsadd();
    RETURN();
}

void OPPROTO op_evfsnabs (void)
{
    do_evfsnabs();
    RETURN();
}

void OPPROTO op_evfsabs (void)
{
    do_evfsabs();
    RETURN();
}

void OPPROTO op_evfsneg (void)
{
    do_evfsneg();
    RETURN();
}

void OPPROTO op_evfsdiv (void)
{
    do_evfsdiv();
    RETURN();
}

void OPPROTO op_evfsmul (void)
{
    do_evfsmul();
    RETURN();
}

void OPPROTO op_evfscmplt (void)
{
    do_evfscmplt();
    RETURN();
}

void OPPROTO op_evfscmpgt (void)
{
    do_evfscmpgt();
    RETURN();
}

void OPPROTO op_evfscmpeq (void)
{
    do_evfscmpeq();
    RETURN();
}

void OPPROTO op_evfscfsi (void)
{
    do_evfscfsi();
    RETURN();
}

void OPPROTO op_evfscfui (void)
{
    do_evfscfui();
    RETURN();
}

void OPPROTO op_evfscfsf (void)
{
    do_evfscfsf();
    RETURN();
}

void OPPROTO op_evfscfuf (void)
{
    do_evfscfuf();
    RETURN();
}

void OPPROTO op_evfsctsi (void)
{
    do_evfsctsi();
    RETURN();
}

void OPPROTO op_evfsctui (void)
{
    do_evfsctui();
    RETURN();
}

void OPPROTO op_evfsctsf (void)
{
    do_evfsctsf();
    RETURN();
}

void OPPROTO op_evfsctuf (void)
{
    do_evfsctuf();
    RETURN();
}

void OPPROTO op_evfsctuiz (void)
{
    do_evfsctuiz();
    RETURN();
}

void OPPROTO op_evfsctsiz (void)
{
    do_evfsctsiz();
    RETURN();
}

void OPPROTO op_evfststlt (void)
{
    do_evfststlt();
    RETURN();
}

void OPPROTO op_evfststgt (void)
{
    do_evfststgt();
    RETURN();
}

void OPPROTO op_evfststeq (void)
{
    do_evfststeq();
    RETURN();
}

void OPPROTO op_efssub (void)
{
    T0_64 = _do_efssub(T0_64, T1_64);
    RETURN();
}

void OPPROTO op_efsadd (void)
{
    T0_64 = _do_efsadd(T0_64, T1_64);
    RETURN();
}

void OPPROTO op_efsnabs (void)
{
    T0_64 = _do_efsnabs(T0_64);
    RETURN();
}

void OPPROTO op_efsabs (void)
{
    T0_64 = _do_efsabs(T0_64);
    RETURN();
}

void OPPROTO op_efsneg (void)
{
    T0_64 = _do_efsneg(T0_64);
    RETURN();
}

void OPPROTO op_efsdiv (void)
{
    T0_64 = _do_efsdiv(T0_64, T1_64);
    RETURN();
}

void OPPROTO op_efsmul (void)
{
    T0_64 = _do_efsmul(T0_64, T1_64);
    RETURN();
}

void OPPROTO op_efscmplt (void)
{
    do_efscmplt();
    RETURN();
}

void OPPROTO op_efscmpgt (void)
{
    do_efscmpgt();
    RETURN();
}

void OPPROTO op_efscfd (void)
{
    do_efscfd();
    RETURN();
}

void OPPROTO op_efscmpeq (void)
{
    do_efscmpeq();
    RETURN();
}

void OPPROTO op_efscfsi (void)
{
    do_efscfsi();
    RETURN();
}

void OPPROTO op_efscfui (void)
{
    do_efscfui();
    RETURN();
}

void OPPROTO op_efscfsf (void)
{
    do_efscfsf();
    RETURN();
}

void OPPROTO op_efscfuf (void)
{
    do_efscfuf();
    RETURN();
}

void OPPROTO op_efsctsi (void)
{
    do_efsctsi();
    RETURN();
}

void OPPROTO op_efsctui (void)
{
    do_efsctui();
    RETURN();
}

void OPPROTO op_efsctsf (void)
{
    do_efsctsf();
    RETURN();
}

void OPPROTO op_efsctuf (void)
{
    do_efsctuf();
    RETURN();
}

void OPPROTO op_efsctsiz (void)
{
    do_efsctsiz();
    RETURN();
}

void OPPROTO op_efsctuiz (void)
{
    do_efsctuiz();
    RETURN();
}

void OPPROTO op_efststlt (void)
{
    T0 = _do_efststlt(T0_64, T1_64);
    RETURN();
}

void OPPROTO op_efststgt (void)
{
    T0 = _do_efststgt(T0_64, T1_64);
    RETURN();
}

void OPPROTO op_efststeq (void)
{
    T0 = _do_efststeq(T0_64, T1_64);
    RETURN();
}

void OPPROTO op_efdsub (void)
{
3198 3199 3200 3201 3202
    CPU_DoubleU u1, u2;
    u1.ll = T0_64;
    u2.ll = T1_64;
    u1.d = float64_sub(u1.d, u2.d, &env->spe_status);
    T0_64 = u1.ll;
3203 3204 3205 3206 3207
    RETURN();
}

void OPPROTO op_efdadd (void)
{
3208 3209 3210 3211 3212
    CPU_DoubleU u1, u2;
    u1.ll = T0_64;
    u2.ll = T1_64;
    u1.d = float64_add(u1.d, u2.d, &env->spe_status);
    T0_64 = u1.ll;
3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247
    RETURN();
}

void OPPROTO op_efdcfsid (void)
{
    do_efdcfsi();
    RETURN();
}

void OPPROTO op_efdcfuid (void)
{
    do_efdcfui();
    RETURN();
}

void OPPROTO op_efdnabs (void)
{
    T0_64 |= 0x8000000000000000ULL;
    RETURN();
}

void OPPROTO op_efdabs (void)
{
    T0_64 &= ~0x8000000000000000ULL;
    RETURN();
}

void OPPROTO op_efdneg (void)
{
    T0_64 ^= 0x8000000000000000ULL;
    RETURN();
}

void OPPROTO op_efddiv (void)
{
3248 3249 3250 3251 3252
    CPU_DoubleU u1, u2;
    u1.ll = T0_64;
    u2.ll = T1_64;
    u1.d = float64_div(u1.d, u2.d, &env->spe_status);
    T0_64 = u1.ll;
3253 3254 3255 3256 3257
    RETURN();
}

void OPPROTO op_efdmul (void)
{
3258 3259 3260 3261 3262
    CPU_DoubleU u1, u2;
    u1.ll = T0_64;
    u2.ll = T1_64;
    u1.d = float64_mul(u1.d, u2.d, &env->spe_status);
    T0_64 = u1.ll;
3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378
    RETURN();
}

void OPPROTO op_efdctsidz (void)
{
    do_efdctsiz();
    RETURN();
}

void OPPROTO op_efdctuidz (void)
{
    do_efdctuiz();
    RETURN();
}

void OPPROTO op_efdcmplt (void)
{
    do_efdcmplt();
    RETURN();
}

void OPPROTO op_efdcmpgt (void)
{
    do_efdcmpgt();
    RETURN();
}

void OPPROTO op_efdcfs (void)
{
    do_efdcfs();
    RETURN();
}

void OPPROTO op_efdcmpeq (void)
{
    do_efdcmpeq();
    RETURN();
}

void OPPROTO op_efdcfsi (void)
{
    do_efdcfsi();
    RETURN();
}

void OPPROTO op_efdcfui (void)
{
    do_efdcfui();
    RETURN();
}

void OPPROTO op_efdcfsf (void)
{
    do_efdcfsf();
    RETURN();
}

void OPPROTO op_efdcfuf (void)
{
    do_efdcfuf();
    RETURN();
}

void OPPROTO op_efdctsi (void)
{
    do_efdctsi();
    RETURN();
}

void OPPROTO op_efdctui (void)
{
    do_efdctui();
    RETURN();
}

void OPPROTO op_efdctsf (void)
{
    do_efdctsf();
    RETURN();
}

void OPPROTO op_efdctuf (void)
{
    do_efdctuf();
    RETURN();
}

void OPPROTO op_efdctuiz (void)
{
    do_efdctuiz();
    RETURN();
}

void OPPROTO op_efdctsiz (void)
{
    do_efdctsiz();
    RETURN();
}

void OPPROTO op_efdtstlt (void)
{
    T0 = _do_efdtstlt(T0_64, T1_64);
    RETURN();
}

void OPPROTO op_efdtstgt (void)
{
    T0 = _do_efdtstgt(T0_64, T1_64);
    RETURN();
}

void OPPROTO op_efdtsteq (void)
{
    T0 = _do_efdtsteq(T0_64, T1_64);
    RETURN();
}
反馈
建议
客服 返回
顶部