op.c 15.3 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
#if !defined(CONFIG_USER_ONLY)
/* Segment registers load and store */
31
void OPPROTO op_load_sr (void)
32
{
33
    T0 = env->sr[T1];
34 35 36
    RETURN();
}

37
void OPPROTO op_store_sr (void)
38 39 40 41 42
{
    do_store_sr(env, T1, T0);
    RETURN();
}

43 44 45 46 47 48 49 50 51 52 53 54 55 56
#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) */

57
void OPPROTO op_load_sdr1 (void)
58
{
59
    T0 = env->sdr1;
60 61 62
    RETURN();
}

63
void OPPROTO op_store_sdr1 (void)
64 65
{
    do_store_sdr1(env, T0);
B
bellard 已提交
66 67 68
    RETURN();
}

69 70 71 72 73 74 75 76 77 78 79 80 81 82
#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 已提交
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
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

104
void OPPROTO op_update_riee (void)
105
{
106 107 108 109 110 111
    /* 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;
112 113 114
    RETURN();
}
#endif
115 116

/* SPR */
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
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)
136
{
137
    ppc_store_dump_spr(PARAM1, T0);
138 139 140
    RETURN();
}

141
void OPPROTO op_mask_spr (void)
142
{
143
    env->spr[PARAM1] &= ~T0;
B
bellard 已提交
144 145 146
    RETURN();
}

147
void OPPROTO op_load_tbl (void)
148
{
149
    T0 = cpu_ppc_load_tbl(env);
150 151 152
    RETURN();
}

153
void OPPROTO op_load_tbu (void)
154
{
155
    T0 = cpu_ppc_load_tbu(env);
156 157 158
    RETURN();
}

159 160 161 162 163 164 165 166 167 168 169 170
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();
}

171
#if !defined(CONFIG_USER_ONLY)
172
void OPPROTO op_store_tbl (void)
173
{
174
    cpu_ppc_store_tbl(env, T0);
B
bellard 已提交
175 176 177
    RETURN();
}

178
void OPPROTO op_store_tbu (void)
179
{
180
    cpu_ppc_store_tbu(env, T0);
181 182 183
    RETURN();
}

184 185 186 187 188 189 190 191 192 193 194 195
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();
}

196
void OPPROTO op_load_decr (void)
197
{
198
    T0 = cpu_ppc_load_decr(env);
199 200
    RETURN();
}
201

202
void OPPROTO op_store_decr (void)
203
{
204
    cpu_ppc_store_decr(env, T0);
205 206 207
    RETURN();
}

208
void OPPROTO op_load_ibat (void)
209
{
210
    T0 = env->IBAT[PARAM1][PARAM2];
211
    RETURN();
212 213
}

214
void OPPROTO op_store_ibatu (void)
215
{
216 217 218 219
    do_store_ibatu(env, PARAM1, T0);
    RETURN();
}

220
void OPPROTO op_store_ibatl (void)
221 222 223 224 225 226 227
{
#if 1
    env->IBAT[1][PARAM1] = T0;
#else
    do_store_ibatl(env, PARAM1, T0);
#endif
    RETURN();
228 229
}

230
void OPPROTO op_load_dbat (void)
231
{
232
    T0 = env->DBAT[PARAM1][PARAM2];
233
    RETURN();
234 235
}

236
void OPPROTO op_store_dbatu (void)
237 238 239 240 241
{
    do_store_dbatu(env, PARAM1, T0);
    RETURN();
}

242
void OPPROTO op_store_dbatl (void)
243
{
244 245 246 247 248 249
#if 1
    env->DBAT[1][PARAM1] = T0;
#else
    do_store_dbatl(env, PARAM1, T0);
#endif
    RETURN();
250
}
251
#endif /* !defined(CONFIG_USER_ONLY) */
252

B
bellard 已提交
253
/***                             Integer shift                             ***/
254 255
void OPPROTO op_srli_T1 (void)
{
256
    T1 = (uint32_t)T1 >> PARAM1;
257 258 259
    RETURN();
}

260 261
/* Load and store */
#define MEMSUFFIX _raw
262
#include "op_helper.h"
263
#include "op_mem.h"
264
#if !defined(CONFIG_USER_ONLY)
265
#define MEMSUFFIX _user
266
#include "op_helper.h"
267 268
#include "op_mem.h"
#define MEMSUFFIX _kernel
269
#include "op_helper.h"
270
#include "op_mem.h"
271 272 273 274
#define MEMSUFFIX _hypv
#include "op_helper.h"
#include "op_mem.h"
#endif
275

B
bellard 已提交
276
/* Special op to check and maybe clear reservation */
277
void OPPROTO op_check_reservation (void)
B
bellard 已提交
278
{
279
    if ((uint32_t)env->reserve == (uint32_t)(T0 & ~0x00000003))
280
        env->reserve = (target_ulong)-1ULL;
B
bellard 已提交
281 282 283
    RETURN();
}

284 285 286 287
#if defined(TARGET_PPC64)
void OPPROTO op_check_reservation_64 (void)
{
    if ((uint64_t)env->reserve == (uint64_t)(T0 & ~0x00000003))
288
        env->reserve = (target_ulong)-1ULL;
289 290 291 292
    RETURN();
}
#endif

293 294 295 296 297 298
void OPPROTO op_wait (void)
{
    env->halted = 1;
    RETURN();
}

299
/* Return from interrupt */
300 301
#if !defined(CONFIG_USER_ONLY)
void OPPROTO op_rfi (void)
302
{
303
    do_rfi();
B
bellard 已提交
304 305
    RETURN();
}
306 307

#if defined(TARGET_PPC64)
J
j_mayer 已提交
308 309 310 311 312
void OPPROTO op_rfid (void)
{
    do_rfid();
    RETURN();
}
313 314 315 316 317 318 319

void OPPROTO op_hrfid (void)
{
    do_hrfid();
    RETURN();
}
#endif
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334

/* 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();
}
335
#endif
B
bellard 已提交
336

337
/* Trap word */
338
void OPPROTO op_tw (void)
B
bellard 已提交
339
{
340
    do_tw(PARAM1);
B
bellard 已提交
341 342 343
    RETURN();
}

344 345 346 347 348 349 350 351
#if defined(TARGET_PPC64)
void OPPROTO op_td (void)
{
    do_td(PARAM1);
    RETURN();
}
#endif

352
#if !defined(CONFIG_USER_ONLY)
353
/* tlbia */
354
void OPPROTO op_tlbia (void)
B
bellard 已提交
355
{
356
    ppc_tlb_invalidate_all(env);
357 358 359 360
    RETURN();
}

/* tlbie */
361
void OPPROTO op_tlbie (void)
362
{
363
    ppc_tlb_invalidate_one(env, (uint32_t)T0);
B
bellard 已提交
364
    RETURN();
365
}
366 367 368 369

#if defined(TARGET_PPC64)
void OPPROTO op_tlbie_64 (void)
{
370
    ppc_tlb_invalidate_one(env, T0);
371 372 373 374 375 376 377
    RETURN();
}
#endif

#if defined(TARGET_PPC64)
void OPPROTO op_slbia (void)
{
378
    ppc_slb_invalidate_all(env);
379 380 381 382 383
    RETURN();
}

void OPPROTO op_slbie (void)
{
384 385 386 387 388 389 390
    ppc_slb_invalidate_one(env, (uint32_t)T0);
    RETURN();
}

void OPPROTO op_slbie_64 (void)
{
    ppc_slb_invalidate_one(env, T0);
391 392 393
    RETURN();
}
#endif
394
#endif
395

396
#if !defined(CONFIG_USER_ONLY)
397
/* PowerPC 602/603/755 software TLB load instructions */
398 399 400 401 402 403 404 405 406 407 408
void OPPROTO op_6xx_tlbld (void)
{
    do_load_6xx_tlb(0);
    RETURN();
}

void OPPROTO op_6xx_tlbli (void)
{
    do_load_6xx_tlb(1);
    RETURN();
}
409 410 411 412 413 414 415 416 417 418 419 420 421

/* 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();
}
422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449
#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();
}

450 451 452 453 454 455
void OPPROTO op_store_hid0_601 (void)
{
    do_store_hid0_601();
    RETURN();
}

456 457 458 459 460 461 462 463
void OPPROTO op_load_601_bat (void)
{
    T0 = env->IBAT[PARAM1][PARAM2];
    RETURN();
}

void OPPROTO op_store_601_batl (void)
{
464
    do_store_ibatl_601(env, PARAM1, T0);
465 466 467 468 469
    RETURN();
}

void OPPROTO op_store_601_batu (void)
{
470
    do_store_ibatu_601(env, PARAM1, T0);
471 472 473 474 475 476 477 478
    RETURN();
}
#endif /* !defined(CONFIG_USER_ONLY) */

/* PowerPC 601 specific instructions (POWER bridge) */
/* XXX: those micro-ops need tests ! */
void OPPROTO op_POWER_abs (void)
{
J
j_mayer 已提交
479
    if ((int32_t)T0 == INT32_MIN)
480
        T0 = INT32_MAX;
J
j_mayer 已提交
481
    else if ((int32_t)T0 < 0)
482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523
        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)
{
524
    if ((int32_t)T1 > (int32_t)T0)
525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582
        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;
A
aurel32 已提交
583
    env->xer &= ~(1 << XER_OV);
584 585 586 587 588 589 590
    RETURN();
}

/* XXX: factorise POWER rotates... */
void OPPROTO op_POWER_rlmi (void)
{
    T0 = rotl32(T0, T2) & PARAM1;
591
    T0 |= T1 & (uint32_t)PARAM2;
592 593 594 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 621 622 623
    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)
{
624
    uint32_t msk = UINT32_MAX;
625 626 627 628 629 630 631 632 633 634 635 636

    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)
{
637
    uint32_t msk = UINT32_MAX, tmp;
638 639 640 641 642 643 644 645 646 647 648 649 650 651 652

    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)
653
        T0 = UINT32_MAX;
654
    else
655
        T0 = (int32_t)T0 >> T1;
656 657 658 659 660 661 662
    RETURN();
}

void OPPROTO op_POWER_sre (void)
{
    T1 &= 0x1FUL;
    env->spr[SPR_MQ] = rotl32(T0, 32 - T1);
663
    T0 = (int32_t)T0 >> T1;
664 665 666 667 668 669 670
    RETURN();
}

void OPPROTO op_POWER_srea (void)
{
    T1 &= 0x1FUL;
    env->spr[SPR_MQ] = T0 >> T1;
671
    T0 = (int32_t)T0 >> T1;
672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745
    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 */
746
void OPPROTO op_load_dcr (void)
747
{
748
    do_load_dcr();
749 750 751
    RETURN();
}

752
void OPPROTO op_store_dcr (void)
753
{
754
    do_store_dcr();
755 756 757
    RETURN();
}

758
#if !defined(CONFIG_USER_ONLY)
759 760 761
/* Return from critical interrupt :
 * same as rfi, except nip & MSR are loaded from SRR2/3 instead of SRR0/1
 */
762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780
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)
781
{
782
    do_rfmci();
783 784 785
    RETURN();
}

786
void OPPROTO op_wrte (void)
787
{
788 789 790 791 792 793
    /* 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;
794 795 796
    RETURN();
}

797
void OPPROTO op_440_tlbre (void)
798
{
799
    do_440_tlbre(PARAM1);
800 801 802
    RETURN();
}

803
void OPPROTO op_440_tlbsx (void)
804
{
805
    T0 = ppcemb_tlb_search(env, T0, env->spr[SPR_440_MMUCR] & 0xFF);
806 807 808
    RETURN();
}

809
void OPPROTO op_4xx_tlbsx_check (void)
810
{
811 812 813
    int tmp;

    tmp = xer_so;
814
    if ((int)T0 != -1)
815 816
        tmp |= 0x02;
    env->crf[0] = tmp;
817 818 819
    RETURN();
}

820
void OPPROTO op_440_tlbwe (void)
821
{
822
    do_440_tlbwe(PARAM1);
823 824 825
    RETURN();
}

826 827 828 829 830 831 832 833 834 835 836 837 838 839
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)
{
840
    T0 = ppcemb_tlb_search(env, T0, env->spr[SPR_40x_PID]);
841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877
    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)
878 879 880 881
{
    env->spr[SPR_PIR] = T0 & 0x0000000FUL;
    RETURN();
}
882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906

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();
}

907 908 909
void OPPROTO op_store_40x_dbcr0 (void)
{
    store_40x_dbcr0(env, T0);
910
    RETURN();
911 912
}

913 914 915 916 917 918
void OPPROTO op_store_40x_sler (void)
{
    store_40x_sler(env, T0);
    RETURN();
}

919 920 921 922 923 924 925 926 927 928 929 930
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) */
931 932 933 934 935

/* SPE extension */
void OPPROTO op_splatw_T1_64 (void)
{
    T1_64 = (T1_64 << 32) | (T1_64 & 0x00000000FFFFFFFFULL);
J
j_mayer 已提交
936
    RETURN();
937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963
}

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();
}