Re: [swift-dev] Making the sign of NaNs unspecified to enable enum layout optimization

2016-10-24 Thread Joe Groff via swift-dev
> On Oct 24, 2016, at 1:36 PM, John McCall wrote: > >> On Oct 24, 2016, at 1:23 PM, Joe Groff > > wrote: >>> On Oct 24, 2016, at 12:58 PM, John McCall >> > wrote: >>> On Oct

Re: [swift-dev] Making the sign of NaNs unspecified to enable enum layout optimization

2016-10-24 Thread John McCall via swift-dev
> On Oct 24, 2016, at 1:23 PM, Joe Groff wrote: >> On Oct 24, 2016, at 12:58 PM, John McCall > > wrote: >> >>> On Oct 24, 2016, at 12:30 PM, Stephen Canon >> > wrote: On Oct 24,

Re: [swift-dev] Making the sign of NaNs unspecified to enable enum layout optimization

2016-10-24 Thread Joe Groff via swift-dev
> On Oct 24, 2016, at 12:58 PM, John McCall wrote: > >> On Oct 24, 2016, at 12:30 PM, Stephen Canon wrote: >>> On Oct 24, 2016, at 2:55 PM, John McCall via swift-dev >>> wrote: >>> On Oct 24, 2016, at 8:49 AM, Joe Groff via

Re: [swift-dev] Making the sign of NaNs unspecified to enable enum layout optimization

2016-10-24 Thread John McCall via swift-dev
> On Oct 24, 2016, at 12:30 PM, Stephen Canon wrote: >> On Oct 24, 2016, at 2:55 PM, John McCall via swift-dev >> wrote: >> >>> On Oct 24, 2016, at 8:49 AM, Joe Groff via swift-dev >>> wrote: On Oct 22, 2016, at 10:39 AM, Chris

Re: [swift-dev] Making the sign of NaNs unspecified to enable enum layout optimization

2016-10-24 Thread Stephen Canon via swift-dev
> On Oct 24, 2016, at 2:55 PM, John McCall via swift-dev > wrote: > >> On Oct 24, 2016, at 8:49 AM, Joe Groff via swift-dev >> wrote: >>> On Oct 22, 2016, at 10:39 AM, Chris Lattner wrote: >>> On Oct 20, 2016, at 2:59 PM,

Re: [swift-dev] Making the sign of NaNs unspecified to enable enum layout optimization

2016-10-24 Thread John McCall via swift-dev
> On Oct 24, 2016, at 8:49 AM, Joe Groff via swift-dev > wrote: >> On Oct 22, 2016, at 10:39 AM, Chris Lattner wrote: >> >>> On Oct 20, 2016, at 2:59 PM, Joe Groff via swift-dev >>> wrote: copysign( ) is a reason to not

Re: [swift-dev] Making the sign of NaNs unspecified to enable enum layout optimization

2016-10-22 Thread Chris Lattner via swift-dev
> On Oct 20, 2016, at 2:59 PM, Joe Groff via swift-dev > wrote: >> >> copysign( ) is a reason to not pick the first option. I’m not very worried >> about it, but it is a reason. I see no problem with the second option. > > As we discussed in person this morning,

Re: [swift-dev] Making the sign of NaNs unspecified to enable enum layout optimization

2016-10-20 Thread Jordan Rose via swift-dev
> On Oct 20, 2016, at 12:59, Joe Groff wrote: > > >> On Oct 20, 2016, at 10:38 AM, Stephen Canon > > wrote: >> >>> >>> On Oct 20, 2016, at 10:04 AM, Joe Groff via swift-dev >> >

Re: [swift-dev] Making the sign of NaNs unspecified to enable enum layout optimization

2016-10-20 Thread Joe Groff via swift-dev
> On Oct 20, 2016, at 10:38 AM, Stephen Canon wrote: > >> >> On Oct 20, 2016, at 10:04 AM, Joe Groff via swift-dev >> wrote: >> >> >>> On Oct 20, 2016, at 9:42 AM, Jordan Rose wrote: >>> >>> Some disconnected thoughts: >>>

Re: [swift-dev] Making the sign of NaNs unspecified to enable enum layout optimization

2016-10-20 Thread John McCall via swift-dev
> On Oct 20, 2016, at 10:50 AM, Joe Groff wrote: >> On Oct 20, 2016, at 10:45 AM, John McCall > > wrote: >> >>> On Oct 19, 2016, at 8:42 PM, Joe Groff via swift-dev >> > wrote:

Re: [swift-dev] Making the sign of NaNs unspecified to enable enum layout optimization

2016-10-20 Thread Joe Groff via swift-dev
> On Oct 20, 2016, at 10:35 AM, Jordan Rose wrote: > >> >> On Oct 20, 2016, at 10:04, Joe Groff > > wrote: >> >> >>> On Oct 20, 2016, at 9:42 AM, Jordan Rose >> > wrote:

Re: [swift-dev] Making the sign of NaNs unspecified to enable enum layout optimization

2016-10-20 Thread Joe Groff via swift-dev
> On Oct 20, 2016, at 10:45 AM, John McCall wrote: > >> On Oct 19, 2016, at 8:42 PM, Joe Groff via swift-dev >> wrote: >> I had a discussion with Steve this morning about the potential for enum >> layout optimization with floating-point payloads. One

Re: [swift-dev] Making the sign of NaNs unspecified to enable enum layout optimization

2016-10-20 Thread John McCall via swift-dev
> On Oct 19, 2016, at 8:42 PM, Joe Groff via swift-dev > wrote: > I had a discussion with Steve this morning about the potential for enum > layout optimization with floating-point payloads. One great thing about > floating-point is that it has NaNs, and lots of them. For

Re: [swift-dev] Making the sign of NaNs unspecified to enable enum layout optimization

2016-10-20 Thread Stephen Canon via swift-dev
> On Oct 20, 2016, at 10:04 AM, Joe Groff via swift-dev > wrote: > > >> On Oct 20, 2016, at 9:42 AM, Jordan Rose wrote: >> >> Some disconnected thoughts: >> >> - “Does not interpret” does not mean “does not preserve”. The very next >> sentence

Re: [swift-dev] Making the sign of NaNs unspecified to enable enum layout optimization

2016-10-20 Thread Jordan Rose via swift-dev
> On Oct 20, 2016, at 10:04, Joe Groff wrote: > > >> On Oct 20, 2016, at 9:42 AM, Jordan Rose wrote: >> >> Some disconnected thoughts: >> >> - “Does not interpret” does not mean “does not preserve”. The very next >> sentence in the standard is

Re: [swift-dev] Making the sign of NaNs unspecified to enable enum layout optimization

2016-10-20 Thread Jordan Rose via swift-dev
Some disconnected thoughts: - “Does not interpret” does not mean “does not preserve”. The very next sentence in the standard is "Note, however, that operations on bit strings—copy, negate, abs, copySign—specify the sign bit of a NaN result, sometimes based upon the sign bit of a NaN operand."

[swift-dev] Making the sign of NaNs unspecified to enable enum layout optimization

2016-10-19 Thread Joe Groff via swift-dev
I had a discussion with Steve this morning about the potential for enum layout optimization with floating-point payloads. One great thing about floating-point is that it has NaNs, and lots of them. For the most part, the only significant semantic difference among these NaNs is whether they're