Re:Reverse-engineering the conditional jump circuitry in the...
by Gordonjcp on Tuesday January 24, 2023 @03:54AM
(#34501225)
Wait, so if you were imaginative enough with how you use registers to calculate addresses you could abuse LEA as a DSP MAC (multiply/accumulate) instruction?
[ Parent
| on HN ]
Re:Reverse-engineering the conditional jump circuitry in the...
by moefh on Tuesday January 24, 2023 @04:15AM
(#34501376)
Compilers do it all the time, for example GCC compiles "x*4 + y" to a single LEA instruction: https://godbolt.org/z/TvdW5sK4b
Re:Reverse-engineering the conditional jump circuitry in the...
by Gordonjcp on Tuesday January 24, 2023 @09:03AM
(#34503635)
Aha, playing with it, it looks like the multiply is just a shift because if you try to do anything other than powers of two it has to break it down into more instructions.
Still clever, though. I guess it's to make it easier and quicker to index over words or multiples of words?