Rev 1964 | Rev 4103 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1964 | Rev 3031 | ||
---|---|---|---|
Line 35... | Line 35... | ||
35 | #define dfixed_const_8(A) (u32)(((A) << 12) + 3277) |
35 | #define dfixed_const_8(A) (u32)(((A) << 12) + 3277) |
36 | #define dfixed_mul(A, B) ((u64)((u64)(A).full * (B).full + 2048) >> 12) |
36 | #define dfixed_mul(A, B) ((u64)((u64)(A).full * (B).full + 2048) >> 12) |
37 | #define dfixed_init(A) { .full = dfixed_const((A)) } |
37 | #define dfixed_init(A) { .full = dfixed_const((A)) } |
38 | #define dfixed_init_half(A) { .full = dfixed_const_half((A)) } |
38 | #define dfixed_init_half(A) { .full = dfixed_const_half((A)) } |
39 | #define dfixed_trunc(A) ((A).full >> 12) |
39 | #define dfixed_trunc(A) ((A).full >> 12) |
- | 40 | #define dfixed_frac(A) ((A).full & ((1 << 12) - 1)) |
|
Line 40... | Line 41... | ||
40 | 41 | ||
41 | static inline u32 dfixed_floor(fixed20_12 A) |
42 | static inline u32 dfixed_floor(fixed20_12 A) |
42 | { |
43 | { |