4 ms·
I’ve seen some terrible horrid nonsense from them and even the best compilers don’t use a third of the opcodes our modern CPUs boast of. Nobody understands the
by Glandalf 2mo ago
I’ve seen some terrible horrid nonsense from them and even the best compilers don’t use a third of the opcodes our modern CPUs boast of. Nobody understands the big compilers any more either, they’re all too huge. And soon AI will be “improving” hem too.
You want to see a beautiful compiler? Look at Plan 9’s compiler suite. A man could understand and even build on that.
- bluGill 2mo agoHow does the resulting code compared to what a modern compiler gives me. I don't maintain compilers for a living, I maintain other code, which is ultimately longer and more complex than a C++ compiler. And so if my compiler, by becoming a little bit more complex, can make my resulting code a lot simpler because I don't have to do inline optimizations of various sorts, that makes my life much easier and is a good trade-off since there's a lot more programs in the world than there are compilers.
- Someone 2mo ago> even the best compilers don’t use a third of the opcodes our modern CPUs boast of That’s not necessarily an indication of the weakness of compilers. It also could be an indication that hardware designers could leave out instructions. X86, in particular, will have lots of them for backwards compatibility reasons (extreme example: the old 80-bit x87 FP stack) There also are instructions that are expected to never get used by ‘normal’ compilers but cannot be removed because they only make sense in lower-level code such as those for switching between protection levels, implementing compare-and-swap, etc.
- gmueckl 2mo agox87 support may not be the most obscure part of the instruction set. Ther is also hardware support for BCD math in 16 bit amd 32 bit mode. Who uses that anymore?
- ks6g10 2mo agoUnfortunately some exchanges (twse) uses packed BCD encoding.
- Joker_vD 2mo agoBCD allows for insanely fast conversion to and from decimal string representation. And if doing arithmetic in it is only slightly worse than doing it in binary... it may actually be faster on the whole for some workloads.
- gmueckl 2mo agoBut those instructions were dropped in 64 bit mode.
- anamax 2mo agobcd is a reasonable way to do fixed-point decimal arithmetic. binary floating point, let alone IEEE, is almost useless for implementing decimal arithmetic.