half datatype?

Manu turkeyman at gmail.com
Fri Nov 23 01:08:43 PST 2012


On 23 November 2012 05:03, xenon325 <1 at a.net> wrote:

> On Monday, 19 November 2012 at 15:48:23 UTC, Manu wrote:
>
>> This wouldn't strictly retain half precision though, it would be
>> slightly higher precision since the intermediates were full precision
>> (which is surely preferable?).
>>
>
> I would think it's actually not preferable.
> Imagine you developed and tuned all the code on x86 and everything is
> fine. Then run it on ARM and suddenly all computations are inaccurate.
>

I think it would always be the case that work is done in float space,
hardware support for half applies to fast load/store into full float
registers. You would lose precision too fast if work were done directly in
half space.
Most CPU's also apply this principle to integer work. It's typical to load
a byte/short into a 32/64bit register and sign extend or zero extend, then
all integer work is done in the maximum integer precision, and store then
truncates the top bits again. Many older FPU's work this way too.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121123/06dfd104/attachment.html>


More information about the Digitalmars-d mailing list