/* 0F 0F /r 0D */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PI2FD_PqQq(bxInstruction_c *i) { BxPackedMmxRegister result, op; BX_CPU_THIS_PTR prepareMMX(); /* op is a register or memory reference */ if (i->modC0()) { op = BX_READ_MMX_REG(i->rm()); } else { BX_CPU_CALL_METHODR(i->ResolveModrm, (i)); /* pointer, segment address pair */ MMXUQ(op) = read_virtual_qword(i->seg(), RMAddr(i)); } float_status_t status_word; prepare_softfloat_status_word(status_word, float_round_to_zero); MMXUD0(result) = int32_to_float32(MMXSD0(op), status_word); MMXUD1(result) = int32_to_float32(MMXSD1(op), status_word); /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); }
uint32_t helper_flt(CPUMBState *env, uint32_t a) { CPU_FloatU fd, fa; fa.l = a; fd.f = int32_to_float32(fa.l, &env->fp_status); return fd.l; }
float32 helper_float_FT(CPUSH4State *env, uint32_t t0) { float32 ret; set_float_exception_flags(0, &env->fp_status); ret = int32_to_float32(t0, &env->fp_status); update_fpscr(env, GETPC()); return ret; }
unsigned int PerformFLT(const unsigned int opcode) { FPA11 *fpa11 = GET_FPA11(); struct roundingData roundData; roundData.mode = SetRoundingMode(opcode); roundData.precision = SetRoundingPrecision(opcode); roundData.exception = 0; switch (opcode & MASK_ROUNDING_PRECISION) { case ROUND_SINGLE: { fpa11->fType[getFn(opcode)] = typeSingle; fpa11->fpreg[getFn(opcode)].fSingle = int32_to_float32(&roundData, readRegister(getRd(opcode))); } break; case ROUND_DOUBLE: { fpa11->fType[getFn(opcode)] = typeDouble; fpa11->fpreg[getFn(opcode)].fDouble = int32_to_float64(readRegister(getRd(opcode))); } break; #ifdef CONFIG_FPE_NWFPE_XP case ROUND_EXTENDED: { fpa11->fType[getFn(opcode)] = typeExtended; fpa11->fpreg[getFn(opcode)].fExtended = int32_to_floatx80(readRegister(getRd(opcode))); } break; #endif default: return 0; } if (roundData.exception) float_raise(roundData.exception); return 1; }
/* convert 32-bit int to 32-bit float */ void HELPER(cefbr)(CPUS390XState *env, uint32_t f1, int32_t v2) { env->fregs[f1].l.upper = int32_to_float32(v2, &env->fpu_status); HELPER_LOG("%s: converting %d to 0x%d in f%d\n", __func__, v2, env->fregs[f1].l.upper, f1); }
float32 HELPER(itof)(CPUXtensaState *env, uint32_t v, uint32_t scale) { return float32_scalbn(int32_to_float32(v, &env->fp_status), (int32_t)scale, &env->fp_status); }
uint32_t helper_float_FT(uint32_t t0) { CPU_FloatU f; f.f = int32_to_float32(t0, &env->fp_status); return f.l; }
float32 __floatsisf(int I) { return int32_to_float32(I); }
float32 __aeabi_i2f(int a) { return int32_to_float32(a); }