Another example is the decline of **[binary-coded decimal instructions][1]** In the past it was common for computers to be decimal or have instructions for decimal operations. For example [x86 has AAM, AAD, AAA, FBLD...][2] for operating on packed, unpacked and 10-byte BCD values. Many other classic architectures also have similar features > Several microprocessor families offer limited decimal support. For example, the 80x86 family of microprocessors provide instructions to convert one-byte BCD numbers (packed and unpacked) to binary format before or after arithmetic operations.[<sup>\[3\]</sup>][3] These operations were not extended to wider formats and hence are now slower than using 32-bit or wider BCD 'tricks' to compute in BCD (see [\[1\]][4]). The x87 FPU has instructions to convert 10-byte (18 decimal digits) packed decimal data, although it then operates on them as floating-point numbers. > > The Motorola 68000 provided instructions for BCD addition and subtraction;[<sup>\[4\]</sup>][5] as does the 6502. In the much later 68000 family-derived processors, these instructions were removed when the Coldfire instruction set was defined, and all IBM mainframes also provide BCD integer arithmetic in hardware. The Zilog Z80, Motorola 6800 and its derivatives, together with other 8-bit processors, and also the Intel x86 family have special instructions that support conversion to and from BCD. The Psion Organiser I handheld computer’s manufacturer-supplied software implemented its floating point operations in software using BCD entirely. All later Psion models used binary only, rather than BCD. > > https://en.wikipedia.org/wiki/Decimal_computer#More_modern_computers However they're rarely used, since *modern languages often don't have a way to access those instructions*. They either lack a decimal integer type completely (like C or Pascal), or doesn't have a decimal type that can map cleanly to BCD instructions The result is that **BCD instructions started to disappear**. In x86 they're micro-coded, therefore very slow, which makes people further avoid them. Later AMD removed BCD instructions in x64-64. Other manufacturers did the same in newer versions of their architectures. Having said that, a remnant of BCD operations is still there in the [FLAGS register][6] in x86-64 and many other platforms that use flags: the [half-carry flag][7]. Newly implemented architectures like ARM, MIPS, Sparc, RISC-V also didn't get any BCD instructions and most of them don't use a flag register In fact C and C++ allow `float`, `double` and `long double` to be decimal, however none of the implementations use it for the default floating-point types, because modern computers are all binary and are bad at decimal operations. Very few architectures have decimal floating-point support Many C and C++ compilers do have decimal floating-point types as an *extension*, such as [gcc with `_Decimal32`, `_Decimal64`, and `_Decimal128`][8]. Similarly some other modern languages also have [decimal types][9], however those are mostly big floating-point types for financial or scientific problems and not an integer BCD type. For example [`decimal` in C#][10] is a floating-point type with the mantissa stored in binary, thus BCD instructions would be no help here. Arbitrary-precision decimal types like `BigInteger` in C# and `BigDecimal` in Ruby or Java also store the mantissa as binary instead of decimal for performance. A few languages do have a **fixed-point** decimal monetary type, but the significant part is also in binary That said, a few floating-point formats can still be stored in BCD or a related form. For example the mantissa in [IEEE-754 decimal floating-point types][11] can be stored in either [binary][12] or [DPD][13] (a highly-packed decimal format which can then be converted to BCD easily). However I doubt that decimal IEEE-754 libraries use BCD instructions, because they're often not exist at all in modern computers, or in case they really exist they'd be extremely slow > BCD was used in many early decimal computers, and is implemented in the instruction set of machines such as the IBM System/360 series and its descendants, Digital Equipment Corporation's VAX, the Burroughs B1700, and the Motorola 68000-series processors. Although BCD per se is not as widely used as in the past and is no longer implemented in newer computers' instruction sets (such as ARM; x86 does not support its BCD instructions in long mode any more), decimal fixed-point and floating-point formats are still important and continue to be used in financial, commercial, and industrial computing, where subtle conversion and fractional rounding errors that are inherent in floating point binary representations cannot be tolerated. > > https://en.wikipedia.org/wiki/Binary-coded_decimal#Other_computers_and_BCD - [Does a compiler use all x86 instructions?][14] - [Does a compiler use all x86 instructions? (2010)][15] - [Do modern x86 processors have native support for decimal floating point arithmetic?](https://stackoverflow.com/q/47000444/995714) [1]: https://en.wikipedia.org/wiki/Binary-coded_decimal#Other_computers_and_BCD [2]: https://en.wikipedia.org/wiki/Intel_BCD_opcode [3]: https://web.archive.org/web/20070715175818/http://webster.cs.ucr.edu/Page_TechDocs/MASMDoc/ProgrammersGuide/Chap_06.htm [4]: http://www.cs.uiowa.edu/~jones/bcd/bcd.html [5]: http://www.freescale.com/files/archives/doc/ref_manual/M68000PRM.pdf [6]: https://en.wikipedia.org/wiki/FLAGS_register [7]: https://en.wikipedia.org/wiki/Half-carry_flag [8]: https://gcc.gnu.org/onlinedocs/gcc/Decimal-Float.html [9]: https://en.wikipedia.org/wiki/Decimal_data_type [10]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/decimal [11]: https://en.wikipedia.org/wiki/IEEE_754#Basic_and_interchange_formats [12]: https://en.wikipedia.org/wiki/Binary_integer_decimal [13]: https://en.wikipedia.org/wiki/Densely_packed_decimal [14]: http://pepijndevos.nl/2016/08/24/x86-instruction-distribution.html [15]: https://news.ycombinator.com/item?id=12352959