Am Mittwoch, dem 29.10.2025 um 17:00 +0100 schrieb Bertho Stultiens: > On 10/29/25 12:34 AM, andy pugh wrote: > > 1) Convert all int HAL pins to 64-bit. > > This will need *a lot* of work because code written for 32-bit uses > tricks and whatnot that are not necessarily compatible with 64-bit. > Each > and every driver needs to be checked, line for line, that it will > work > without problems and as advertised. Especially tricky are expected > implicit truncation in 32-bit word operations. Each instance must be > found and properly re-coded for 64-bit.
I don't think that there actually is that much code that relies on such behaviour, see the comment from andy regarding usage of "signed/unsigned". And IMHO relying on undefined behaviour (in the C/C++ language lawyer sense) like signed overflow is a bug that needs to be fixed, because sooner or later, some new compiler with additional "insights" into the code will optimize away such code (or stuff that depends on the undefined result). > > > 2) Do away with HAL parameters. Convert them all to full pins. > > Even though (most) parameters are located in shared memory, there is > a > real difference between pin and parameter access. Pins are always > indirect variables (must be dereferenced) in the HAL component, > whereas > parameters are direct variables. Converting parameters into pins adds > an > indirection and doubles the amount of shared memory accesses for any > operation. > in one typical 1kHz servo period we have O(millions) intructions on contemporary CPUs, even on "small" ones like arm cortex-Axx like in RPIs. a few hundred additional cycles won't affect anything. The problem is if some code misses to reserve memory for the parameters, that situation may be tricky to debug. and to be clear, both changes will be "internal", so not even writers of drivers / components will notice very much if anything at all. _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
