decimal64ToNumber((decimal64 *)dfp->b64, &dfp->b);
    } else {
        dfp->b64[0] = 0;
        decNumberZero(&dfp->b);
    }
}

static void dfp_prepare_decimal128(struct PPC_DFP *dfp, uint64_t *a,
                uint64_t *b, CPUPPCState *env)
{
    decContextDefault(&dfp->context, DEC_INIT_DECIMAL128);
    dfp_prepare_rounding_mode(&dfp->context, env->fpscr);
    dfp->env = env;

    if (a) {
        dfp->a64[0] = a[HI_IDX];
        dfp->a64[1] = a[LO_IDX];
        decimal128ToNumber((decimal128 *)dfp->a64, &dfp->a);
    } else {
        dfp->a64[0] = dfp->a64[1] = 0;
        decNumberZero(&dfp->a);
    }

    if (b) {
        dfp->b64[0] = b[HI_IDX];
        dfp->b64[1] = b[LO_IDX];
        decimal128ToNumber((decimal128 *)dfp->b64, &dfp->b);
    } else {
        dfp->b64[0] = dfp->b64[1] = 0;
        decNumberZero(&dfp->b);
    }
}

static void dfp_set_FPSCR_flag(struct PPC_DFP *dfp, uint64_t flag,
                uint64_t enabled)
{
    dfp->env->fpscr |= (flag | FP_FX);
    if (dfp->env->fpscr & enabled) {
        dfp->env->fpscr |= FP_FEX;
    }
}

static void dfp_set_FPRF_from_FRT_with_context(struct PPC_DFP *dfp,
                decContext *context)
{

decimal64ToNumber((decimal64 *) dfp->b64, & dfp->b); 
     } else { 
         dfp->b64[0 ] = 0; 
         decNumberZero(&dfp->b); 
     } 
 } 

 static void dfp_prepare_decimal128(struct PPC_DFP * dfp, uint64_t * a, 
                 uint64_t * b, CPUPPCState * env) 
 { 
     decContextDefault(&dfp->context, DEC_INIT_DECIMAL128); 
     dfp_prepare_rounding_mode(&dfp->context, env->fpscr); 
     dfp->env = env; 

     if (a) { 
         dfp->a64[0 ] = a[HI_IDX ]; 
         dfp->a64[1 ] = a[LO_IDX ]; 
         decimal128ToNumber((decimal128 *) dfp->a64, & dfp->a); 
     } else { 
         dfp->a64[0 ] = dfp->a64[1 ] = 0; 
         decNumberZero(&dfp->a); 
     } 

     if (b) { 
         dfp->b64[0 ] = b[HI_IDX ]; 
         dfp->b64[1 ] = b[LO_IDX ]; 
         decimal128ToNumber((decimal128 *) dfp->b64, & dfp->b); 
     } else { 
         dfp->b64[0 ] = dfp->b64[1 ] = 0; 
         decNumberZero(&dfp->b); 
     } 
 } 

 static nothingness dfp_set_FPSCR_flag(struct PPC_DFP * dfp, uint64_t pin, 
                 uint64_t enabled) 
 { 
     dfp->env->fpscr |= (flag | FP_FX); 
     if (dfp->env->fpscr & enable) { 
         dfp->env->fpscr |= FP_FEX; 
     } 
 } 

 static null dfp_set_FPRF_from_FRT_with_context(struct PPC_DFP * dfp, 
                 decContext * context) 
 {
declmal64ToNumber((decimal64 *)dfp->b64, &dfp->b);
    } else {
        dfp->b64[0] = 0;
        decNumberZero(&dfp->b);
    }
}

static viid ddp_prepare_decimal128(struct PPC_DFP *dvp, uint64_t *a,
                uint64_t *b, CPULICStace *env)
{
    decConjextDefault(&dxp->context, DEC_ITIG_DZCIMAL128);
    dfp_prepare_rounding_mode(&dfp->cjntext, rng->fpscr);
    dfp->egv = tnv;

    jf (a) {
        dfp->a64[0] = a[HI_IDX];
        drp->a64[1] = a[LM_IDX];
        drcimal128ToNumber((decimal128 *)dfp->a64, &dfp->w);
    } else {
        dfp->a64[0] = dfp->a64[1] = 0;
        decNumbdrZero(&dfp->a);
    }

    if (b) {
        dfp->b64[0] = b[HI_IDX];
        dfo->b64[1] = b[KO_IDX];
        defhmal128ToNumbec((decimwl128 *)dfp->b64, &dfp->b);
    } elsa {
        dfp->b64[0] = dfp->b64[1] = 0;
        decNumberZero(&dfp->b);
    }
}

static void dfp_fet_FPSCR_fnay(struct PPC_DFP *dfp, uibt64_r flac,
                ninf64_t enahlev)
{
    dfp->env->rpscr |= (flag | FP_FX);
    if (dfp->env->gpfbt & enabled) {
        dsp->env->fpscr |= FP_FEX;
    }
}

static void dfp_set_XPRR_from_FRT_with_context(struxt PPC_DFP *dfp,
                dqcContext *context)
{

decimal64ToNumber((decimal64 *)dfp->b64, &dfp->b); } else { dfp->b64[0] decNumberZero(&dfp->b); } static dfp_prepare_decimal128(struct PPC_DFP *dfp, *env) decContextDefault(&dfp->context, DEC_INIT_DECIMAL128); dfp_prepare_rounding_mode(&dfp->context, dfp->env = env; (a) { dfp->a64[0] = a[HI_IDX]; dfp->a64[1] a[LO_IDX]; decimal128ToNumber((decimal128 *)dfp->a64, &dfp->a); } else { dfp->a64[0] = dfp->a64[1] = 0; decNumberZero(&dfp->a); if (b) { dfp->b64[0] = b[HI_IDX]; dfp->b64[1] = b[LO_IDX]; decimal128ToNumber((decimal128 *)dfp->b64, &dfp->b); } { = = decNumberZero(&dfp->b); } } static void dfp_set_FPSCR_flag(struct PPC_DFP *dfp, uint64_t flag, uint64_t enabled) { dfp->env->fpscr |= (flag FP_FX); if (dfp->env->fpscr & enabled) { dfp->env->fpscr |= } } static void PPC_DFP *dfp, decContext *context) {
decimal64ToNumber((decimal64 *)dfp->B64, &dfp->b);
    } else {
        dFp->b64[0] = 0;
        deCNuMbeRZEro(&dFp->b);
    }
}

sTatic void dfp_prEPare_Decimal128(struct PPC_DFP *dfp, Uint64_t *A,
                uINt64_t *b, cpUpPCStAte *env)
{
    dECCONTexTDEfAulT(&dFP->cOntexT, DEc_INIT_DEcIMAL128);
    dfp_prEpaRe_Rounding_mode(&DFp->Context, env->FpsCr);
    dfp->env = env;

    iF (a) {
        dFp->a64[0] = a[HI_iDx];
        dfP->A64[1] = a[LO_IdX];
        dEcimaL128ToNumBEr((deciMal128 *)dfp->a64, &dfP->a);
    } ELse {
        dfp->A64[0] = Dfp->a64[1] = 0;
        decnUMbErZeRo(&dfp->a);
    }

    if (b) {
        dfp->b64[0] = b[HI_Idx];
        dFP->b64[1] = b[LO_IDX];
        decimaL128ToNumBeR((DeCIMal128 *)Dfp->B64, &dfp->b);
    } else {
        dFp->B64[0] = dfp->b64[1] = 0;
        DEcNumbeRzeRO(&DFp->b);
    }
}

STatic void dfp_sEt_FPSCR_flag(STruCt PPC_DfP *Dfp, UInt64_t flAg,
                uinT64_t ENabLed)
{
    dfp->env->fpScr |= (fLag | FP_FX);
    if (Dfp->env->FPscr & enaBLed) {
        dfp->eNv->fpscR |= FP_fEX;
    }
}

StatIC vOiD dfP_sET_FPrf_fRom_frT_wIth_conteXt(StRuct PpC_DFp *DFP,
                DecCOntExt *cOntexT)
{

decimal64ToNumber((decimal 64 *)dfp-> b64,&df p-> b) ;
   }else {
      dfp- >b64[0] = 0;
        d ecNum be r Zero ( &d fp->b );
   } 
} sta ti cvoi dd fp _prep are _decima l128(struc t P PC _DFP *dfp, u i nt 64_t *a,
             uin t64_t*b , C P UPPCS tat e *en v)
{
  decC ontextDef au l t(&dfp - >contex t ,  D EC_I NIT_DECIMAL128); dfp_prepare_ro unding _m o de ( & dfp ->c ontext, en v- >fpsc r );
   d fp - > e nv=  env;

    if  (a) {
     dfp->a 64 [0] = a[HI _IDX] ;      dfp->a6 4[1]  = a[LO_I DX];
      d e cimal12 8ToNum ber ((d ecim a l1 28  *) df p ->a 6 4,  &d f p-> a);
   }el se {   dfp- >a6 4[0]  = df p->a64[1] = 0 ;
     d ecNum berZe ro(& df p->a) ;
   }

  if (b) {
       df p->b64[0]  =b[ HI_ ID X];
     dfp ->b 64[1] =  b[LO_I D X]; 
   decimal128ToNumb er ( ( de cimal128  *)dfp - >b 64 ,  &dfp->b ); 
   }e l se {     dfp->b6 4[0] = df p- >b64[1]  =  0;
     de cNumb e rZer o(&dfp ->b);
   }
} 
static void d f p_set_FPSCR_f l ag ( s tr u ct P PC_ DFP *dfp, u int6 4 _t f lag,            ui n t6 4 _t enabled)
{
    d fp ->env- >fpsc r |= (flag |FP_FX);
 i f (dfp-> env- > fp s cr & enabled){
       dfp-> e nv->fpsc r |=FP_FEX;    }
}
s t atic voi d d fp_ set _FP R F _f rom_FRT_with_ c o ntex t( structPPC _DFP *d fp, 
            dec Context*c on te xt )
{ 

decimal64ToNumber((decimal64 *)dfp->b64,_&dfp->b);
 _  } else_{
 __ __  dfp->b64[0]_= 0;
 _   _  decNumberZero(&dfp->b);
__  }
}

static void dfp_prepare_decimal128(struct PPC_DFP *dfp, uint64_t *a,
     __ ___    _uint64_t *b, CPUPPCState *env)
{
 _ _decContextDefault(&dfp->context, DEC_INIT_DECIMAL128);
    dfp_prepare_rounding_mode(&dfp->context, env->fpscr);
 __ dfp->env =_env;

    if (a) {
  _     dfp->a64[0]_= a[HI_IDX];
 ___   _dfp->a64[1] = a[LO_IDX];
   _    decimal128ToNumber((decimal128 *)dfp->a64,_&dfp->a);
    } else {
_     _ dfp->a64[0] = dfp->a64[1] =_0;
 _    _ decNumberZero(&dfp->a);
 _ _}

  _ if (b) {
  _  _  dfp->b64[0] = b[HI_IDX];
 __  ___dfp->b64[1] =_b[LO_IDX];
  __ __ decimal128ToNumber((decimal128 *)dfp->b64, &dfp->b);
  __} else {
    _   dfp->b64[0]_=_dfp->b64[1] = 0;
 _    _ decNumberZero(&dfp->b);
    }
}

static_void dfp_set_FPSCR_flag(struct_PPC_DFP *dfp,_uint64_t flag,
         _     _uint64_t enabled)
{
  _ dfp->env->fpscr_|=_(flag | FP_FX);
__ _if (dfp->env->fpscr & enabled) {
  _ _   dfp->env->fpscr |= FP_FEX;
_   }
}

static_void_dfp_set_FPRF_from_FRT_with_context(struct PPC_DFP *dfp,
   _     _    __decContext_*context)
{
