SoftFloatFromInt
function · cmath · primitive
- Address
0x761260· 112 bytes, up to0x7612cf- Signature
float * __fastcall (float *out, int32_t value)- Meaning
- Converts an integer to a float with integer instructions, dropping bits below the 24th
- Confidence
- verified, proof one
- Finding
- spell/records#software-floats
Finding: Software floats in spell: records
Five routines compute on single-precision bit patterns with integer instructions. They have no case for infinity or NaN, and none checks exponent overflow.
| routine | result |
|---|---|
0x761260 int to float | 0 for 0; else sign, exponent from the top set bit, the magnitude shifted to 24 bits, low bits dropped |
0x760be0 multiply | with either fraction 0: 0 if either exponent is 0, else the exponent sum with the other fraction; else the high word of the two left-aligned 24-bit significands, truncated; either way 0 when the exponent sum less the bias, before any carry, is below 1 |
0x760e20 add | the other operand when an exponent is 0; the larger when exponents differ by 23 or more; else two's-complement significands with a guard bit, the smaller sar-aligned, summed, renormalized by shifts, truncated; a zero sum is +0 |
0x760fb0 floor | exact for finite inputs; under 1 in magnitude, −1.0 for a negative nonzero value, else +0.0 |
0x761040 ceil | exact for finite inputs; under 1 in magnitude, +0.0 for a negative nonzero value, else 1.0, zero included |
The derivation is in the doc.
Callers 65
- GetSpellEffectPoints spell
- ApplySpellModifierSoftFloat spell
- 0x760a50 unassigned
- 0x760ac0 unassigned
- 0x760b70 unassigned
- 0x760bb0 unassigned
- 0x761320 cmath
- 0x7614b0 cmath
- 0x761610 cmath
- 0x761b40 cmath
- 0x761c00 cmath
- 0x761cc0 cmath
- 0x761e60 cmath
- 0x762000 cmath
- 0x7624a0 cmath
- InitSoftFloatMinusOne cmath
- InitSoftFloatZero cmath
- InitSoftFloatOne cmath
- 0x762f20 unassigned
- 0x762fa0 unassigned
- 0x762fe0 unassigned
- 0x763020 unassigned
- 0x763060 unassigned
- 0x7630a0 unassigned
- 0x7630e0 unassigned
- 0x763120 unassigned
- 0x763160 unassigned
- 0x7631a0 unassigned
- 0x7631e0 unassigned
- 0x763220 unassigned
- 0x763260 unassigned
- 0x7632a0 unassigned
- 0x7632e0 unassigned
- 0x763320 unassigned
- 0x763360 unassigned
- 0x7633a0 unassigned
- 0x7633e0 unassigned
- 0x763420 unassigned
- 0x763460 unassigned
- 0x7634a0 unassigned
- 0x7634e0 unassigned
- 0x763520 unassigned
- 0x763560 unassigned
- 0x7635a0 unassigned
- 0x7635e0 unassigned
- 0x763620 unassigned
- 0x763660 unassigned
- 0x7636a0 unassigned
- 0x7636e0 unassigned
- 0x763720 unassigned
- 0x763760 unassigned
- 0x7637a0 unassigned
- 0x7637e0 unassigned
- 0x763820 unassigned
- 0x763860 unassigned
- 0x7638a0 unassigned
- 0x7638e0 unassigned
- 0x763920 unassigned
- 0x763960 unassigned
- 0x7639a0 unassigned
- 0x7639e0 unassigned
- 0x763a20 unassigned
- 0x763a60 unassigned
- 0x763aa0 unassigned
- 0x763ae0 unassigned
Callees 0
None by a direct call or jump.
Calls and jumps by a bare address, from tables/calls.tsv.