benilla-re systems structs docs

SoftFloatAdd

function · cmath · primitive

Address
0x760e20 · 279 bytes, up to 0x760f36
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.

routineresult
0x761260 int to float0 for 0; else sign, exponent from the top set bit, the magnitude shifted to 24 bits, low bits dropped
0x760be0 multiplywith 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 addthe 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 floorexact for finite inputs; under 1 in magnitude, −1.0 for a negative nonzero value, else +0.0
0x761040 ceilexact 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

Callees 0

None by a direct call or jump.

Calls and jumps by a bare address, from tables/calls.tsv.