8x8 bit multiplication with 8-bit result, saturating at 0xFF.
- Parameters
-
i | first byte to multiply |
j | second byte to multiply |
- Returns
- the product of i * j, capping at 0xFF
Definition at line 470 of file math8.h.
470 {
471#if QMUL8_C == 1
472 unsigned p = (unsigned)i * (
unsigned)j;
476#elif QMUL8_AVRASM == 1
477 asm volatile(
478
479 " mul %0, %1 \n\t"
480
481 " mov %0, r0 \n\t"
482
483 " tst r1 \n\t"
484 " breq Lnospill_%= \n\t"
485
486 " ldi %0, 0xFF \n\t"
487 "Lnospill_%=: \n\t"
488
489 " clr __zero_reg__ \n\t"
490 : "+d"(i)
491 : "r"(j)
492 : "r0", "r1");
493 return i;
494#else
495#error "No implementation for qmul8 available."
496#endif
497}
static FASTLED_NAMESPACE_BEGIN uint8_t const p[]
References LIB8STATIC_ALWAYS_INLINE, and p.
Referenced by operator*(), and CRGB::operator*=().