Re:Understanding the x86's Decimal Adjust after Addition (DA...
by awesomedad on Tuesday January 31, 2023 @05:09PM
(#34602986)
Advanced enough, or are we brute forcing it?
Re:Understanding the x86's Decimal Adjust after Addition (DA...
by segfaultbuserr on Tuesday January 31, 2023 @07:03PM
(#34604233)
Excellent question. I'd say it's "advanced enough" in terms of semiconductor process node, "brute-force enough" in terms of circuit logic. A barrel shifter is definitely one of the most "brute-force" kind of logic circuits - you want to shift many bits in a word, but at the same time in a single cycle? Just use a large matrix to connect every possible input bits to every possible output bits. Early chips simply couldn't afford the die area on this non-essential but nice-to-have feature.
Supporting BCD arithmetic was not just for compatibility, but necessity. If the number is frequently updated, storing it in BCD was the fastest solution.
It's fortunate that computers are advanced enough today that we usually don't need to worry about the overhead of printf("%d", integer) anymore.