When will you implement cent and ucent?

Era Scarecrow rtcvb32 at yahoo.com
Tue Mar 29 06:28:17 UTC 2022


On Monday, 28 March 2022 at 19:35:10 UTC, deadalnix wrote:
> Why do I even have to argue that case?

  Because different architectures and compilers do different 
things. And some people value correctness over speed, especially 
if later we do get 128bit registers we want it to work exactly as 
expected when it gets recompiled.

  Though i'm sure you know this and are just doing raw comparison 
of size.

  Writing these functions using purely C you can manage to get the 
job done but it's a lot more work and takes a lot more steps. I 
ended up writing some of my hardware specific functions 3 times, 
32bit, 64bit and generic. 32/64bit worked quite well with asm to 
speed things up for any size you'd want. Generic however didn't 
like it as much and actually is **SLOWER** than 32bit, but should 
work on anything and even works in CTFE (*to make it as close to 
a native type as i could*)

  What i wrote should be close to the level of the cpp example, 
just won't be inlined; Though i suppose i could write an inline 
one **just** for 128bit which would be a lot easier to inline for 
one level up...


More information about the Digitalmars-d mailing list