In article , "Wilco Dijkstra" writes: |> |> > Try writing code to unpick an IEEE 754 floating-point number; once |> > you have done that, try doing that with an IEEE 754R decimal one :-) |> >
|> > With the current ISAs, doing that sort of bit-munging in software |> > can be a hundred times as expensive as it could be done in a very |> > small amount of hardware. |> |> Decoding/encoding IEEE 754 values typically takes 3-5 instructions on |> ARM, so it's pretty trivial in software. 754R decimal is a lot more more |> complex of course, but not nearly 100 times. One can decode a 50-bit |> mantissa in around 20-25 instructions on a 32-bit CPU.
I think that you mistook what I said.
If you can decode an IEEE 754 value in 3-5 instructions, and get all of the special cases right, then it has hardware assistance. Note that merely breaking the number up into fields is the easy part of the decoding. Stopping at that point isn't interesting.
And I said "a hundred times as expensive", not "100 instructions", though it could well be 100 executed instructions. The reason that I said it was expensive is that it will often/usually have a lot of mispredicted branches. You are aware that there are TWO formats of decimal, aren't you?
Regards, Nick Maclaren.