half datatype?

xenon325 1 at a.net
Sun Nov 25 18:43:26 PST 2012


On Friday, 23 November 2012 at 09:08:53 UTC, Manu wrote:
> 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.

Then it's ok, of course. Thanks for explaining!


More information about the Digitalmars-d mailing list