Forum > Embedded
Integer maths > 16 bits
MarkMLl:
What are the options for 32-, 64- and 128-bit five-function integer maths on devices like the RP2040 and arbitrary RISC-V targets, with minimal external dependencies?
Area of application is hash algorithms etc., with the assumption (please) that hardware support for these will not be available.
MarkMLl
Thaddy:
All you need is rolls, shifts, and, or, xor, not and a byte array.
This stems from the olden days. Easiest if there are not signs involved.
MarkMLl:
Actually Thaddy, I need + - * div mod and shr. I'm /entirely/ capable of writing them in assembler... I'd just rather not.
MarkMLl
PascalDragon:
--- Quote from: MarkMLl on September 15, 2024, 04:08:09 pm ---What are the options for 32-, 64- and 128-bit five-function integer maths on devices like the RP2040 and arbitrary RISC-V targets, with minimal external dependencies?
--- End quote ---
At least 32- and 64-bit math should be fully supported at least if you compile the RTL using software floating point (assuming the processor in question does not support the operations in hardware). If hardware support is available then everything should work out fine if you simply compile for the target.
Only for 128-bit math I don't know right now whether we have some suitable unit already.
MarkMLl:
--- Quote from: PascalDragon on September 15, 2024, 09:01:22 pm ---Only for 128-bit math I don't know right now whether we have some suitable unit already.
--- End quote ---
ATM it's the 128-bit case that's most interesting, but I thought I'd build up gradually through the other types since they might not (by default at least) be implemented on small chips.
MarkMLl
Navigation
[0] Message Index
[#] Next page