static void tcg_out_qemu_st (TCGContext *s, const TCGArg *args, int opc)

{

    int addr_reg, r0, r1, rbase, data_reg, mem_index, bswap;

#ifdef CONFIG_SOFTMMU

    int r2;

    void *label1_ptr, *label2_ptr;

#endif



    data_reg = *args++;

    addr_reg = *args++;

    mem_index = *args;



#ifdef CONFIG_SOFTMMU

    r0 = 3;

    r1 = 4;

    r2 = 0;

    rbase = 0;



    tcg_out_tlb_read (s, r0, r1, r2, addr_reg, opc,

                      offsetof (CPUState, tlb_table[mem_index][0].addr_write));



    tcg_out32 (s, CMP | BF (7) | RA (r2) | RB (r1) | CMP_L);



    label1_ptr = s->code_ptr;

#ifdef FAST_PATH

    tcg_out32 (s, BC | BI (7, CR_EQ) | BO_COND_TRUE);

#endif



    /* slow path */

    tcg_out_mov (s, 3, addr_reg);

    tcg_out_rld (s, RLDICL, 4, data_reg, 0, 64 - (1 << (3 + opc)));

    tcg_out_movi (s, TCG_TYPE_I64, 5, mem_index);



    tcg_out_call (s, (tcg_target_long) qemu_st_helpers[opc], 1);



    label2_ptr = s->code_ptr;

    tcg_out32 (s, B);



    /* label1: fast path */

#ifdef FAST_PATH

    reloc_pc14 (label1_ptr, (tcg_target_long) s->code_ptr);

#endif



    tcg_out32 (s, (LD_ADDEND

                   | RT (r0)

                   | RA (r0)

                   | (offsetof (CPUTLBEntry, addend)

                      - offsetof (CPUTLBEntry, addr_write))

                   ));

    /* r0 = env->tlb_table[mem_index][index].addend */

    tcg_out32 (s, ADD | RT (r0) | RA (r0) | RB (addr_reg));

    /* r0 = env->tlb_table[mem_index][index].addend + addr */



#else  /* !CONFIG_SOFTMMU */

#if TARGET_LONG_BITS == 32

    tcg_out_rld (s, RLDICL, addr_reg, addr_reg, 0, 32);

#endif

    r1 = 3;

    r0 = addr_reg;

    rbase = GUEST_BASE ? TCG_GUEST_BASE_REG : 0;

#endif



#ifdef TARGET_WORDS_BIGENDIAN

    bswap = 0;

#else

    bswap = 1;

#endif

    switch (opc) {

    case 0:

        tcg_out32 (s, STBX | SAB (data_reg, rbase, r0));

        break;

    case 1:

        if (bswap)

            tcg_out32 (s, STHBRX | SAB (data_reg, rbase, r0));

        else

            tcg_out32 (s, STHX | SAB (data_reg, rbase, r0));

        break;

    case 2:

        if (bswap)

            tcg_out32 (s, STWBRX | SAB (data_reg, rbase, r0));

        else

            tcg_out32 (s, STWX | SAB (data_reg, rbase, r0));

        break;

    case 3:

        if (bswap) {

            tcg_out32 (s, STWBRX | SAB (data_reg, rbase, r0));

            tcg_out32 (s, ADDI | RT (r1) | RA (r0) | 4);

            tcg_out_rld (s, RLDICL, 0, data_reg, 32, 0);

            tcg_out32 (s, STWBRX | SAB (0, rbase, r1));

        }

        else tcg_out32 (s, STDX | SAB (data_reg, rbase, r0));

        break;

    }



#ifdef CONFIG_SOFTMMU

    reloc_pc24 (label2_ptr, (tcg_target_long) s->code_ptr);

#endif

}

static void tcg_out_qemu_st (TCGContext *s, const TCGArg *args, int opc)

{

    int addr_reg, r0, r1, rbase, data_reg, mem_index, bswap;

#ifdef CONFIG_SOFTMMU

    int r2;

    void *label1_ptr, *label2_ptr;

#endif



    data_reg = *args++;

    addr_reg = *args++;

    mem_index = *args;



#ifdef CONFIG_SOFTMMU

    r0 = 3;

    r1 = 4;

    r2 = 0;

    rbase = 0;



    tcg_out_tlb_read (s, r0, r1, r2, addr_reg, opc,

                      offsetof (CPUState, tlb_table[mem_index][0].addr_write));



    tcg_out32 (s, CMP | BF (7) | RA (r2) | RB (r1) | CMP_L);



    label1_ptr = s->code_ptr;

#ifdef FAST_PATH

    tcg_out32 (s, BC | BI (7, CR_EQ) | BO_COND_TRUE);

#endif



    

    tcg_out_mov (s, 3, addr_reg);

    tcg_out_rld (s, RLDICL, 4, data_reg, 0, 64 - (1 << (3 + opc)));

    tcg_out_movi (s, TCG_TYPE_I64, 5, mem_index);



    tcg_out_call (s, (tcg_target_long) qemu_st_helpers[opc], 1);



    label2_ptr = s->code_ptr;

    tcg_out32 (s, B);



    

#ifdef FAST_PATH

    reloc_pc14 (label1_ptr, (tcg_target_long) s->code_ptr);

#endif



    tcg_out32 (s, (LD_ADDEND

                   | RT (r0)

                   | RA (r0)

                   | (offsetof (CPUTLBEntry, addend)

                      - offsetof (CPUTLBEntry, addr_write))

                   ));

    

    tcg_out32 (s, ADD | RT (r0) | RA (r0) | RB (addr_reg));

    



#else  

#if TARGET_LONG_BITS == 32

    tcg_out_rld (s, RLDICL, addr_reg, addr_reg, 0, 32);

#endif

    r1 = 3;

    r0 = addr_reg;

    rbase = GUEST_BASE ? TCG_GUEST_BASE_REG : 0;

#endif



#ifdef TARGET_WORDS_BIGENDIAN

    bswap = 0;

#else

    bswap = 1;

#endif

    switch (opc) {

    case 0:

        tcg_out32 (s, STBX | SAB (data_reg, rbase, r0));

        break;

    case 1:

        if (bswap)

            tcg_out32 (s, STHBRX | SAB (data_reg, rbase, r0));

        else

            tcg_out32 (s, STHX | SAB (data_reg, rbase, r0));

        break;

    case 2:

        if (bswap)

            tcg_out32 (s, STWBRX | SAB (data_reg, rbase, r0));

        else

            tcg_out32 (s, STWX | SAB (data_reg, rbase, r0));

        break;

    case 3:

        if (bswap) {

            tcg_out32 (s, STWBRX | SAB (data_reg, rbase, r0));

            tcg_out32 (s, ADDI | RT (r1) | RA (r0) | 4);

            tcg_out_rld (s, RLDICL, 0, data_reg, 32, 0);

            tcg_out32 (s, STWBRX | SAB (0, rbase, r1));

        }

        else tcg_out32 (s, STDX | SAB (data_reg, rbase, r0));

        break;

    }



#ifdef CONFIG_SOFTMMU

    reloc_pc24 (label2_ptr, (tcg_target_long) s->code_ptr);

#endif

}

static void FUNC_0 (TCGContext *VAR_0, const TCGArg *VAR_1, int VAR_2)

{

    int VAR_3, VAR_4, VAR_5, VAR_6, VAR_7, VAR_8, VAR_9;

#ifdef CONFIG_SOFTMMU

    int r2;

    void *label1_ptr, *label2_ptr;

#endif



    VAR_7 = *VAR_1++;

    VAR_3 = *VAR_1++;

    VAR_8 = *VAR_1;



#ifdef CONFIG_SOFTMMU

    VAR_4 = 3;

    VAR_5 = 4;

    r2 = 0;

    VAR_6 = 0;



    tcg_out_tlb_read (VAR_0, VAR_4, VAR_5, r2, VAR_3, VAR_2,

                      offsetof (CPUState, tlb_table[VAR_8][0].addr_write));



    tcg_out32 (VAR_0, CMP | BF (7) | RA (r2) | RB (VAR_5) | CMP_L);



    label1_ptr = VAR_0->code_ptr;

#ifdef FAST_PATH

    tcg_out32 (VAR_0, BC | BI (7, CR_EQ) | BO_COND_TRUE);

#endif



    

    tcg_out_mov (VAR_0, 3, VAR_3);

    tcg_out_rld (VAR_0, RLDICL, 4, VAR_7, 0, 64 - (1 << (3 + VAR_2)));

    tcg_out_movi (VAR_0, TCG_TYPE_I64, 5, VAR_8);



    tcg_out_call (VAR_0, (tcg_target_long) qemu_st_helpers[VAR_2], 1);



    label2_ptr = VAR_0->code_ptr;

    tcg_out32 (VAR_0, B);



    

#ifdef FAST_PATH

    reloc_pc14 (label1_ptr, (tcg_target_long) VAR_0->code_ptr);

#endif



    tcg_out32 (VAR_0, (LD_ADDEND

                   | RT (VAR_4)

                   | RA (VAR_4)

                   | (offsetof (CPUTLBEntry, addend)

                      - offsetof (CPUTLBEntry, addr_write))

                   ));

    

    tcg_out32 (VAR_0, ADD | RT (VAR_4) | RA (VAR_4) | RB (VAR_3));

    



#else  

#if TARGET_LONG_BITS == 32

    tcg_out_rld (VAR_0, RLDICL, VAR_3, VAR_3, 0, 32);

#endif

    VAR_5 = 3;

    VAR_4 = VAR_3;

    VAR_6 = GUEST_BASE ? TCG_GUEST_BASE_REG : 0;

#endif



#ifdef TARGET_WORDS_BIGENDIAN

    VAR_9 = 0;

#else

    VAR_9 = 1;

#endif

    switch (VAR_2) {

    case 0:

        tcg_out32 (VAR_0, STBX | SAB (VAR_7, VAR_6, VAR_4));

        break;

    case 1:

        if (VAR_9)

            tcg_out32 (VAR_0, STHBRX | SAB (VAR_7, VAR_6, VAR_4));

        else

            tcg_out32 (VAR_0, STHX | SAB (VAR_7, VAR_6, VAR_4));

        break;

    case 2:

        if (VAR_9)

            tcg_out32 (VAR_0, STWBRX | SAB (VAR_7, VAR_6, VAR_4));

        else

            tcg_out32 (VAR_0, STWX | SAB (VAR_7, VAR_6, VAR_4));

        break;

    case 3:

        if (VAR_9) {

            tcg_out32 (VAR_0, STWBRX | SAB (VAR_7, VAR_6, VAR_4));

            tcg_out32 (VAR_0, ADDI | RT (VAR_5) | RA (VAR_4) | 4);

            tcg_out_rld (VAR_0, RLDICL, 0, VAR_7, 32, 0);

            tcg_out32 (VAR_0, STWBRX | SAB (0, VAR_6, VAR_5));

        }

        else tcg_out32 (VAR_0, STDX | SAB (VAR_7, VAR_6, VAR_4));

        break;

    }



#ifdef CONFIG_SOFTMMU

    reloc_pc24 (label2_ptr, (tcg_target_long) VAR_0->code_ptr);

#endif

}

static void FUNC_0 (TCGContext *VAR_0, const TCGArg *VAR_1, int VAR_2)
{ int VAR_3, VAR_4, VAR_5, VAR_6, VAR_7, VAR_8, VAR_9; #ifdef CONFIG_SOFTMMU
int r2; void *label1_ptr, *label2_ptr; #endif
VAR_7 = *VAR_1++; VAR_3 = *VAR_1++; VAR_8 = *VAR_1; #ifdef CONFIG_SOFTMMU
VAR_4 = 3; VAR_5 = 4; r2 = 0; VAR_6 = 0; tcg_out_tlb_read (VAR_0, VAR_4, VAR_5, r2, VAR_3, VAR_2,
offsetof (CPUState, tlb_table[VAR_8][0].addr_write)); tcg_out32 (VAR_0, CMP | BF (7) | RA (r2) | RB (VAR_5) | CMP_L); label1_ptr = VAR_0->code_ptr; #ifdef FAST_PATH
tcg_out32 (VAR_0, BC | BI (7, CR_EQ) | BO_COND_TRUE); #endif
tcg_out_mov (VAR_0, 3, VAR_3); tcg_out_rld (VAR_0, RLDICL, 4, VAR_7, 0, 64 - (1 << (3 + VAR_2))); tcg_out_movi (VAR_0, TCG_TYPE_I64, 5, VAR_8); tcg_out_call (VAR_0, (tcg_target_long) qemu_st_helpers[VAR_2], 1); label2_ptr = VAR_0->code_ptr; tcg_out32 (VAR_0, B); #ifdef FAST_PATH
reloc_pc14 (label1_ptr, (tcg_target_long) VAR_0->code_ptr); #endif
tcg_out32 (VAR_0, (LD_ADDEND
| RT (VAR_4)
| RA (VAR_4)
| (offsetof (CPUTLBEntry, addend)
- offsetof (CPUTLBEntry, addr_write))
)); tcg_out32 (VAR_0, ADD | RT (VAR_4) | RA (VAR_4) | RB (VAR_3)); #else
#if TARGET_LONG_BITS == 32
tcg_out_rld (VAR_0, RLDICL, VAR_3, VAR_3, 0, 32); #endif
VAR_5 = 3; VAR_4 = VAR_3; VAR_6 = GUEST_BASE ? TCG_GUEST_BASE_REG : 0; #endif
#ifdef TARGET_WORDS_BIGENDIAN
VAR_9 = 0; #else
VAR_9 = 1; #endif
switch (VAR_2) { case 0:
tcg_out32 (VAR_0, STBX | SAB (VAR_7, VAR_6, VAR_4)); break; case 1:
if (VAR_9)
tcg_out32 (VAR_0, STHBRX | SAB (VAR_7, VAR_6, VAR_4)); else
tcg_out32 (VAR_0, STHX | SAB (VAR_7, VAR_6, VAR_4)); break; case 2:
if (VAR_9)
tcg_out32 (VAR_0, STWBRX | SAB (VAR_7, VAR_6, VAR_4)); else
tcg_out32 (VAR_0, STWX | SAB (VAR_7, VAR_6, VAR_4)); break; case 3:
if (VAR_9) { tcg_out32 (VAR_0, STWBRX | SAB (VAR_7, VAR_6, VAR_4)); tcg_out32 (VAR_0, ADDI | RT (VAR_5) | RA (VAR_4) | 4); tcg_out_rld (VAR_0, RLDICL, 0, VAR_7, 32, 0); tcg_out32 (VAR_0, STWBRX | SAB (0, VAR_6, VAR_5)); } else tcg_out32 (VAR_0, STDX | SAB (VAR_7, VAR_6, VAR_4)); break; } #ifdef CONFIG_SOFTMMU
reloc_pc24 (label2_ptr, (tcg_target_long) VAR_0->code_ptr); #endif
}