benilla-re systems structs docs

FTMulFix

function · unassigned · primitive

Address
0x7cd0e0 · 115 bytes, up to 0x7cd152
Signature
int32_t __fastcall (int32_t a, int32_t b)
Meaning
Returns a times b over 65536, rounded for small operands and truncated above them
Confidence
verified, proof one
Finding
font/freetype#fixed-point-multiply
Test
font::mul_fix_difftest

Finding: Fixed-point multiply in font: the FreeType calls

FT_MulFix(a, b) returns a when a is 0 or b is 0x10000. Otherwise it multiplies the magnitudes and gives the result the sign of a ^ b. With |a| at most 0x800 and |b| at most 0x100000 the product rounds, (|a|·|b| + 0x8000) >> 16. Above either bound it truncates: ((|b| & 0xffff)·(|a| & 0xffff) >> 16) + (|b| >> 16)·(|a| & 0xffff) + (|a| >> 16)·|b|, in 32 bits. FT_Vector_Transform applies a 16.16 matrix with it.

The derivation is in the doc.

Callers 18

Callees 0

None by a direct call or jump.

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