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 24, 2016, at 12:30 PM, Stephen Canon >>>

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, 2016, at 2:55 PM, John McCall via swift-dev mailto:swift

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 swift-dev wrote: > On Oct 22, 2016, at 10:39 AM, Chr

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:07 PM, Jordan Rose wrote: >> On Oct 24, 2016, at 12:58, John McCall via swift-dev > > 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 >>>

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

2016-10-24 Thread Jordan Rose via swift-dev
> On Oct 24, 2016, at 12:58, John McCall via swift-dev > 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 swift-dev wrote: > On Oct 22, 2016, at

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 Lattner wrote: > On Oct 20, 2016, at 2:59 PM, Joe

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, Joe Groff via swift-dev wrote: > > copysign( ) i

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 pick the first option. I’m not very worried about it, b

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 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 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 w

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, de-canonicalizing b11 might b

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 >> > wrote: >>> >>> On Oct 20, 2016, at 9:42 AM, Jordan Rose

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: >>> >>> - “Does not interpret” does not mean “does not preserve”. The

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: >>> I had a discussion with Steve this morning about the potentia

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: >>> >>> Some disconnected thoughts: >>> >>> - “Does not interpret”

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 great thing about >> floating-point is th

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 the most part, the > o

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 in the standard is "Note, however, that operat

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 "Note, however, that operations on bit >> stri

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 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 "Note, however, that operations on bit > strings—copy, negate, abs, copySign—specify the sign bit of a Na

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 si