January 28, 2013 Implementing Half Floats in D | ||||
---|---|---|---|---|
| ||||
http://www.drdobbs.com/cpp/implementing-half-floats-in-d/240146674 Anyone care to do the reddit honors? |
January 28, 2013 Re: Implementing Half Floats in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Monday, 28 January 2013 at 23:11:11 UTC, Walter Bright wrote:
> http://www.drdobbs.com/cpp/implementing-half-floats-in-d/240146674
>
> Anyone care to do the reddit honors?
[quote]
and crushed back down to 16 bytes for storage.
[/quote]
Should be bits. Otherwise it looks really well done.
|
January 28, 2013 Re: Implementing Half Floats in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Mon, 28 Jan 2013 15:11:06 -0800, Walter Bright wrote: > http://www.drdobbs.com/cpp/implementing-half-floats-in-d/240146674 > > Anyone care to do the reddit honors? Posted to /r/d_language, perhaps a x-post to /r/programming would be in order? http://www.reddit.com/r/d_language/comments/17gkrk/ implementing_half_floats_in_d_dr_dobbs/ |
January 28, 2013 Re: Implementing Half Floats in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Justin Whear | On 1/28/13 6:40 PM, Justin Whear wrote: > On Mon, 28 Jan 2013 15:11:06 -0800, Walter Bright wrote: > >> http://www.drdobbs.com/cpp/implementing-half-floats-in-d/240146674 >> >> Anyone care to do the reddit honors? > > Posted to /r/d_language, perhaps a x-post to /r/programming would be in > order? > > http://www.reddit.com/r/d_language/comments/17gkrk/ > implementing_half_floats_in_d_dr_dobbs/ Not sure what's going on, I tried to submit and got "already submitted" and then got redirected to http://www.reddit.com/r/programming/comments/16ycws/implementing_half_floats_in_d/ Hoever, I can't find the post in http://www.reddit.com/r/programming/new/ Andrei |
January 28, 2013 Re: Implementing Half Floats in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Mon, 28 Jan 2013 18:50:22 -0500, Andrei Alexandrescu wrote: > On 1/28/13 6:40 PM, Justin Whear wrote: >> On Mon, 28 Jan 2013 15:11:06 -0800, Walter Bright wrote: >> >>> http://www.drdobbs.com/cpp/implementing-half-floats-in-d/240146674 >>> >>> Anyone care to do the reddit honors? >> >> Posted to /r/d_language, perhaps a x-post to /r/programming would be in order? >> >> http://www.reddit.com/r/d_language/comments/17gkrk/ implementing_half_floats_in_d_dr_dobbs/ > > Not sure what's going on, I tried to submit and got "already submitted" and then got redirected to http://www.reddit.com/r/programming/comments/16ycws/ implementing_half_floats_in_d/ > > Hoever, I can't find the post in http://www.reddit.com/r/programming/new/ > > > Andrei Possibly this: http://code.reddit.com/wiki/help/ faq#Whyisntmysubmissioncommentshowingup Walter is an admin; maybe he can check on it? |
January 28, 2013 Re: Implementing Half Floats in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On 1/28/2013 3:50 PM, Andrei Alexandrescu wrote:
> Not sure what's going on, I tried to submit and got "already submitted" and then
> got redirected to
> http://www.reddit.com/r/programming/comments/16ycws/implementing_half_floats_in_d/
8 days old, durn, it's sunsetted.
|
January 28, 2013 Re: Implementing Half Floats in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Era Scarecrow | On 1/28/2013 3:30 PM, Era Scarecrow wrote:
> On Monday, 28 January 2013 at 23:11:11 UTC, Walter Bright wrote:
>> http://www.drdobbs.com/cpp/implementing-half-floats-in-d/240146674
>>
>> Anyone care to do the reddit honors?
>
> [quote]
> and crushed back down to 16 bytes for storage.
> [/quote]
>
> Should be bits. Otherwise it looks really well done.
thank you. Sorry that didn't get caught in review!
|
January 29, 2013 Re: Implementing Half Floats in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright: > http://www.drdobbs.com/cpp/implementing-half-floats-in-d/240146674 From the article: >Built-in types tend to run faster because the optimizer can take advantage of mathematical identities,< Generally in D we like the compiler to verify user-applied annotations like pure and const. For the compiler of a normal language today it's probably too much difficult to prove the theorems coming from those identities on user defined types. But if the compiler assumes the programmer to be right on this (because such types are usually defined in well reviewed libraries), then I think it's not too much hard to invent a small set of @annotations that attached to a user defined struct tell the compiler to allow some optimizations typical of integral numbers, floating point numbers, complex numbers, gaussian integers, quaternions, octonions and few others, according to them having associative, commutative, etc, properties, or not having them. Bye, bearophile |
January 29, 2013 Re: Implementing Half Floats in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On Tue, Jan 29, 2013 at 01:44:20AM +0100, bearophile wrote: > Walter Bright: > > >http://www.drdobbs.com/cpp/implementing-half-floats-in-d/240146674 > > From the article: > > >Built-in types tend to run faster because the optimizer can take advantage of mathematical identities,< > > Generally in D we like the compiler to verify user-applied annotations like pure and const. For the compiler of a normal language today it's probably too much difficult to prove the theorems coming from those identities on user defined types. But if the compiler assumes the programmer to be right on this (because such types are usually defined in well reviewed libraries), then I think it's not too much hard to invent a small set of @annotations that attached to a user defined struct tell the compiler to allow some optimizations typical of integral numbers, floating point numbers, complex numbers, gaussian integers, quaternions, octonions and few others, according to them having associative, commutative, etc, properties, or not having them. [...] +1. I've always wanted a language capable of user-specified optimizations for custom types. This would be very useful on things like matrix types, which would otherwise require heavy trickery with expression templates in order to produce efficient code. T -- May you live all the days of your life. -- Jonathan Swift |
January 29, 2013 Re: Implementing Half Floats in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Monday, 28 January 2013 at 23:58:40 UTC, Walter Bright wrote:
> On 1/28/2013 3:30 PM, Era Scarecrow wrote:
>> On Monday, 28 January 2013 at 23:11:11 UTC, Walter Bright wrote:
>>> http://www.drdobbs.com/cpp/implementing-half-floats-in-d/240146674
>>>
>>> Anyone care to do the reddit honors?
>>
>> [quote]
>> and crushed back down to 16 bytes for storage.
>> [/quote]
>>
>> Should be bits. Otherwise it looks really well done.
>
> thank you. Sorry that didn't get caught in review!
"HalfFloat h = hf!1.3f;"
Maybe you could also demonstrate that it's possible to implement another literal syntax?
HalfFloat h = 1.3.hf;
some people will prefer that for sure.
|
Copyright © 1999-2021 by the D Language Foundation