Re: safety and auto vectorization

2020-08-04 Thread Andy Balba via Digitalmars-d-learn
On Monday, 3 August 2020 at 19:42:51 UTC, Steven Schveighoffer wrote: On 8/3/20 3:22 PM, Bruce Carneal wrote: Thanks Steve (and Chad).  Summary: underspecified, varying behavior across versions, buggy. Steve, what's the best way for me to report this?  Are spec issues lumped in with the oth

Re: safety and auto vectorization

2020-08-03 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/3/20 3:22 PM, Bruce Carneal wrote: Thanks Steve (and Chad).  Summary: underspecified, varying behavior across versions, buggy. Steve, what's the best way for me to report this?  Are spec issues lumped in with the other bugzilla reports? Yep. You can file under dlang.org with the spec

Re: safety and auto vectorization

2020-08-03 Thread Bruce Carneal via Digitalmars-d-learn
On Monday, 3 August 2020 at 18:55:36 UTC, Steven Schveighoffer wrote: On 8/2/20 1:31 PM, Bruce Carneal wrote: import std; void f0(int[] a, int[] b, int[] dst) @safe {     dst[] = a[] + b[]; } [snip of auto-vectorization example] I was surprised that f0 ran just fine with a.length and b.le

Re: safety and auto vectorization

2020-08-03 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/2/20 1:31 PM, Bruce Carneal wrote: import std; void f0(int[] a, int[] b, int[] dst) @safe {     dst[] = a[] + b[]; } void f1(int[] a, int[] b, int[] dst) @trusted {     const minLen = min(a.length, b.length, dst.length);     dst[0..minLen] = a[0..minLen] + b[0..minLen];     assert(dst.

Re: safety and auto vectorization

2020-08-03 Thread Chad Joan via Digitalmars-d-learn
On Sunday, 2 August 2020 at 17:31:45 UTC, Bruce Carneal wrote: import std; void f0(int[] a, int[] b, int[] dst) @safe { dst[] = a[] + b[]; } void f1(int[] a, int[] b, int[] dst) @trusted { const minLen = min(a.length, b.length, dst.length); dst[0..minLen] = a[0..minLen] + b[0..minLe

safety and auto vectorization

2020-08-02 Thread Bruce Carneal via Digitalmars-d-learn
import std; void f0(int[] a, int[] b, int[] dst) @safe { dst[] = a[] + b[]; } void f1(int[] a, int[] b, int[] dst) @trusted { const minLen = min(a.length, b.length, dst.length); dst[0..minLen] = a[0..minLen] + b[0..minLen]; assert(dst.length == minLen); } I was surprised that f0