SoftFloatAdd
function · cmath · primitive
- Address
0x760e20· 279 bytes, up to0x760f36- Signature
float * __fastcall (float *out, const float *a, const float *b)- Meaning
- Adds two floats with integer instructions, aligning by arithmetic shifts and truncating
- 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 10
- GetSpellEffectPoints spell
- ApplySpellModifierSoftFloat spell
- SoftFloatRoundHalfUp cmath
- 0x761190 cmath
- 0x761610 cmath
- 0x761690 cmath
- 0x761710 cmath
- 0x761830 cmath
- 0x762000 cmath
- 0x7621b0 cmath
Callees 0
None by a direct call or jump.
Calls and jumps by a bare address, from tables/calls.tsv.