Go to the source code of this file.
◆ MultiU24X32toH16()
static FORCE_INLINE uint16_t MultiU24X32toH16 |
( |
uint32_t |
longIn1, |
|
|
uint32_t |
longIn2 |
|
) |
| |
|
static |
Marlin 3D Printer Firmware Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
Based on Sprinter and grbl. Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. Optimized math functions for AVR
44 A(
"mul %A[longIn1], %B[longIn2]")
46 A(
"mul %B[longIn1], %C[longIn2]")
47 A(
"movw %A[intRes], r0")
48 A(
"mul %C[longIn1], %C[longIn2]")
49 A(
"add %B[intRes], r0")
50 A(
"mul %C[longIn1], %B[longIn2]")
51 A(
"add %A[intRes], r0")
52 A(
"adc %B[intRes], r1")
53 A(
"mul %A[longIn1], %C[longIn2]")
55 A(
"adc %A[intRes], r1")
56 A(
"adc %B[intRes], %[tmp1]")
57 A(
"mul %B[longIn1], %B[longIn2]")
59 A(
"adc %A[intRes], r1")
60 A(
"adc %B[intRes], %[tmp1]")
61 A(
"mul %C[longIn1], %A[longIn2]")
63 A(
"adc %A[intRes], r1")
64 A(
"adc %B[intRes], %[tmp1]")
65 A(
"mul %B[longIn1], %A[longIn2]")
67 A(
"adc %A[intRes], %[tmp1]")
68 A(
"adc %B[intRes], %[tmp1]")
70 A(
"adc %A[intRes], %[tmp1]")
71 A(
"adc %B[intRes], %[tmp1]")
72 A(
"mul %D[longIn2], %A[longIn1]")
73 A(
"add %A[intRes], r0")
74 A(
"adc %B[intRes], r1")
75 A(
"mul %D[longIn2], %B[longIn1]")
76 A(
"add %B[intRes], r0")
78 : [intRes]
"=&r" (intRes),
81 : [longIn1]
"d" (longIn1),
82 [longIn2]
"d" (longIn2)
◆ MultiU16X8toH16()
95 __asm__ __volatile__ (
97 A(
"mul %[charIn1], %B[intIn2]")
98 A(
"movw %A[intRes], r0")
99 A(
"mul %[charIn1], %A[intIn2]")
100 A(
"add %A[intRes], r1")
101 A(
"adc %B[intRes], %[tmp]")
103 A(
"adc %A[intRes], %[tmp]")
104 A(
"adc %B[intRes], %[tmp]")
106 : [intRes]
"=&r" (intRes),
108 : [charIn1]
"d" (charIn1),
109 [intIn2]
"d" (intIn2)