Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* calculate the 32-bit product of unsigned 16-bit value op16 and 32-bit value op32 */
- static inline uint32_t mul_16_32(uint16_t op16, uint32_t op32) \
- {
- unsigned t1, r;
- asm (
- "mulu %[a], %[b] \n"
- "swap.w %[b], %[b] \n"
- "sts macl, %[r] \n"
- "mulu %[a], %[b] \n"
- "sts macl, %[t1] \n"
- "shll16 %[t1] \n"
- "add %[t1], %[r] \n"
- : [r] "=&r" (r),
- [t1] "=r" (t1),
- : [a] "r" (op16),
- [b] "r" (op32),
- );
- return r;
- }
Add Comment
Please, Sign In to add comment